Skip to content

Commit 9de4b4c

Browse files
History view shows file's icons
1 parent 17a4935 commit 9de4b4c

File tree

2 files changed

+50
-29
lines changed

2 files changed

+50
-29
lines changed

PBGitHistoryController.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define QLPreviewPanel NSClassFromString(@"QLPreviewPanel")
2525
#import "PBQLTextView.h"
2626

27+
#import "PBSourceViewCell.h"
2728

2829
#define kHistorySelectedDetailIndexKey @"PBHistorySelectedDetailIndex"
2930
#define kHistoryDetailViewIndex 0
@@ -83,8 +84,10 @@ - (void)awakeFromNib
8384
bottomColor:[NSColor colorWithCalibratedHue:0.579 saturation:0.119 brightness:0.765 alpha:1.000]];
8485
//[scopeBarView setTopShade:207/255.0 bottomShade:180/255.0];
8586
[self updateBranchFilterMatrix];
87+
8688

8789
[super awakeFromNib];
90+
[fileBrowser setDelegate:self];
8891
}
8992

9093
- (void)updateKeys
@@ -755,4 +758,15 @@ - (NSRect)previewPanel:(id)panel sourceFrameOnScreenForPreviewItem:(id <QLPrevie
755758
return iconRect;
756759
}
757760

