aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPPreferenceController.m
diff options
context:
space:
mode:
authoravenjamin <avenjamin@gmail.com>2009-05-21 07:00:04 +0000
committeravenjamin <avenjamin@gmail.com>2009-05-21 07:00:04 +0000
commit205e60918c2cdc7be6c70ac71db9b85bf6301828 (patch)
tree82bdc7311c43b7e86e531f87bb6220a99bdb670d /Source/SPPreferenceController.m
parentffcbd889c7f9a5fd917b8dff01fa4fa8df39c926 (diff)
downloadsequelpro-205e60918c2cdc7be6c70ac71db9b85bf6301828.tar.gz
sequelpro-205e60918c2cdc7be6c70ac71db9b85bf6301828.tar.bz2
sequelpro-205e60918c2cdc7be6c70ac71db9b85bf6301828.zip
- Fixed NSFontPanel issue. Now showing font collections in Font Panel
- Replaced some toolbar icons with new ones - Edited some toolbar icons. - Added keyboard shortcut section to preferences (Disabled for now)
Diffstat (limited to 'Source/SPPreferenceController.m')
-rw-r--r--Source/SPPreferenceController.m39
1 files changed, 25 insertions, 14 deletions
diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m
index 597024a3..1f10eede 100644
--- a/Source/SPPreferenceController.m
+++ b/Source/SPPreferenceController.m
@@ -38,6 +38,7 @@
#define PREFERENCE_TOOLBAR_AUTOUPDATE @"Preference Toolbar Auto Update"
#define PREFERENCE_TOOLBAR_NETWORK @"Preference Toolbar Network"
#define PREFERENCE_TOOLBAR_EDITOR @"Preference Toolbar Editor"
+#define PREFERENCE_TOOLBAR_SHORTCUTS @"Preference Toolbar Shortcuts"
#pragma mark -
@@ -588,6 +589,9 @@
else if ([itemIdentifier isEqualToString:PREFERENCE_TOOLBAR_EDITOR]) {
return editorItem;
}
+ else if ([itemIdentifier isEqualToString:PREFERENCE_TOOLBAR_SHORTCUTS]) {
+ return shortcutItem;
+ }
return [[[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier] autorelease];
}
@@ -597,7 +601,7 @@
// -------------------------------------------------------------------------------
- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar
{
- return [NSArray arrayWithObjects:PREFERENCE_TOOLBAR_GENERAL, PREFERENCE_TOOLBAR_TABLES, PREFERENCE_TOOLBAR_FAVORITES, PREFERENCE_TOOLBAR_NOTIFICATIONS, PREFERENCE_TOOLBAR_AUTOUPDATE, PREFERENCE_TOOLBAR_NETWORK, PREFERENCE_TOOLBAR_EDITOR, nil];
+ return [NSArray arrayWithObjects:PREFERENCE_TOOLBAR_GENERAL, PREFERENCE_TOOLBAR_TABLES, PREFERENCE_TOOLBAR_FAVORITES, PREFERENCE_TOOLBAR_NOTIFICATIONS, PREFERENCE_TOOLBAR_EDITOR, PREFERENCE_TOOLBAR_SHORTCUTS, PREFERENCE_TOOLBAR_AUTOUPDATE, PREFERENCE_TOOLBAR_NETWORK, nil];
}
// -------------------------------------------------------------------------------
@@ -605,7 +609,7 @@
// -------------------------------------------------------------------------------
- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar
{
- return [NSArray arrayWithObjects:PREFERENCE_TOOLBAR_GENERAL, PREFERENCE_TOOLBAR_TABLES, PREFERENCE_TOOLBAR_FAVORITES, PREFERENCE_TOOLBAR_NOTIFICATIONS, PREFERENCE_TOOLBAR_AUTOUPDATE, PREFERENCE_TOOLBAR_NETWORK, PREFERENCE_TOOLBAR_EDITOR, nil];
+ return [NSArray arrayWithObjects:PREFERENCE_TOOLBAR_GENERAL, PREFERENCE_TOOLBAR_TABLES, PREFERENCE_TOOLBAR_FAVORITES, PREFERENCE_TOOLBAR_NOTIFICATIONS, PREFERENCE_TOOLBAR_EDITOR, PREFERENCE_TOOLBAR_SHORTCUTS, PREFERENCE_TOOLBAR_AUTOUPDATE, PREFERENCE_TOOLBAR_NETWORK, nil];
}
// -------------------------------------------------------------------------------
@@ -613,7 +617,7 @@
// -------------------------------------------------------------------------------
- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar
{
- return [NSArray arrayWithObjects:PREFERENCE_TOOLBAR_GENERAL, PREFERENCE_TOOLBAR_TABLES, PREFERENCE_TOOLBAR_FAVORITES, PREFERENCE_TOOLBAR_NOTIFICATIONS, PREFERENCE_TOOLBAR_AUTOUPDATE, PREFERENCE_TOOLBAR_NETWORK, PREFERENCE_TOOLBAR_EDITOR, nil];
+ return [NSArray arrayWithObjects:PREFERENCE_TOOLBAR_GENERAL, PREFERENCE_TOOLBAR_TABLES, PREFERENCE_TOOLBAR_FAVORITES, PREFERENCE_TOOLBAR_NOTIFICATIONS, PREFERENCE_TOOLBAR_EDITOR, PREFERENCE_TOOLBAR_SHORTCUTS, PREFERENCE_TOOLBAR_AUTOUPDATE, PREFERENCE_TOOLBAR_NETWORK, nil];
}
#pragma mark -
@@ -799,7 +803,7 @@
// set font panel's valid modes
- (unsigned int)validModesForFontPanel:(NSFontPanel *)fontPanel
{
- return (NSFontPanelFaceModeMask | NSFontPanelSizeModeMask);
+ return (NSFontPanelAllModesMask ^ NSFontPanelAllEffectsModeMask);
}
// Action receiver for a font change in the font panel
- (void)changeFont:(id)sender
@@ -861,11 +865,27 @@
// Notification preferences
notificationsItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_NOTIFICATIONS];
- [notificationsItem setLabel:NSLocalizedString(@"Notifications", @"")];
+ [notificationsItem setLabel:NSLocalizedString(@"Alerts", @"")];
[notificationsItem setImage:[NSImage imageNamed:@"toolbar-preferences-notifications"]];
[notificationsItem setTarget:self];
[notificationsItem setAction:@selector(displayNotificationPreferences:)];
+ // Editor preferences
+ editorItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_EDITOR];
+
+ [editorItem setLabel:NSLocalizedString(@"Query Editor", @"")];
+ [editorItem setImage:[NSImage imageNamed:@"toolbar-preferences-queryeditor"]];
+ [editorItem setTarget:self];
+ [editorItem setAction:@selector(displayEditorPreferences:)];
+
+ // Shortcut preferences
+ shortcutItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_SHORTCUTS];
+
+ [shortcutItem setLabel:NSLocalizedString(@"Shortcuts", @"")];
+ [shortcutItem setImage:[NSImage imageNamed:@"toolbar-preferences-shortcuts"]];
+ [shortcutItem setTarget:self];
+ [shortcutItem setAction:@selector(NSBeep)];
+
// AutoUpdate preferences
autoUpdateItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_AUTOUPDATE];
@@ -882,15 +902,6 @@
[networkItem setTarget:self];
[networkItem setAction:@selector(displayNetworkPreferences:)];
- // Editor preferences
- editorItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_EDITOR];
-
- [editorItem setLabel:NSLocalizedString(@"Query Editor", @"")];
- [editorItem setImage:[NSImage imageNamed:@"toolbar-switch-to-sql"]];
- [editorItem setTarget:self];
- [editorItem setAction:@selector(displayEditorPreferences:)];
-
-
[toolbar setDelegate:self];
[toolbar setSelectedItemIdentifier:PREFERENCE_TOOLBAR_GENERAL];
[toolbar setAllowsUserCustomization:NO];