diff --git a/PBGitCommitView.xib b/PBGitCommitView.xib index 429cbe6..57beb45 100644 --- a/PBGitCommitView.xib +++ b/PBGitCommitView.xib @@ -8,6 +8,7 @@ 352.00 YES + YES @@ -27,7 +28,7 @@ NSApplication - + 274 YES @@ -96,6 +97,7 @@ {852, 173} + @@ -218,7 +220,7 @@ 1.700000e+01 - -700448768 + -566231040 4 15 0 @@ -227,6 +229,7 @@ {{1, 1}, {188, 193}} + 4 @@ -253,6 +256,7 @@ {190, 195} + 562 @@ -332,6 +336,29 @@ 2322 + + YES + + YES + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + CorePasteboardFlavorType 0x75726C20 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + + {427, 14} @@ -407,6 +434,7 @@ {{1, 1}, {427, 157}} + @@ -438,6 +466,7 @@ {{0, 36}, {429, 159}} + 530 @@ -561,7 +590,7 @@ 1.700000e+01 - -700448768 + -566231040 4 15 0 @@ -570,6 +599,7 @@ {{1, 1}, {213, 193}} + 4 @@ -596,6 +626,7 @@ {215, 195} + 562 @@ -649,6 +680,7 @@ {852, 432} + NSView diff --git a/PBWebChangesController.m b/PBWebChangesController.m index e8a4994..fe88f90 100644 --- a/PBWebChangesController.m +++ b/PBWebChangesController.m @@ -37,7 +37,8 @@ change:(NSDictionary *)change context:(void *)context { - if ([[object selectedObjects] count] == 0) + int count = [[object selectedObjects] count]; + if (count == 0) return; // TODO: Move this to commitcontroller @@ -46,12 +47,22 @@ else [unstagedFilesController setSelectionIndexes:[NSIndexSet indexSet]]; + if (count > 1) { + [self showMultiple: [object selectedObjects]]; + return; + } + selectedFile = [[object selectedObjects] objectAtIndex:0]; selectedFileIsCached = object == cachedFilesController; [self refresh]; } +- (void) showMultiple: (NSArray *)objects +{ + [[self script] callWebScriptMethod:@"showMultipleFilesSelection" withArguments:[NSArray arrayWithObject:objects]]; +} + - (void) refresh { if (!finishedLoading || !selectedFile) diff --git a/html/views/commit/index.html b/html/views/commit/index.html index b59ca1b..d391ed6 100644 --- a/html/views/commit/index.html +++ b/html/views/commit/index.html @@ -9,6 +9,7 @@ + diff --git a/html/views/commit/multipleSelection.js b/html/views/commit/multipleSelection.js new file mode 100644 index 0000000..9a2d9f3 --- /dev/null +++ b/html/views/commit/multipleSelection.js @@ -0,0 +1,19 @@ +var showMultipleFilesSelection = function(files) +{ + + $("title").innerHTML = "Multiple selection"; + + var div = $("diff"); + + var contents = "

Multiple Selection:

"; + contents += "
    "; + + for (var i = 0; i < files.length; ++i) + { + var file = files[i]; + contents += "
  • " + file.path + "
  • "; + } + contents += "
"; + + div.innerHTML = contents; +} \ No newline at end of file