mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Reopen the stage view if that was the last view open
This commit is contained in:
@@ -25,5 +25,7 @@
|
||||
+ (void) setRecentCloneDestination:(NSString *)path;
|
||||
+ (BOOL) suppressAcceptDropRef;
|
||||
+ (void) setSuppressAcceptDropRef:(BOOL)suppress;
|
||||
+ (BOOL) showStageView;
|
||||
+ (void) setShowStageView:(BOOL)suppress;
|
||||
|
||||
@end
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#define kShouldCheckoutBranch @"PBShouldCheckoutBranch"
|
||||
#define kRecentCloneDestination @"PBRecentCloneDestination"
|
||||
#define kSuppressAcceptDropRef @"PBSuppressAcceptDropRef"
|
||||
#define kShowStageView @"PBShowStageView"
|
||||
|
||||
@implementation PBGitDefaults
|
||||
|
||||
@@ -117,4 +118,15 @@
|
||||
return [[NSUserDefaults standardUserDefaults] setBool:suppress forKey:kSuppressAcceptDropRef];
|
||||
}
|
||||
|
||||
+ (BOOL) showStageView
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:kShowStageView];
|
||||
}
|
||||
|
||||
+ (void) setShowStageView:(BOOL)suppress
|
||||
{
|
||||
return [[NSUserDefaults standardUserDefaults] setBool:suppress forKey:kShowStageView];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#import "PBSourceViewCell.h"
|
||||
#import "NSOutlineViewExt.h"
|
||||
#import "PBAddRemoteSheet.h"
|
||||
#import "PBGitDefaults.h"
|
||||
|
||||
@interface PBGitSidebarController ()
|
||||
|
||||
@@ -52,7 +53,10 @@
|
||||
|
||||
[self menuNeedsUpdate:[actionButton menu]];
|
||||
|
||||
[self selectCurrentBranch];
|
||||
if ([PBGitDefaults showStageView])
|
||||
[self selectStage];
|
||||
else
|
||||
[self selectCurrentBranch];
|
||||
}
|
||||
|
||||
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||
@@ -176,10 +180,12 @@
|
||||
if ([item revSpecifier]) {
|
||||
repository.currentBranch = [item revSpecifier];
|
||||
[superController changeContentController:historyViewController];
|
||||
[PBGitDefaults setShowStageView:NO];
|
||||
}
|
||||
|
||||
if (item == stage) {
|
||||
[superController changeContentController:commitViewController];
|
||||
[PBGitDefaults setShowStageView:YES];
|
||||
}
|
||||
|
||||
[self updateActionMenu];
|
||||
|
||||
Reference in New Issue
Block a user