761+
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(PBSourceViewCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
762+
{
763+
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
764+
PBGitTree *object = [item representedObject];
765+
NSString *workingDirectory = [[repository workingDirectory] stringByAppendingString:@"/"];
766+
NSString *path = [workingDirectory stringByAppendingPathComponent:[object fullPath]];
767+
NSImage *image = [workspace iconForFile:path];
768+
[image setSize:NSMakeSize(15, 15)];
769+
[cell setImage:image];
770+
}
771+
758772
@end

PBGitHistoryView.xib

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<data>
44
<int key="IBDocument.SystemTarget">1050</int>
55
<string key="IBDocument.SystemVersion">10F569</string>
6-
<string key="IBDocument.InterfaceBuilderVersion">788</string>
6+
<string key="IBDocument.InterfaceBuilderVersion">823</string>
77
<string key="IBDocument.AppKitVersion">1038.29</string>
88
<string key="IBDocument.HIToolboxVersion">461.00</string>
99
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
@@ -15,8 +15,8 @@
1515
</object>
1616
<object class="NSMutableArray" key="dict.values">
1717
<bool key="EncodedWithXMLCoder">YES</bool>
18-
<string>788</string>
19-
<string>788</string>
18+
<string>823</string>
19+
<string>823</string>
2020
</object>
2121
</object>
2222
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
@@ -29,13 +29,8 @@
2929
<string>com.apple.WebKitIBPlugin</string>
3030
</object>
3131
<object class="NSMutableDictionary" key="IBDocument.Metadata">
32-
<bool key="EncodedWithXMLCoder">YES</bool>
33-
<object class="NSArray" key="dict.sortedKeys" id="0">
34-
<bool key="EncodedWithXMLCoder">YES</bool>
35-
</object>
36-
<object class="NSMutableArray" key="dict.values">
37-
<bool key="EncodedWithXMLCoder">YES</bool>
38-
</object>
32+
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
33+
<integer value="1" key="NS.object.0"/>
3934
</object>
4035
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
4136
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -517,7 +512,7 @@
517512
<integer value="1"/>
518513
</object>
519514
</object>
520-
<string key="NS.format">MMMM d, yyyy h:mm a</string>
515+
<string key="NS.format">d MMMM yyyy HH:mm</string>
521516
<bool key="NS.natural">NO</bool>
522517
</object>
523518
<reference key="NSControlView" ref="254268962"/>
@@ -2159,7 +2154,9 @@
21592154
<bool key="EncodedWithXMLCoder">YES</bool>
21602155
<object class="IBObjectRecord">
21612156
<int key="objectID">0</int>
2162-
<reference key="object" ref="0"/>
2157+
<object class="NSArray" key="object" id="0">
2158+
<bool key="EncodedWithXMLCoder">YES</bool>
2159+
</object>
21632160
<reference key="children" ref="1000"/>
21642161
<nil key="parent"/>
21652162
</object>
@@ -2776,6 +2773,7 @@
27762773
<string>16.IBPluginDependency</string>
27772774
<string>17.IBPluginDependency</string>
27782775
<string>18.IBPluginDependency</string>
2776+
<string>19.CustomClassName</string>
27792777
<string>19.IBPluginDependency</string>
27802778
<string>2.CustomClassName</string>
27812779
<string>2.IBEditorWindowLastContentRect</string>
@@ -2893,6 +2891,7 @@
28932891
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
28942892
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
28952893
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
2894+
<string>PBIconAndTextCell</string>
28962895
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
28972896
<string>PBCollapsibleSplitView</string>
28982897
<string>{{312, 577}, {852, 384}}</string>
@@ -3127,6 +3126,13 @@
31273126
<string key="minorKey">NSApplication+GitXScripting.h</string>
31283127
</object>
31293128
</object>
3129+
<object class="IBPartialClassDescription">
3130+
<string key="className">NSCell</string>
3131+
<object class="IBClassDescriptionSource" key="sourceIdentifier">
3132+
<string key="majorKey">IBProjectSource</string>
3133+
<string key="minorKey">View/CellTrackingRect.h</string>
3134+
</object>
3135+
</object>
31303136
<object class="IBPartialClassDescription">
31313137
<string key="className">NSOutlineView</string>
31323138
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -3556,9 +3562,7 @@
35563562
<bool key="EncodedWithXMLCoder">YES</bool>
35573563
<object class="NSArray" key="dict.sortedKeys">
35583564
<bool key="EncodedWithXMLCoder">YES</bool>
3559-
<string>selectBasicSearch:</string>
3560-
<string>selectPickaxeSearch:</string>
3561-
<string>selectRegexSearch:</string>
3565+
<string>selectSearchMode:</string>
35623566
<string>stepperPressed:</string>
35633567
<string>updateSearch:</string>
35643568
</object>
@@ -3567,32 +3571,20 @@
35673571
<string>id</string>
35683572
<string>id</string>
35693573
<string>id</string>
3570-
<string>id</string>
3571-
<string>id</string>
35723574
</object>
35733575
</object>
35743576
<object class="NSMutableDictionary" key="actionInfosByName">
35753577
<bool key="EncodedWithXMLCoder">YES</bool>
35763578
<object class="NSArray" key="dict.sortedKeys">
35773579
<bool key="EncodedWithXMLCoder">YES</bool>
3578-
<string>selectBasicSearch:</string>
3579-
<string>selectPickaxeSearch:</string>
3580-
<string>selectRegexSearch:</string>
3580+
<string>selectSearchMode:</string>
35813581
<string>stepperPressed:</string>
35823582
<string>updateSearch:</string>
35833583
</object>
35843584
<object class="NSMutableArray" key="dict.values">
35853585
<bool key="EncodedWithXMLCoder">YES</bool>
35863586
<object class="IBActionInfo">
3587-
<string key="name">selectBasicSearch:</string>
3588-
<string key="candidateClassName">id</string>
3589-
</object>
3590-
<object class="IBActionInfo">
3591-
<string key="name">selectPickaxeSearch:</string>
3592-
<string key="candidateClassName">id</string>
3593-
</object>
3594-
<object class="IBActionInfo">
3595-
<string key="name">selectRegexSearch:</string>
3587+
<string key="name">selectSearchMode:</string>
35963588
<string key="candidateClassName">id</string>
35973589
</object>
35983590
<object class="IBActionInfo">
@@ -3670,6 +3662,14 @@
36703662
<string key="minorKey">PBHistorySearchController.h</string>
36713663
</object>
36723664
</object>
3665+
<object class="IBPartialClassDescription">
3666+
<string key="className">PBIconAndTextCell</string>
3667+
<string key="superclassName">NSTextFieldCell</string>
3668+
<object class="IBClassDescriptionSource" key="sourceIdentifier">
3669+
<string key="majorKey">IBProjectSource</string>
3670+
<string key="minorKey">PBIconAndTextCell.h</string>
3671+
</object>
3672+
</object>
36733673
<object class="IBPartialClassDescription">
36743674
<string key="className">PBNiceSplitView</string>
36753675
<string key="superclassName">NSSplitView</string>
@@ -4464,6 +4464,13 @@
44644464
<string key="minorKey">QuartzCore.framework/Headers/CIImageProvider.h</string>
44654465
</object>
44664466
</object>
4467+
<object class="IBPartialClassDescription">
4468+
<string key="className">NSObject</string>
4469+
<object class="IBClassDescriptionSource" key="sourceIdentifier">
4470+
<string key="majorKey">IBFrameworkSource</string>
4471+
<string key="minorKey">ScriptingBridge.framework/Headers/SBApplication.h</string>
4472+
</object>
4473+
</object>
44674474
<object class="IBPartialClassDescription">
44684475
<string key="className">NSObject</string>
44694476
<object class="IBClassDescriptionSource" key="sourceIdentifier">

0 commit comments

Comments
 (0)