From edf4822e3440081be15b779e2b778259415fa486 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Wed, 19 Nov 2008 02:21:02 +0100 Subject: [PATCH] CLI: Show history view if necessary --- PBCLIProxy.mm | 3 ++- PBGitWindowController.m | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/PBCLIProxy.mm b/PBCLIProxy.mm index 4a9737c..479b7ec 100644 --- a/PBCLIProxy.mm +++ b/PBCLIProxy.mm @@ -53,10 +53,11 @@ if ([arguments count] > 0 && ([[arguments objectAtIndex:0] isEqualToString:@"--commit"] || [[arguments objectAtIndex:0] isEqualToString:@"-c"])) - ((PBGitWindowController *)document.windowController).selectedViewIndex = 1; + [((PBGitWindowController *)document.windowController) showCommitView:self]; else { PBGitRevSpecifier* rev = [[PBGitRevSpecifier alloc] initWithParameters:arguments]; document.currentBranch = [document addBranch: rev]; + [(PBGitWindowController *)document.windowController showHistoryView:self]; } [NSApp activateIgnoringOtherApps:YES]; diff --git a/PBGitWindowController.m b/PBGitWindowController.m index 1235620..7495b78 100644 --- a/PBGitWindowController.m +++ b/PBGitWindowController.m @@ -77,12 +77,14 @@ - (void) showCommitView:(id)sender { - self.selectedViewIndex = 1; + if (self.selectedViewIndex != 1) + self.selectedViewIndex = 1; } - (void) showHistoryView:(id)sender { - self.selectedViewIndex = 0; + if (self.selectedViewIndex != 0) + self.selectedViewIndex = 0; } #pragma mark -