PBGitHistory: Add "Show in Finder" to files

This adds the "Show in Finder" menu-entry and logic to files in the
tree-view of the history. Also the button "Show commits touching paths"
was renamed to "Show history of files".

Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
This commit is contained in:
Johannes Gilger
2009-06-13 11:08:01 +02:00
committed by Pieter de Bie
parent d973dc5ba7
commit dc234cfdc9
3 changed files with 49 additions and 8 deletions
+2 -1
View File
@@ -41,7 +41,8 @@
- (IBAction) toggleQuickView: sender;
- (IBAction) openSelectedFile: sender;
- (void) updateQuicklookForce: (BOOL) force;
- (void) showCommitsFromTree:(id) sender;
- (void)showCommitsFromTree:(id)sender;
- (void)showInFinderAction:(id)sender;
- (void) copyCommitInfo;
+15 -1
View File
@@ -218,7 +218,7 @@
return menu;
}
- (void) showCommitsFromTree:(id) sender
- (void)showCommitsFromTree:(id)sender
{
// TODO: Enable this from webview as well!
@@ -230,4 +230,18 @@
repository.currentBranch = [repository addBranch:revSpec];
}
- (void)showInFinderAction:(id)sender
{
NSString *workingDirectory = [[repository workingDirectory] stringByAppendingString:@"/"];
NSString *path;
NSWorkspace *ws = [NSWorkspace sharedWorkspace];
for (PBGitTree *tree in [treeController selectedObjects]) {
path = [workingDirectory stringByAppendingPathComponent:[tree fullPath]];
[ws selectFile: path inFileViewerRootedAtPath:path];
}
}
@end
+32 -6
View File
@@ -8,9 +8,9 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="275"/>
<integer value="276"/>
<integer value="237"/>
<integer value="27"/>
<integer value="9"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1524,7 +1524,15 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMenuItem" id="661418857">
<reference key="NSMenu" ref="500542810"/>
<string key="NSTitle">Commits touching paths</string>
<string key="NSTitle">Show history of file(s)</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="908677745"/>
<reference key="NSMixedImage" ref="746375230"/>
</object>
<object class="NSMenuItem" id="85225954">
<reference key="NSMenu" ref="500542810"/>
<string key="NSTitle">Show in Finder</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="908677745"/>
@@ -2138,6 +2146,14 @@
</object>
<int key="connectionID">282</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">showInFinderAction:</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="85225954"/>
</object>
<int key="connectionID">285</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -2774,6 +2790,7 @@
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="661418857"/>
<reference ref="85225954"/>
</object>
<reference key="parent" ref="1002"/>
</object>
@@ -2782,6 +2799,11 @@
<reference key="object" ref="661418857"/>
<reference key="parent" ref="500542810"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">284</int>
<reference key="object" ref="85225954"/>
<reference key="parent" ref="500542810"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -2866,6 +2888,7 @@
<string>276.IBPluginDependency</string>
<string>28.IBPluginDependency</string>
<string>28.IBShouldRemoveOnLegacySave</string>
<string>284.IBPluginDependency</string>
<string>29.IBPluginDependency</string>
<string>29.IBShouldRemoveOnLegacySave</string>
<string>3.IBPluginDependency</string>
@@ -2995,11 +3018,12 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{126, 715}, {223, 23}}</string>
<string>{{225, 683}, {202, 43}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<reference ref="9"/>
@@ -3031,7 +3055,7 @@
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{59, 317}, {852, 432}}</string>
<string>{{76, 44}, {852, 432}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -3066,7 +3090,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">282</int>
<int key="maxID">285</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -3107,6 +3131,7 @@
<string>setRawView:</string>
<string>setTreeView:</string>
<string>showCommitsFromTree:</string>
<string>showInFinderAction:</string>
<string>toggleQuickView:</string>
</object>
<object class="NSMutableArray" key="dict.values">
@@ -3118,6 +3143,7 @@
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">