aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-08-02 12:41:40 +0000
committerrowanbeentje <rowan@beent.je>2009-08-02 12:41:40 +0000
commit865751a6154ec9c31ef73e95c5ead99682cb40fd (patch)
tree61c81534a14a3e3173c17cd3aa8781e395e3aa81
parent89aed80bdcfdead340f9e5de5dc73ab051ae1f9b (diff)
downloadsequelpro-865751a6154ec9c31ef73e95c5ead99682cb40fd.tar.gz
sequelpro-865751a6154ec9c31ef73e95c5ead99682cb40fd.tar.bz2
sequelpro-865751a6154ec9c31ef73e95c5ead99682cb40fd.zip
- Add a tooltip to the table information pane toggle button
- Change the "[Show/Hide] Console" button in the toolbar to a "Console" button, which shows or brings the console window to the front - Update the default toolbar state to reflect recent additions - Reset everyone's toolbars to ensure that normal users will have the new icons available and visible
-rw-r--r--Interfaces/English.lproj/DBView.xib24
-rw-r--r--Source/SPPreferenceController.m7
-rw-r--r--Source/TableDocument.m60
3 files changed, 49 insertions, 42 deletions
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib
index d44e8f93..76b01146 100644
--- a/Interfaces/English.lproj/DBView.xib
+++ b/Interfaces/English.lproj/DBView.xib
@@ -3091,7 +3091,7 @@
<reference key="NSControlView" ref="363916571"/>
<int key="NSButtonFlags">-2042609409</int>
<int key="NSButtonFlags2">35</int>
- <object class="NSCustomResource" key="NSNormalImage">
+ <object class="NSCustomResource" key="NSNormalImage" id="763588954">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">button_action</string>
</object>
@@ -3106,10 +3106,7 @@
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
- <object class="NSCustomResource" key="NSImage">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">button_action</string>
- </object>
+ <reference key="NSImage" ref="763588954"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="984501775"/>
</object>
@@ -10906,7 +10903,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string key="NSExtension">NSResponder</string>
</object>
<object class="NSCustomView" id="884983195">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">301</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -10915,7 +10912,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSvFlags">298</int>
<string key="NSFrame">{{0, 3}, {200, 26}}</string>
<reference key="NSSuperview" ref="884983195"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="931032347">
<int key="NSCellFlags">-2076049856</int>
@@ -10994,7 +10990,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="NSvFlags">301</int>
<string key="NSFrame">{{208, 3}, {61, 25}}</string>
<reference key="NSSuperview" ref="884983195"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSSegmentedCell" key="NSCell" id="253177824">
<int key="NSCellFlags">67239424</int>
@@ -11028,8 +11023,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
<string key="NSFrameSize">{269, 32}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="730777562">
@@ -23543,12 +23536,11 @@ aGUgYWN0aXZlIHNlbGVjdGlvbiAo4oyl4oyYUik</string>
<string>com.brandonwalkin.BWToolkit</string>
<string>com.brandonwalkin.BWToolkit</string>
<object class="NSMutableDictionary">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
+ <string key="NS.key.0">ToolTip</string>
+ <object class="IBToolTipAttribute" key="NS.object.0">
+ <string key="name">ToolTip</string>
+ <reference key="object" ref="57416393"/>
+ <string key="toolTip">Toggle the visibility of the Information panel</string>
</object>
</object>
<string>com.brandonwalkin.BWToolkit</string>
diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m
index 79be5318..ca7c6562 100644
--- a/Source/SPPreferenceController.m
+++ b/Source/SPPreferenceController.m
@@ -263,6 +263,13 @@
[prefs setObject:[NSArray arrayWithArray:favoritesArray] forKey:@"favorites"];
}
+ // For versions prior to r1128 (~0.9.6), reset the main window toolbar items to add new items
+ if (recordedVersionNumber < 1128 && [prefs objectForKey:@"NSToolbar Configuration TableWindowToolbar"]) {
+ NSMutableDictionary *toolbarDict = [NSMutableDictionary dictionaryWithDictionary:[prefs objectForKey:@"NSToolbar Configuration TableWindowToolbar"]];
+ [toolbarDict removeObjectForKey:@"TB Item Identifiers"];
+ [prefs setObject:[NSDictionary dictionaryWithDictionary:toolbarDict] forKey:@"NSToolbar Configuration TableWindowToolbar"];
+ }
+
// Update the prefs revision
[prefs setObject:[NSNumber numberWithInt:currentVersionNumber] forKey:@"LastUsedVersion"];
}
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 3a337041..eb2b6129 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -642,6 +642,20 @@
}
/**
+ * Brings the console to the fron
+ */
+- (void)showConsole:(id)sender
+{
+ BOOL isConsoleVisible = [[[SPQueryConsole sharedQueryConsole] window] isVisible];
+
+ if (!isConsoleVisible) {
+ [self toggleConsole:sender];
+ } else {
+ [[[SPQueryConsole sharedQueryConsole] window] makeKeyAndOrderFront:self];
+ }
+}
+
+/**
* Clears the console by removing all of its messages
*/
- (void)clearConsole:(id)sender
@@ -1770,23 +1784,16 @@
[toolbarItem setPaletteLabel:[toolbarItem label]];
[toolbarItem setView:historyControl];
- } else if ([itemIdentifier isEqualToString:@"ToggleConsoleIdentifier"]) {
- //set the text label to be displayed in the toolbar and customization palette
- [toolbarItem setPaletteLabel:NSLocalizedString(@"Show/Hide Console", @"toolbar item for show/hide console")];
- //set up tooltip and image
- [toolbarItem setToolTip:NSLocalizedString(@"Show or hide the console which shows all MySQL commands performed by Sequel Pro", @"tooltip for toolbar item for show/hide console")];
+ } else if ([itemIdentifier isEqualToString:@"ShowConsoleIdentifier"]) {
+ [toolbarItem setPaletteLabel:NSLocalizedString(@"Show Console", @"toolbar item for show console")];
+ [toolbarItem setToolTip:NSLocalizedString(@"Show the console which shows all MySQL commands performed by Sequel Pro", @"tooltip for toolbar item for show console")];
- if ([[[SPQueryConsole sharedQueryConsole] window] isVisible]) {
- [toolbarItem setLabel:NSLocalizedString(@"Hide Console", @"Hide Console")];
- [toolbarItem setImage:[NSImage imageNamed:@"hideconsole"]];
- } else {
- [toolbarItem setLabel:NSLocalizedString(@"Show Console", @"Show Console")];
- [toolbarItem setImage:[NSImage imageNamed:@"showconsole"]];
- }
+ [toolbarItem setLabel:NSLocalizedString(@"Console", @"Console")];
+ [toolbarItem setImage:[NSImage imageNamed:@"hideconsole"]];
//set up the target action
[toolbarItem setTarget:self];
- [toolbarItem setAction:@selector(toggleConsole:)];
+ [toolbarItem setAction:@selector(showConsole:)];
} else if ([itemIdentifier isEqualToString:@"ClearConsoleIdentifier"]) {
//set the text label to be displayed in the toolbar and customization palette
@@ -1866,7 +1873,7 @@
return [NSArray arrayWithObjects:
@"DatabaseSelectToolbarItemIdentifier",
@"HistoryNavigationToolbarItemIdentifier",
- @"ToggleConsoleIdentifier",
+ @"ShowConsoleIdentifier",
@"ClearConsoleIdentifier",
@"FlushPrivilegesIdentifier",
@"SwitchToTableStructureToolbarItemIdentifier",
@@ -1888,15 +1895,14 @@
{
return [NSArray arrayWithObjects:
@"DatabaseSelectToolbarItemIdentifier",
- NSToolbarSeparatorItemIdentifier,
@"SwitchToTableStructureToolbarItemIdentifier",
@"SwitchToTableContentToolbarItemIdentifier",
- @"SwitchToRunQueryToolbarItemIdentifier",
- @"SwitchToTableInfoToolbarItemIdentifier",
@"SwitchToTableRelationsToolbarItemIdentifier",
+ @"SwitchToTableInfoToolbarItemIdentifier",
+ @"SwitchToRunQueryToolbarItemIdentifier",
NSToolbarFlexibleSpaceItemIdentifier,
- @"ToggleConsoleIdentifier",
- @"ClearConsoleIdentifier",
+ @"HistoryNavigationToolbarItemIdentifier",
+ @"ShowConsoleIdentifier",
nil];
}
@@ -1924,15 +1930,17 @@
NSString *identifier = [toolbarItem itemIdentifier];
- // Toggle console item
- if ([identifier isEqualToString:@"ToggleConsoleIdentifier"]) {
+ // Show console item
+ if ([identifier isEqualToString:@"ShowConsoleIdentifier"]) {
if ([[[SPQueryConsole sharedQueryConsole] window] isVisible]) {
- [toolbarItem setLabel:@"Hide Console"];
- [toolbarItem setImage:[NSImage imageNamed:@"hideconsole"]];
- }
- else {
- [toolbarItem setLabel:@"Show Console"];
[toolbarItem setImage:[NSImage imageNamed:@"showconsole"]];
+ } else {
+ [toolbarItem setImage:[NSImage imageNamed:@"hideconsole"]];
+ }
+ if ([[[SPQueryConsole sharedQueryConsole] window] isKeyWindow]) {
+ return NO;
+ } else {
+ return YES;
}
}