Skip to content

Commit

Permalink
Show current branch in branch menu
Browse files Browse the repository at this point in the history
This kept going broken, so now instead of Interface Builder bindings,
we create the binding ourselves
  • Loading branch information
pieter committed Sep 20, 2008
1 parent 252b44c commit 7f337cd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 31 deletions.
50 changes: 19 additions & 31 deletions English.lproj/RepositoryWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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">
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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">
Expand All @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions PBGitRepository.m
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ - (PBGitRevSpecifier*) addBranch: (PBGitRevSpecifier*) rev
if ([rev isEqualTo: r])
return r;

[self willChangeValueForKey:@"branches"];
[branches addObject: rev];
[self didChangeValueForKey:@"branches"];
return rev;
}

Expand Down
1 change: 1 addition & 0 deletions PBGitWindowController.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@interface PBGitWindowController : NSWindowController {
IBOutlet NSSearchField* searchField;
IBOutlet NSArrayController* searchController;
IBOutlet NSArrayController *branchesController;
PBGitRepository* repository;
int selectedViewIndex;
IBOutlet NSView* contentView;
Expand Down
2 changes: 2 additions & 0 deletions PBGitWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ - (void)changeViewController:(NSInteger)whichViewTag

- (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];
}

Expand Down

0 comments on commit 7f337cd

Please sign in to comment.