diff options
author | stuconnolly <stuart02@gmail.com> | 2009-12-11 00:51:47 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2009-12-11 00:51:47 +0000 |
commit | 2f490fa3f4030c71aab8a1cafd9514a3fff2c6c4 (patch) | |
tree | 122f38e3f27563dddfed944c2e100109979d68b0 /Source | |
parent | 1421e9877071c7b50ea10cdee8ba97e75a1c2604 (diff) | |
download | sequelpro-2f490fa3f4030c71aab8a1cafd9514a3fff2c6c4.tar.gz sequelpro-2f490fa3f4030c71aab8a1cafd9514a3fff2c6c4.tar.bz2 sequelpro-2f490fa3f4030c71aab8a1cafd9514a3fff2c6c4.zip |
Convert a bunch of #define'd constants to extern's, including preference toolbar identifiers, pasteboard drag types and file extensions.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPConstants.h | 32 | ||||
-rw-r--r-- | Source/SPConstants.m | 22 | ||||
-rw-r--r-- | Source/SPContentFilterManager.m | 14 | ||||
-rw-r--r-- | Source/SPPreferenceController.m | 75 | ||||
-rw-r--r-- | Source/SPQueryController.m | 2 | ||||
-rw-r--r-- | Source/SPQueryFavoriteManager.m | 14 |
6 files changed, 91 insertions, 68 deletions
diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 221d057c..38ffdc2d 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -28,16 +28,6 @@ #import <Cocoa/Cocoa.h> -// Extensions -#define DEFAULT_SEQUEL_PRO_FILE_EXTENSION @"spf" -#define DEFAULT_QUERY_FAVORITE_FILE_EXTENSION @"sql" -#define DEFAULT_CONSOLE_LOG_FILE_EXTENSION @"sql" - -// Tableview drag types -#define FAVORITES_PB_DRAG_TYPE @"SequelProPreferencesPasteboard" -#define CONTENT_FILTER_PB_DRAG_TYPE @"SequelProContentFilterPasteboard" -#define QUERY_FAVORITES_PB_DRAG_TYPE @"SequelProQueryFavoritesPasteboard" - // URLs #define SEQUEL_PRO_HOME_PAGE_URL @"http://www.sequelpro.com/" #define SEQUEL_PRO_DONATIONS_URL @"http://www.sequelpro.com/donate.html" @@ -88,6 +78,16 @@ extern NSString *SPKillProcessConnectionMode; // Default monospaced font name extern NSString *SPDefaultMonospacedFontName; +// Table view drag types +extern NSString *SPFavoritesPasteboardDragType; +extern NSString *SPContentFilterPasteboardDragType; +extern NSString *SPQueryFavortiesPasteboardDragType; + +// File extensions +extern NSString *SPFileExtensionDefault; +extern NSString *SPFileExtensionSQL; + + // Preference key constants // General Prefpane extern NSString *SPDefaultFavorite; @@ -183,3 +183,15 @@ extern NSString *SPQueryHistoryReplacesContent; extern NSString *SPQuickLookTypes; extern NSString *SPTableChangedNotification; extern NSString *SPBlobTextEditorSpellCheckingEnabled; + +// Toolbar constants + +// Preferences toolbar +extern NSString *SPPreferenceToolbarGeneral; +extern NSString *SPPreferenceToolbarTables; +extern NSString *SPPreferenceToolbarFavorites; +extern NSString *SPPreferenceToolbarNotifications; +extern NSString *SPPreferenceToolbarAutoUpdate; +extern NSString *SPPreferenceToolbarNetwork; +extern NSString *SPPreferenceToolbarEditor; +extern NSString *SPPreferenceToolbarShortcuts; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index 06e32b6d..1f9e9482 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -30,7 +30,15 @@ NSString *SPKillProcessQueryMode = @"SPKillProcessQueryMode"; NSString *SPKillProcessConnectionMode = @"SPKillProcessConnectionMode"; // Default monospaced font name -NSString *SPDefaultMonospacedFontName = @"Monaco"; +NSString *SPDefaultMonospacedFontName = @"Monaco"; + +// Table view drag types +NSString *SPFavoritesPasteboardDragType = @"SPFavoritesPasteboard"; +NSString *SPContentFilterPasteboardDragType = @"SPContentFilterPasteboard"; + +// File extensions +NSString *SPFileExtensionDefault = @"spf"; +NSString *SPFileExtensionSQL = @"sql"; // Preference key constants // General Prefpane @@ -127,3 +135,15 @@ NSString *SPQueryHistoryReplacesContent = @"QueryHistoryReplacesContent NSString *SPQuickLookTypes = @"QuickLookTypes"; NSString *SPTableChangedNotification = @"SPTableSelectionChanged"; NSString *SPBlobTextEditorSpellCheckingEnabled = @"BlobTextEditorSpellCheckingEnabled"; + +// Toolbar constants + +// Preferences toolbar +NSString *SPPreferenceToolbarGeneral = @"SPPreferenceToolbarGeneral"; +NSString *SPPreferenceToolbarTables = @"SPPreferenceToolbarTables"; +NSString *SPPreferenceToolbarFavorites = @"SPPreferenceToolbarFavorites"; +NSString *SPPreferenceToolbarNotifications = @"SPPreferenceToolbarNotifications"; +NSString *SPPreferenceToolbarAutoUpdate = @"SPPreferenceToolbarAutoUpdate"; +NSString *SPPreferenceToolbarNetwork = @"SPPreferenceToolbarNetwork"; +NSString *SPPreferenceToolbarEditor = @"SPPreferenceToolbarEditor"; +NSString *SPPreferenceToolbarShortcuts = @"SPPreferenceToolbarShortcuts"; diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index 33be5048..7af9f6bc 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -130,7 +130,7 @@ [self _initWithNoSelection]; // Register drag types - [contentFilterTableView registerForDraggedTypes:[NSArray arrayWithObject:CONTENT_FILTER_PB_DRAG_TYPE]]; + [contentFilterTableView registerForDraggedTypes:[NSArray arrayWithObject:SPContentFilterPasteboardDragType]]; [contentFilterArrayController setContent:contentFilters]; [contentFilterTableView reloadData]; @@ -301,7 +301,7 @@ { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:DEFAULT_SEQUEL_PRO_FILE_EXTENSION]; + [panel setRequiredFileType:SPFileExtensionDefault]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:NO]; @@ -322,7 +322,7 @@ [panel beginSheetForDirectory:nil file:@"" - types:[NSArray arrayWithObjects:@"spf", nil] + types:[NSArray arrayWithObjects:SPFileExtensionDefault, nil] modalForWindow:[self window] modalDelegate:self didEndSelector:@selector(importPanelDidEnd:returnCode:contextInfo:) @@ -608,7 +608,7 @@ - (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray *)rows toPasteboard:(NSPasteboard *)pboard { - NSArray *pboardTypes = [NSArray arrayWithObject:CONTENT_FILTER_PB_DRAG_TYPE]; + NSArray *pboardTypes = [NSArray arrayWithObject:SPContentFilterPasteboardDragType]; NSInteger originalRow = [[rows objectAtIndex:0] intValue]; if(originalRow < 1) return NO; @@ -622,7 +622,7 @@ NSKeyedArchiver *archiver = [[[NSKeyedArchiver alloc] initForWritingWithMutableData:indexdata] autorelease]; [archiver encodeObject:rows forKey:@"indexdata"]; [archiver finishEncoding]; - [pboard setData:indexdata forType:CONTENT_FILTER_PB_DRAG_TYPE]; + [pboard setData:indexdata forType:SPContentFilterPasteboardDragType]; return YES; @@ -636,7 +636,7 @@ NSArray *pboardTypes = [[info draggingPasteboard] types]; if (([pboardTypes count] > 1) && (row != -1)) { - if (([pboardTypes containsObject:CONTENT_FILTER_PB_DRAG_TYPE]) && (operation == NSTableViewDropAbove)) { + if (([pboardTypes containsObject:SPContentFilterPasteboardDragType]) && (operation == NSTableViewDropAbove)) { if (row > 0) { return NSDragOperationMove; } @@ -655,7 +655,7 @@ if(row < 1) return NO; - NSKeyedUnarchiver *unarchiver = [[[NSKeyedUnarchiver alloc] initForReadingWithData:[[info draggingPasteboard] dataForType:CONTENT_FILTER_PB_DRAG_TYPE]] autorelease]; + NSKeyedUnarchiver *unarchiver = [[[NSKeyedUnarchiver alloc] initForReadingWithData:[[info draggingPasteboard] dataForType:SPContentFilterPasteboardDragType]] autorelease]; NSArray *draggedRows = [NSArray arrayWithArray:(NSArray *)[unarchiver decodeObjectForKey:@"indexdata"]]; [unarchiver finishDecoding]; diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index ce7c7424..5d2f7575 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -31,15 +31,6 @@ #import "SPConnectionController.h" #import "SPConstants.h" -#define PREFERENCE_TOOLBAR_GENERAL @"Preference Toolbar General" -#define PREFERENCE_TOOLBAR_TABLES @"Preference Toolbar Tables" -#define PREFERENCE_TOOLBAR_FAVORITES @"Preference Toolbar Favorites" -#define PREFERENCE_TOOLBAR_NOTIFICATIONS @"Preference Toolbar Notifications" -#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 - @interface SPPreferenceController (PrivateAPI) @@ -85,7 +76,7 @@ // Replace column's NSTextFieldCell with custom SWProfileTextFieldCell [[[favoritesTableView tableColumns] objectAtIndex:0] setDataCell:tableCell]; - [favoritesTableView registerForDraggedTypes:[NSArray arrayWithObject:FAVORITES_PB_DRAG_TYPE]]; + [favoritesTableView registerForDraggedTypes:[NSArray arrayWithObject:SPFavoritesPasteboardDragType]]; [favoritesTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; [favoritesTableView reloadData]; @@ -448,7 +439,7 @@ [[self window] setMinSize:NSMakeSize(0, 0)]; [[self window] setShowsResizeIndicator:NO]; - [toolbar setSelectedItemIdentifier:PREFERENCE_TOOLBAR_GENERAL]; + [toolbar setSelectedItemIdentifier:SPPreferenceToolbarGeneral]; [self _resizeWindowForContentView:generalView]; } @@ -460,7 +451,7 @@ [[self window] setMinSize:NSMakeSize(0, 0)]; [[self window] setShowsResizeIndicator:NO]; - [toolbar setSelectedItemIdentifier:PREFERENCE_TOOLBAR_TABLES]; + [toolbar setSelectedItemIdentifier:SPPreferenceToolbarTables]; [self _resizeWindowForContentView:tablesView]; } @@ -472,7 +463,7 @@ [[self window] setMinSize:NSMakeSize(0, 0)]; [[self window] setShowsResizeIndicator:NO]; - [toolbar setSelectedItemIdentifier:PREFERENCE_TOOLBAR_EDITOR]; + [toolbar setSelectedItemIdentifier:SPPreferenceToolbarEditor]; NSFont *nf = [NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorFont]]; [editorFontName setStringValue:[NSString stringWithFormat:@"%@, %.1f pt", [nf displayName], [nf pointSize]]]; [self _resizeWindowForContentView:editorView]; @@ -489,7 +480,7 @@ [[self window] setMinSize:NSMakeSize(500, 381)]; [[self window] setShowsResizeIndicator:YES]; - [toolbar setSelectedItemIdentifier:PREFERENCE_TOOLBAR_FAVORITES]; + [toolbar setSelectedItemIdentifier:SPPreferenceToolbarFavorites]; [self _resizeWindowForContentView:favoritesView]; // Set the default favorite popup back to preference @@ -506,7 +497,7 @@ [[self window] setMinSize:NSMakeSize(0, 0)]; [[self window] setShowsResizeIndicator:NO]; - [toolbar setSelectedItemIdentifier:PREFERENCE_TOOLBAR_NOTIFICATIONS]; + [toolbar setSelectedItemIdentifier:SPPreferenceToolbarNotifications]; [self _resizeWindowForContentView:notificationsView]; } @@ -518,7 +509,7 @@ [[self window] setMinSize:NSMakeSize(0, 0)]; [[self window] setShowsResizeIndicator:NO]; - [toolbar setSelectedItemIdentifier:PREFERENCE_TOOLBAR_AUTOUPDATE]; + [toolbar setSelectedItemIdentifier:SPPreferenceToolbarAutoUpdate]; [self _resizeWindowForContentView:autoUpdateView]; } @@ -530,7 +521,7 @@ [[self window] setMinSize:NSMakeSize(0, 0)]; [[self window] setShowsResizeIndicator:NO]; - [toolbar setSelectedItemIdentifier:PREFERENCE_TOOLBAR_NETWORK]; + [toolbar setSelectedItemIdentifier:SPPreferenceToolbarNetwork]; [self _resizeWindowForContentView:networkView]; } @@ -565,11 +556,11 @@ NSArray *pboardTypes; if ([rows count] == 1) { - pboardTypes = [NSArray arrayWithObject:FAVORITES_PB_DRAG_TYPE]; + pboardTypes = [NSArray arrayWithObject:SPFavoritesPasteboardDragType]; originalRow = [[rows objectAtIndex:0] intValue]; [pboard declareTypes:pboardTypes owner:nil]; - [pboard setString:[[NSNumber numberWithInt:originalRow] stringValue] forType:FAVORITES_PB_DRAG_TYPE]; + [pboard setString:[[NSNumber numberWithInt:originalRow] stringValue] forType:SPFavoritesPasteboardDragType]; return YES; } @@ -587,8 +578,8 @@ NSArray *pboardTypes = [[info draggingPasteboard] types]; if (([pboardTypes count] > 1) && (row != -1)) { - if (([pboardTypes containsObject:FAVORITES_PB_DRAG_TYPE]) && (operation == NSTableViewDropAbove)) { - originalRow = [[[info draggingPasteboard] stringForType:FAVORITES_PB_DRAG_TYPE] intValue]; + if (([pboardTypes containsObject:SPFavoritesPasteboardDragType]) && (operation == NSTableViewDropAbove)) { + originalRow = [[[info draggingPasteboard] stringForType:SPFavoritesPasteboardDragType] intValue]; if ((row != originalRow) && (row != (originalRow + 1))) { return NSDragOperationMove; @@ -609,7 +600,7 @@ int lastFavoriteIndexCached; NSMutableDictionary *draggedRow; - originalRow = [[[info draggingPasteboard] stringForType:FAVORITES_PB_DRAG_TYPE] intValue]; + originalRow = [[[info draggingPasteboard] stringForType:SPFavoritesPasteboardDragType] intValue]; destinationRow = row; if (destinationRow > originalRow) { @@ -705,28 +696,28 @@ // ------------------------------------------------------------------------------- - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag { - if ([itemIdentifier isEqualToString:PREFERENCE_TOOLBAR_GENERAL]) { + if ([itemIdentifier isEqualToString:SPPreferenceToolbarGeneral]) { return generalItem; } - else if ([itemIdentifier isEqualToString:PREFERENCE_TOOLBAR_TABLES]) { + else if ([itemIdentifier isEqualToString:SPPreferenceToolbarTables]) { return tablesItem; } - else if ([itemIdentifier isEqualToString:PREFERENCE_TOOLBAR_FAVORITES]) { + else if ([itemIdentifier isEqualToString:SPPreferenceToolbarFavorites]) { return favoritesItem; } - else if ([itemIdentifier isEqualToString:PREFERENCE_TOOLBAR_NOTIFICATIONS]) { + else if ([itemIdentifier isEqualToString:SPPreferenceToolbarNotifications]) { return notificationsItem; } - else if ([itemIdentifier isEqualToString:PREFERENCE_TOOLBAR_AUTOUPDATE]) { + else if ([itemIdentifier isEqualToString:SPPreferenceToolbarAutoUpdate]) { return autoUpdateItem; } - else if ([itemIdentifier isEqualToString:PREFERENCE_TOOLBAR_NETWORK]) { + else if ([itemIdentifier isEqualToString:SPPreferenceToolbarNetwork]) { return networkItem; } - else if ([itemIdentifier isEqualToString:PREFERENCE_TOOLBAR_EDITOR]) { + else if ([itemIdentifier isEqualToString:SPPreferenceToolbarEditor]) { return editorItem; } - else if ([itemIdentifier isEqualToString:PREFERENCE_TOOLBAR_SHORTCUTS]) { + else if ([itemIdentifier isEqualToString:SPPreferenceToolbarShortcuts]) { return shortcutItem; } @@ -738,7 +729,7 @@ // ------------------------------------------------------------------------------- - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar { - 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]; + return [NSArray arrayWithObjects:SPPreferenceToolbarGeneral, SPPreferenceToolbarTables, SPPreferenceToolbarFavorites, SPPreferenceToolbarNotifications, SPPreferenceToolbarEditor, SPPreferenceToolbarShortcuts, SPPreferenceToolbarAutoUpdate, SPPreferenceToolbarNetwork, nil]; } // ------------------------------------------------------------------------------- @@ -746,7 +737,7 @@ // ------------------------------------------------------------------------------- - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar { - 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]; + return [NSArray arrayWithObjects:SPPreferenceToolbarGeneral, SPPreferenceToolbarTables, SPPreferenceToolbarFavorites, SPPreferenceToolbarNotifications, SPPreferenceToolbarEditor, SPPreferenceToolbarShortcuts, SPPreferenceToolbarAutoUpdate, SPPreferenceToolbarNetwork, nil]; } // ------------------------------------------------------------------------------- @@ -754,7 +745,7 @@ // ------------------------------------------------------------------------------- - (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar { - 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]; + return [NSArray arrayWithObjects:SPPreferenceToolbarGeneral, SPPreferenceToolbarTables, SPPreferenceToolbarFavorites, SPPreferenceToolbarNotifications, SPPreferenceToolbarEditor, SPPreferenceToolbarShortcuts, SPPreferenceToolbarAutoUpdate, SPPreferenceToolbarNetwork, nil]; } #pragma mark - @@ -1126,7 +1117,7 @@ toolbar = [[[NSToolbar alloc] initWithIdentifier:@"Preference Toolbar"] autorelease]; // General preferences - generalItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_GENERAL]; + generalItem = [[NSToolbarItem alloc] initWithItemIdentifier:SPPreferenceToolbarGeneral]; [generalItem setLabel:NSLocalizedString(@"General", @"")]; [generalItem setImage:[NSImage imageNamed:@"toolbar-preferences-general"]]; @@ -1134,7 +1125,7 @@ [generalItem setAction:@selector(displayGeneralPreferences:)]; // Table preferences - tablesItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_TABLES]; + tablesItem = [[NSToolbarItem alloc] initWithItemIdentifier:SPPreferenceToolbarTables]; [tablesItem setLabel:NSLocalizedString(@"Tables", @"")]; [tablesItem setImage:[NSImage imageNamed:@"toolbar-preferences-tables"]]; @@ -1142,7 +1133,7 @@ [tablesItem setAction:@selector(displayTablePreferences:)]; // Favorite preferences - favoritesItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_FAVORITES]; + favoritesItem = [[NSToolbarItem alloc] initWithItemIdentifier:SPPreferenceToolbarFavorites]; [favoritesItem setLabel:NSLocalizedString(@"Favorites", @"")]; [favoritesItem setImage:[NSImage imageNamed:@"toolbar-preferences-favorites"]]; @@ -1150,7 +1141,7 @@ [favoritesItem setAction:@selector(displayFavoritePreferences:)]; // Notification preferences - notificationsItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_NOTIFICATIONS]; + notificationsItem = [[NSToolbarItem alloc] initWithItemIdentifier:SPPreferenceToolbarNotifications]; [notificationsItem setLabel:NSLocalizedString(@"Alerts & Logs", @"")]; [notificationsItem setImage:[NSImage imageNamed:@"toolbar-preferences-notifications"]]; @@ -1158,7 +1149,7 @@ [notificationsItem setAction:@selector(displayNotificationPreferences:)]; // Editor preferences - editorItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_EDITOR]; + editorItem = [[NSToolbarItem alloc] initWithItemIdentifier:SPPreferenceToolbarEditor]; [editorItem setLabel:NSLocalizedString(@"Query Editor", @"")]; [editorItem setImage:[NSImage imageNamed:@"toolbar-preferences-queryeditor"]]; @@ -1166,7 +1157,7 @@ [editorItem setAction:@selector(displayEditorPreferences:)]; // Shortcut preferences - /*shortcutItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_SHORTCUTS]; + /*shortcutItem = [[NSToolbarItem alloc] initWithItemIdentifier:SPPreferenceToolbarShortcuts]; [shortcutItem setLabel:NSLocalizedString(@"Shortcuts", @"")]; [shortcutItem setImage:[NSImage imageNamed:@"toolbar-preferences-shortcuts"]]; @@ -1174,7 +1165,7 @@ [shortcutItem setAction:@selector(NSBeep)];*/ // AutoUpdate preferences - autoUpdateItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_AUTOUPDATE]; + autoUpdateItem = [[NSToolbarItem alloc] initWithItemIdentifier:SPPreferenceToolbarAutoUpdate]; [autoUpdateItem setLabel:NSLocalizedString(@"Auto Update", @"")]; [autoUpdateItem setImage:[NSImage imageNamed:@"toolbar-preferences-autoupdate"]]; @@ -1182,7 +1173,7 @@ [autoUpdateItem setAction:@selector(displayAutoUpdatePreferences:)]; // Network preferences - networkItem = [[NSToolbarItem alloc] initWithItemIdentifier:PREFERENCE_TOOLBAR_NETWORK]; + networkItem = [[NSToolbarItem alloc] initWithItemIdentifier:SPPreferenceToolbarNetwork]; [networkItem setLabel:NSLocalizedString(@"Network", @"")]; [networkItem setImage:[NSImage imageNamed:@"toolbar-preferences-network"]]; @@ -1190,7 +1181,7 @@ [networkItem setAction:@selector(displayNetworkPreferences:)]; [toolbar setDelegate:self]; - [toolbar setSelectedItemIdentifier:PREFERENCE_TOOLBAR_GENERAL]; + [toolbar setSelectedItemIdentifier:SPPreferenceToolbarGeneral]; [toolbar setAllowsUserCustomization:NO]; [preferencesWindow setToolbar:toolbar]; diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index 8a054ce3..177ec197 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -237,7 +237,7 @@ static SPQueryController *sharedQueryController = nil; { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:DEFAULT_CONSOLE_LOG_FILE_EXTENSION]; + [panel setRequiredFileType:SPFileExtensionSQL]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m index dc1cfdcf..a1b1a080 100644 --- a/Source/SPQueryFavoriteManager.m +++ b/Source/SPQueryFavoriteManager.m @@ -120,7 +120,7 @@ [self _initWithNoSelection]; // Register drag types - [favoritesTableView registerForDraggedTypes:[NSArray arrayWithObject:QUERY_FAVORITES_PB_DRAG_TYPE]]; + [favoritesTableView registerForDraggedTypes:[NSArray arrayWithObject:SPFavoritesPasteboardDragType]]; [favoritesArrayController setContent:favorites]; [favoritesTableView reloadData]; @@ -288,7 +288,7 @@ { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:DEFAULT_QUERY_FAVORITE_FILE_EXTENSION]; + [panel setRequiredFileType:SPFileExtensionSQL]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:YES]; @@ -306,7 +306,7 @@ { NSSavePanel *panel = [NSSavePanel savePanel]; - [panel setRequiredFileType:DEFAULT_SEQUEL_PRO_FILE_EXTENSION]; + [panel setRequiredFileType:SPFileExtensionDefault]; [panel setExtensionHidden:NO]; [panel setAllowsOtherFileTypes:NO]; @@ -571,7 +571,7 @@ // Up to now only one row can be dragged // if ([rows count] == 1) { - NSArray *pboardTypes = [NSArray arrayWithObject:QUERY_FAVORITES_PB_DRAG_TYPE]; + NSArray *pboardTypes = [NSArray arrayWithObject:SPFavoritesPasteboardDragType]; NSInteger originalRow = [[rows objectAtIndex:0] intValue]; if(originalRow < 1) return NO; @@ -585,7 +585,7 @@ NSKeyedArchiver *archiver = [[[NSKeyedArchiver alloc] initForWritingWithMutableData:indexdata] autorelease]; [archiver encodeObject:rows forKey:@"indexdata"]; [archiver finishEncoding]; - [pboard setData:indexdata forType:QUERY_FAVORITES_PB_DRAG_TYPE]; + [pboard setData:indexdata forType:SPFavoritesPasteboardDragType]; return YES; @@ -602,7 +602,7 @@ NSArray *pboardTypes = [[info draggingPasteboard] types]; if (([pboardTypes count] > 1) && (row != -1)) { - if (([pboardTypes containsObject:QUERY_FAVORITES_PB_DRAG_TYPE]) && (operation == NSTableViewDropAbove)) { + if (([pboardTypes containsObject:SPFavoritesPasteboardDragType]) && (operation == NSTableViewDropAbove)) { if (row > 0) { return NSDragOperationMove; } @@ -621,7 +621,7 @@ if(row < 1) return NO; - NSKeyedUnarchiver *unarchiver = [[[NSKeyedUnarchiver alloc] initForReadingWithData:[[info draggingPasteboard] dataForType:QUERY_FAVORITES_PB_DRAG_TYPE]] autorelease]; + NSKeyedUnarchiver *unarchiver = [[[NSKeyedUnarchiver alloc] initForReadingWithData:[[info draggingPasteboard] dataForType:SPFavoritesPasteboardDragType]] autorelease]; NSArray *draggedRows = [NSArray arrayWithArray:(NSArray *)[unarchiver decodeObjectForKey:@"indexdata"]]; [unarchiver finishDecoding]; |