mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
PBGitWindowController: Default to historyViewController for bare repo
If the repository we're working on is bare and through some default value we are asked to display the commit-view, we simply change it back to history.
This commit is contained in:
@@ -51,8 +51,6 @@
|
||||
|
||||
- (void) setSelectedViewIndex: (int) i
|
||||
{
|
||||
selectedViewIndex = i;
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:i forKey:@"selectedViewIndex"];
|
||||
[self changeViewController: i];
|
||||
}
|
||||
|
||||
@@ -63,6 +61,14 @@
|
||||
if (viewController != nil)
|
||||
[[viewController view] removeFromSuperview];
|
||||
|
||||
if ([repository isBareRepository]) { // in bare repository we don't want to view commit
|
||||
whichViewTag = 0; // even if it was selected by default
|
||||
}
|
||||
|
||||
// Set our default here because we might have changed it (based on bare repo) before
|
||||
selectedViewIndex = whichViewTag;
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:whichViewTag forKey:@"selectedViewIndex"];
|
||||
|
||||
switch (whichViewTag)
|
||||
{
|
||||
case 0: // swap in the "CustomImageViewController - NSImageView"
|
||||
@@ -93,6 +99,7 @@
|
||||
// Allow the viewcontroller to catch actions
|
||||
[self setNextResponder: viewController];
|
||||
[self didChangeValueForKey:@"viewController"]; // this will trigger the NSTextField's value binding to change
|
||||
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
|
||||
Reference in New Issue
Block a user