mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Show current branch in branch menu
This kept going broken, so now instead of Interface Builder bindings, we create the binding ourselves
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
<string key="IBDocument.HIToolboxVersion">352.00</string>
|
||||
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<integer value="59"/>
|
||||
</object>
|
||||
<object class="NSArray" key="IBDocument.PluginDependencies">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -72,10 +71,9 @@
|
||||
<reference key="NSToolbarItemPaletteLabel" ref="904399424"/>
|
||||
<nil key="NSToolbarItemToolTip"/>
|
||||
<object class="NSSearchField" key="NSToolbarItemView" id="212418890">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">265</int>
|
||||
<string key="NSFrame">{{0, 14}, {183, 22}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSSearchFieldCell" key="NSCell" id="902542524">
|
||||
<int key="NSCellFlags">343014976</int>
|
||||
@@ -171,10 +169,9 @@
|
||||
<string key="NSToolbarItemPaletteLabel">Branch</string>
|
||||
<nil key="NSToolbarItemToolTip"/>
|
||||
<object class="NSPopUpButton" key="NSToolbarItemView" id="147646927">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{0, 14}, {134, 26}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSPopUpButtonCell" key="NSCell" id="638300054">
|
||||
<int key="NSCellFlags">-2076049856</int>
|
||||
@@ -282,10 +279,9 @@
|
||||
<string key="NSToolbarItemPaletteLabel">View selector</string>
|
||||
<nil key="NSToolbarItemToolTip"/>
|
||||
<object class="NSSegmentedControl" key="NSToolbarItemView" id="1040507102">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{6, 14}, {66, 23}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSSegmentedCell" key="NSCell" id="989754672">
|
||||
<int key="NSCellFlags">67239424</int>
|
||||
@@ -771,21 +767,20 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
|
||||
<reference ref="1029924184"/>
|
||||
<reference ref="269491004"/>
|
||||
<reference ref="621139768"/>
|
||||
<reference ref="418070617"/>
|
||||
<reference ref="300994705"/>
|
||||
<reference ref="527020410"/>
|
||||
<reference ref="248726219"/>
|
||||
<reference ref="513412596"/>
|
||||
<reference ref="418070617"/>
|
||||
<reference ref="567485065"/>
|
||||
<reference ref="77524920"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="NSToolbarIBDefaultItems">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<reference ref="567485065"/>
|
||||
<reference ref="418070617"/>
|
||||
<reference ref="77524920"/>
|
||||
<reference ref="248726219"/>
|
||||
<reference ref="300994705"/>
|
||||
<reference ref="248726219"/>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="NSToolbarIBSelectableItems">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
@@ -794,10 +789,9 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
|
||||
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
|
||||
<string key="NSWindowContentMinSize">{213, 107}</string>
|
||||
<object class="NSView" key="NSWindowView" id="751230759">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrameSize">{850, 418}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
|
||||
<string key="NSMinSize">{213, 178}</string>
|
||||
@@ -814,9 +808,9 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
|
||||
<string>shortName</string>
|
||||
<string>description</string>
|
||||
</object>
|
||||
<string key="NSObjectClassName">PBGitRevSpecifier</string>
|
||||
<bool key="NSEditable">YES</bool>
|
||||
<object class="_NSManagedProxy" key="_NSManagedProxy"/>
|
||||
<bool key="NSAvoidsEmptySelection">YES</bool>
|
||||
<bool key="NSPreservesSelection">YES</bool>
|
||||
<bool key="NSSelectsInsertedObjects">YES</bool>
|
||||
<bool key="NSFilterRestrictsInsertion">YES</bool>
|
||||
@@ -899,22 +893,6 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
|
||||
</object>
|
||||
<int key="connectionID">215</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">selectionIndexes: repository.currentBranch</string>
|
||||
<reference key="source" ref="1002608377"/>
|
||||
<reference key="destination" ref="1001"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="1002608377"/>
|
||||
<reference key="NSDestination" ref="1001"/>
|
||||
<string key="NSLabel">selectionIndexes: repository.currentBranch</string>
|
||||
<string key="NSBinding">selectionIndexes</string>
|
||||
<string key="NSKeyPath">repository.currentBranch</string>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<int key="connectionID">218</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">contentView</string>
|
||||
@@ -1028,6 +1006,14 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
|
||||
</object>
|
||||
<int key="connectionID">290</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBOutletConnection" key="connection">
|
||||
<string key="label">branchesController</string>
|
||||
<reference key="source" ref="1001"/>
|
||||
<reference key="destination" ref="1002608377"/>
|
||||
</object>
|
||||
<int key="connectionID">291</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<object class="NSArray" key="orderedObjects">
|
||||
@@ -1303,7 +1289,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
|
||||
<reference ref="9"/>
|
||||
<string>{3.40282e+38, 3.40282e+38}</string>
|
||||
<string>{213, 107}</string>
|
||||
<string>{{429, 644}, {616, 227}}</string>
|
||||
<string>{{429, 871}, {616, 0}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string>{{132, 614}, {616, 0}}</string>
|
||||
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -1350,7 +1336,7 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
|
||||
</object>
|
||||
</object>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">290</int>
|
||||
<int key="maxID">291</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
@@ -1362,12 +1348,14 @@ ELIAAAAAAAgACAAIAAgAAQABAAEAAQ</bytes>
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSMutableArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>branchesController</string>
|
||||
<string>contentView</string>
|
||||
<string>searchController</string>
|
||||
<string>searchField</string>
|
||||
</object>
|
||||
<object class="NSMutableArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>NSArrayController</string>
|
||||
<string>NSView</string>
|
||||
<string>NSArrayController</string>
|
||||
<string>NSSearchField</string>
|
||||
|
||||
@@ -231,7 +231,9 @@ static NSString* gitPath;
|
||||
if ([rev isEqualTo: r])
|
||||
return r;
|
||||
|
||||
[self willChangeValueForKey:@"branches"];
|
||||
[branches addObject: rev];
|
||||
[self didChangeValueForKey:@"branches"];
|
||||
return rev;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
@interface PBGitWindowController : NSWindowController {
|
||||
IBOutlet NSSearchField* searchField;
|
||||
IBOutlet NSArrayController* searchController;
|
||||
IBOutlet NSArrayController *branchesController;
|
||||
PBGitRepository* repository;
|
||||
int selectedViewIndex;
|
||||
IBOutlet NSView* contentView;
|
||||
|
||||
@@ -70,6 +70,8 @@
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
// We bind this ourselves because otherwise we would lose our selection
|
||||
[branchesController bind:@"selectionIndexes" toObject:repository withKeyPath:@"currentBranch" options:nil]; NSLog(@"CurrentBranch: %@", repository.currentBranch);
|
||||
[self changeViewController:0];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user