From 92fbb6abcc89c946b1565de862b59af016651fdb Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 29 Jun 2010 12:14:07 +0000 Subject: =?UTF-8?q?=E2=80=A2=C2=A0Open=20Session=20file=20-=20set=20[tabba?= =?UTF-8?q?r=20setHideForSingleTab:NO]=20if=20window=20has=20more=20than?= =?UTF-8?q?=20one=20tab=20in=20order=20to=20avoid=20issues=20while=20anima?= =?UTF-8?q?ted=20fading-in=20of=20the=20tabbar=20-=20assign=20initial=20ke?= =?UTF-8?q?yboard=20short-cut=20^=E2=8C=A5=E2=8C=98S=20for=20Save=20Sessio?= =?UTF-8?q?n=20(needs=20to=20be=20discussed)=20-=20still=20hidden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Interfaces/English.lproj/MainMenu.xib | 12 +++++++----- Source/SPAppController.m | 3 +++ Source/SPDatabaseDocument.m | 1 - Source/SPWindowController.h | 1 + Source/SPWindowController.m | 4 ++++ 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib index 6a0b8861..3c9a2e29 100644 --- a/Interfaces/English.lproj/MainMenu.xib +++ b/Interfaces/English.lproj/MainMenu.xib @@ -12,7 +12,7 @@ YES - + YES @@ -367,7 +367,8 @@ YES Save Session - + s + 1835008 2147483647 @@ -377,7 +378,8 @@ YES Save Session As… - + S + 1835008 2147483647 @@ -4774,7 +4776,7 @@ com.apple.InterfaceBuilder.CocoaPlugin {{449, 1007}, {197, 53}} - {{228, 546}, {511, 20}} + {{154, 639}, {511, 20}} com.apple.InterfaceBuilder.CocoaPlugin {{506, 836}, {511, 20}} @@ -4909,7 +4911,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{334, 123}, {287, 423}} + {{260, 216}, {301, 423}} com.apple.InterfaceBuilder.CocoaPlugin {{180, 535}, {182, 253}} diff --git a/Source/SPAppController.m b/Source/SPAppController.m index aa2cf3b1..85ad93a2 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -343,6 +343,9 @@ SPWindowController *newWindowController = [[SPWindowController alloc] initWithWindowNibName:@"MainWindow"]; NSWindow *newWindow = [newWindowController window]; + if([[window objectForKey:@"tabs"] count] > 1) + [newWindowController setHideForSingleTab:NO]; + // The first window should use autosaving; subsequent windows should cascade. // So attempt to set the frame autosave name; this will succeed for the very // first window, and fail for others. diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 60b29366..d2ba3d85 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -178,7 +178,6 @@ [prefs addObserver:self forKeyPath:SPConsoleEnableLogging options:NSKeyValueObservingOptionNew context:NULL]; // Register for notifications - //register for notifications [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willPerformQuery:) name:@"SMySQLQueryWillBePerformed" object:self]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hasPerformedQuery:) diff --git a/Source/SPWindowController.h b/Source/SPWindowController.h index 1f3945cc..33d6df49 100644 --- a/Source/SPWindowController.h +++ b/Source/SPWindowController.h @@ -48,5 +48,6 @@ - (IBAction)selectPreviousDocumentTab:(id)sender; - (NSArray *)documents; - (void)selectTabAtIndex:(NSInteger)index; +- (void)setHideForSingleTab:(BOOL)hide; @end diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m index 4c25ece2..5f8e34cd 100644 --- a/Source/SPWindowController.m +++ b/Source/SPWindowController.m @@ -303,6 +303,10 @@ } } +- (void)setHideForSingleTab:(BOOL)hide +{ + [tabBar setHideForSingleTab:hide]; +} #pragma mark - #pragma mark Tab view delegate methods -- cgit v1.2.3