diff options
author | avenjamin <avenjamin@gmail.com> | 2010-06-30 16:34:03 +0000 |
---|---|---|
committer | avenjamin <avenjamin@gmail.com> | 2010-06-30 16:34:03 +0000 |
commit | ba332e64c29622e0b69412cb2fea639182ac1d1c (patch) | |
tree | 23d990c97bc1c70fe4a26450b2ea0b579ddbe919 | |
parent | 92b97ba3f3ee634e101483f5129f25b4f8230117 (diff) | |
download | sequelpro-ba332e64c29622e0b69412cb2fea639182ac1d1c.tar.gz sequelpro-ba332e64c29622e0b69412cb2fea639182ac1d1c.tar.bz2 sequelpro-ba332e64c29622e0b69412cb2fea639182ac1d1c.zip |
Add option to toggle the tab bar visibility.
- Only applies when one tab is present.
- Saves last used state to preferences.
-rw-r--r-- | Interfaces/English.lproj/MainMenu.xib | 119 | ||||
-rw-r--r-- | Resources/English.lproj/Localizable.strings | bin | 159458 -> 159670 bytes | |||
-rw-r--r-- | Source/SPConstants.h | 1 | ||||
-rw-r--r-- | Source/SPConstants.m | 1 | ||||
-rw-r--r-- | Source/SPWindowController.h | 3 | ||||
-rw-r--r-- | Source/SPWindowController.m | 19 |
6 files changed, 90 insertions, 53 deletions
diff --git a/Interfaces/English.lproj/MainMenu.xib b/Interfaces/English.lproj/MainMenu.xib index 3c9a2e29..eb9bc382 100644 --- a/Interfaces/English.lproj/MainMenu.xib +++ b/Interfaces/English.lproj/MainMenu.xib @@ -3,16 +3,16 @@ <data> <int key="IBDocument.SystemTarget">1050</int> <string key="IBDocument.SystemVersion">10F569</string> - <string key="IBDocument.InterfaceBuilderVersion">762</string> + <string key="IBDocument.InterfaceBuilderVersion">740</string> <string key="IBDocument.AppKitVersion">1038.29</string> <string key="IBDocument.HIToolboxVersion">461.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string> - <string key="NS.object.0">762</string> + <string key="NS.object.0">740</string> </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="81"/> + <integer value="498"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -952,6 +952,25 @@ <string key="NSTitle">View</string> <object class="NSMutableArray" key="NSMenuItems"> <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSMenuItem" id="167719771"> + <reference key="NSMenu" ref="466354362"/> + <string key="NSTitle">Show Tab Bar</string> + <string key="NSKeyEquiv">T</string> + <int key="NSKeyEquivModMask">1048576</int> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="625762401"/> + <reference key="NSMixedImage" ref="315854375"/> + </object> + <object class="NSMenuItem" id="95850380"> + <reference key="NSMenu" ref="466354362"/> + <bool key="NSIsDisabled">YES</bool> + <bool key="NSIsSeparator">YES</bool> + <string key="NSTitle"/> + <string key="NSKeyEquiv"/> + <int key="NSMnemonicLoc">2147483647</int> + <reference key="NSOnImage" ref="625762401"/> + <reference key="NSMixedImage" ref="315854375"/> + </object> <object class="NSMenuItem" id="417888240"> <reference key="NSMenu" ref="466354362"/> <string key="NSTitle">Table Structure</string> @@ -1086,8 +1105,8 @@ <object class="NSMenuItem" id="358795349"> <reference key="NSMenu" ref="466354362"/> <string key="NSTitle">Hide Toolbar</string> - <string key="NSKeyEquiv">T</string> - <int key="NSKeyEquivModMask">1048576</int> + <string key="NSKeyEquiv">t</string> + <int key="NSKeyEquivModMask">1572864</int> <int key="NSMnemonicLoc">2147483647</int> <reference key="NSOnImage" ref="625762401"/> <reference key="NSMixedImage" ref="315854375"/> @@ -2955,6 +2974,14 @@ </object> <int key="connectionID">1122</int> </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">toggleTabBarShown:</string> + <reference key="source" ref="63651044"/> + <reference key="destination" ref="167719771"/> + </object> + <int key="connectionID">1127</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -4134,6 +4161,8 @@ <reference ref="417888240"/> <reference ref="486174990"/> <reference ref="330038521"/> + <reference ref="167719771"/> + <reference ref="95850380"/> </object> <reference key="parent" ref="401969940"/> </object> @@ -4302,6 +4331,16 @@ <reference key="object" ref="473804195"/> <reference key="parent" ref="709725194"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">1124</int> + <reference key="object" ref="167719771"/> + <reference key="parent" ref="466354362"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1125</int> + <reference key="object" ref="95850380"/> + <reference key="parent" ref="466354362"/> + </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> @@ -4359,8 +4398,11 @@ <string>1112.IBPluginDependency</string> <string>1116.IBPluginDependency</string> <string>1118.IBPluginDependency</string> + <string>1124.IBPluginDependency</string> + <string>1125.IBPluginDependency</string> <string>129.IBPluginDependency</string> <string>129.ImportedFromIB2</string> + <string>130.IBEditorWindowLastContentRect</string> <string>130.IBPluginDependency</string> <string>130.ImportedFromIB2</string> <string>131.IBPluginDependency</string> @@ -4670,7 +4712,7 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{752, 521}, {271, 173}}</string> + <string>{{677, 329}, {271, 173}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{561, 605}, {181, 43}}</string> @@ -4700,7 +4742,10 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> + <string>{{562, 439}, {64, 6}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -4729,7 +4774,7 @@ <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> - <string>{{669, 199}, {238, 103}}</string> + <string>{{749, 232}, {238, 103}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -4744,7 +4789,7 @@ <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> - <string>{{550, 302}, {280, 283}}</string> + <string>{{469, 292}, {280, 283}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{654, 613}, {157, 223}}</string> @@ -4756,7 +4801,7 @@ <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> - <string>{{499, 311}, {262, 63}}</string> + <string>{{749, 252}, {259, 63}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -4772,11 +4817,11 @@ <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> - <string>{{607, 403}, {269, 143}}</string> + <string>{{606, 359}, {269, 143}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{449, 1007}, {197, 53}}</string> - <string>{{154, 639}, {511, 20}}</string> + <string>{{274, 575}, {511, 20}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{506, 836}, {511, 20}}</string> @@ -4792,7 +4837,7 @@ <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> - <string>{{420, 253}, {251, 293}}</string> + <string>{{466, 252}, {251, 323}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{698, 703}, {184, 133}}</string> @@ -4810,7 +4855,7 @@ <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> - <string>{{414, 332}, {229, 253}}</string> + <string>{{333, 322}, {229, 253}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{518, 583}, {218, 253}}</string> @@ -4818,7 +4863,7 @@ <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> - <string>{{348, 432}, {255, 253}}</string> + <string>{{563, 322}, {255, 253}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{312, 683}, {231, 153}}</string> @@ -4885,7 +4930,7 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{677, 297}, {292, 233}}</string> + <string>{{597, 342}, {292, 233}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{{829, 663}, {268, 173}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -4911,7 +4956,7 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{260, 216}, {301, 423}}</string> + <string>{{333, 79}, {301, 423}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <integer value="1"/> <string>{{180, 535}, {182, 253}}</string> @@ -4924,7 +4969,7 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{594, 366}, {213, 143}}</string> + <string>{{655, 149}, {210, 143}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSMutableDictionary"> <string key="NS.key.0">ToolTip</string> @@ -4936,7 +4981,7 @@ </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{817, 360}, {221, 83}}</string> + <string>{{655, 269}, {218, 83}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <object class="NSMutableDictionary"> <string key="NS.key.0">ToolTip</string> @@ -4966,7 +5011,7 @@ </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{1152, 270}, {304, 93}}</string> + <string>{{865, 79}, {301, 93}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -5024,7 +5069,7 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>{{795, 452}, {143, 23}}</string> + <string>{{634, 359}, {143, 23}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -5052,7 +5097,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">1123</int> + <int key="maxID">1127</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -5111,7 +5156,6 @@ <string>showCompletionList:</string> <string>showHelpForCurrentWord:</string> <string>showHelpForSearchString:</string> - <string>toggleQueryInfoPaneCollapse:</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -5137,7 +5181,6 @@ <string>id</string> <string>id</string> <string>id</string> - <string>id</string> </object> </object> <object class="NSMutableDictionary" key="outlets"> @@ -5180,7 +5223,6 @@ <string>queryHistorySearchField</string> <string>queryHistorySearchFieldView</string> <string>queryHistorySearchMenuItem</string> - <string>queryInfoPaneSplitView</string> <string>runAllButton</string> <string>runAllMenuItem</string> <string>runSelectionButton</string> @@ -5234,7 +5276,6 @@ <string>NSSearchField</string> <string>id</string> <string>NSMenuItem</string> - <string>BWSplitView</string> <string>id</string> <string>NSMenuItem</string> <string>id</string> @@ -5286,6 +5327,7 @@ <string>showMySQLHelp:</string> <string>showVariables:</string> <string>toggleConsole:</string> + <string>toggleTabBarShown:</string> <string>viewContent:</string> <string>viewQuery:</string> <string>viewStatus:</string> @@ -5320,6 +5362,7 @@ <string>id</string> <string>id</string> <string>id</string> + <string>id</string> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> @@ -6528,18 +6571,6 @@ </object> </object> <object class="IBPartialClassDescription"> - <string key="className">BWSplitView</string> - <string key="superclassName">NSSplitView</string> - <object class="NSMutableDictionary" key="actions"> - <string key="NS.key.0">toggleCollapse:</string> - <string key="NS.object.0">id</string> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBFrameworkSource</string> - <string key="minorKey">BWToolkitFramework.framework/Headers/BWSplitView.h</string> - </object> - </object> - <object class="IBPartialClassDescription"> <string key="className">NSActionCell</string> <string key="superclassName">NSCell</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> @@ -7437,7 +7468,6 @@ </object> </object> <int key="IBDocument.localizationMode">0</int> - <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> <integer value="1050" key="NS.object.0"/> @@ -7453,18 +7483,5 @@ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <string key="IBDocument.LastKnownRelativeProjectPath">../../sequel-pro.xcodeproj</string> <int key="IBDocument.defaultPropertyAccessControl">3</int> - <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes"> - <bool key="EncodedWithXMLCoder">YES</bool> - <object class="NSArray" key="dict.sortedKeys"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>NSMenuCheckmark</string> - <string>NSMenuMixedState</string> - </object> - <object class="NSMutableArray" key="dict.values"> - <bool key="EncodedWithXMLCoder">YES</bool> - <string>{9, 8}</string> - <string>{7, 2}</string> - </object> - </object> </data> </archive> diff --git a/Resources/English.lproj/Localizable.strings b/Resources/English.lproj/Localizable.strings Binary files differindex 4df709c9..63404a5f 100644 --- a/Resources/English.lproj/Localizable.strings +++ b/Resources/English.lproj/Localizable.strings diff --git a/Source/SPConstants.h b/Source/SPConstants.h index e6932900..a7a10fc2 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -286,6 +286,7 @@ extern NSString *SPProcessListEnableAutoRefresh; extern NSString *SPProcessListAutoRrefreshInterval; extern NSString *SPFavoritesSortedBy; extern NSString *SPFavoritesSortedInReverse; +extern NSString *SPAlwaysShowWindowTabBar; // Hidden Prefs extern NSString *SPPrintWarningRowLimit; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index 5580cbe7..bd02875f 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -134,6 +134,7 @@ NSString *SPProcessListEnableAutoRefresh = @"ProcessListEnableAutoRefres NSString *SPProcessListAutoRrefreshInterval = @"ProcessListAutoRrefreshInterval"; NSString *SPFavoritesSortedBy = @"FavoritesSortedBy"; NSString *SPFavoritesSortedInReverse = @"FavoritesSortedInReverse"; +NSString *SPAlwaysShowWindowTabBar = @"WindowAlwaysShowTabBar"; // Hidden Prefs NSString *SPPrintWarningRowLimit = @"PrintWarningRowLimit"; diff --git a/Source/SPWindowController.h b/Source/SPWindowController.h index 33d6df49..828c6cda 100644 --- a/Source/SPWindowController.h +++ b/Source/SPWindowController.h @@ -29,7 +29,7 @@ { IBOutlet PSMTabBarControl *tabBar; IBOutlet NSTabView *tabView; - + NSMenuItem *closeWindowMenuItem; NSMenuItem *closeTabMenuItem; @@ -46,6 +46,7 @@ - (IBAction)closeTab:(id)sender; - (IBAction)selectNextDocumentTab:(id)sender; - (IBAction)selectPreviousDocumentTab:(id)sender; +- (IBAction)toggleTabBarShown:(id)sender; - (NSArray *)documents; - (void)selectTabAtIndex:(NSInteger)index; - (void)setHideForSingleTab:(BOOL)hide; diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m index 0cfe9e8e..5cd98870 100644 --- a/Source/SPWindowController.m +++ b/Source/SPWindowController.m @@ -53,7 +53,7 @@ // Set up the tab bar [tabBar setStyleNamed:@"SequelPro"]; [tabBar setCanCloseOnlyTab:NO]; - [tabBar setHideForSingleTab:YES]; + [tabBar setHideForSingleTab:![[NSUserDefaults standardUserDefaults] boolForKey:SPAlwaysShowWindowTabBar]]; [tabBar setShowAddTabButton:YES]; [tabBar setSizeCellsToFit:NO]; [tabBar setCellMinWidth:100]; @@ -260,6 +260,17 @@ } /** + * Toggle Tab Bar Visibility + */ + +- (IBAction)toggleTabBarShown:(id)sender +{ + [tabBar setHideForSingleTab:![tabBar isTabBarHidden]]; + [[NSUserDefaults standardUserDefaults] setBool:![tabBar hideForSingleTab] forKey:SPAlwaysShowWindowTabBar]; +} + + +/** * Menu validation */ - (BOOL) validateMenuItem:(NSMenuItem *)menuItem @@ -273,6 +284,12 @@ return ([tabView numberOfTabViewItems] != 1); } + // Show/hide Tab bar + if ([menuItem action] == @selector(toggleTabBarShown:)) { + [menuItem setTitle:(![tabBar isTabBarHidden] ? NSLocalizedString(@"Hide Tab Bar", @"hide tab bar") : NSLocalizedString(@"Show Tab Bar", @"show tab bar"))]; + return [[tabBar cells] count] <= 1; + } + // See if the front document blocks validation of this item if (![selectedTableDocument validateMenuItem:menuItem]) return NO; |