aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-12-12 16:35:04 +0000
committerstuconnolly <stuart02@gmail.com>2009-12-12 16:35:04 +0000
commit367f3c398a7f83e99d8383af8ce2fdeae5ba9f69 (patch)
treedb36900932707ef65d84961853df6d9f419f9328 /Source
parentad93154f88120c37081fc9f816b25a9410b3b89c (diff)
downloadsequelpro-367f3c398a7f83e99d8383af8ce2fdeae5ba9f69.tar.gz
sequelpro-367f3c398a7f83e99d8383af8ce2fdeae5ba9f69.tar.bz2
sequelpro-367f3c398a7f83e99d8383af8ce2fdeae5ba9f69.zip
Replace the main toolbar's #define'd identifier constants with extern's. This completes the conversion of all constants in SPConstants to extern's.
Diffstat (limited to 'Source')
-rw-r--r--Source/CustomQuery.m4
-rw-r--r--Source/SPConstants.h28
-rw-r--r--Source/SPConstants.m12
-rw-r--r--Source/SPExtendedTableInfo.m6
-rw-r--r--Source/SPTableRelations.m6
-rw-r--r--Source/TableContent.m6
-rw-r--r--Source/TableDocument.m101
-rw-r--r--Source/TableDump.m2
-rw-r--r--Source/TableSource.m6
9 files changed, 89 insertions, 82 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index a1922f8f..6a979509 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -2673,7 +2673,7 @@
isWorking = YES;
// Only proceed if this view is selected.
- if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_CUSTOM_QUERY])
+ if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarCustomQuery])
return;
[runSelectionButton setEnabled:NO];
@@ -2690,7 +2690,7 @@
isWorking = NO;
// Only proceed if this view is selected.
- if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_CUSTOM_QUERY])
+ if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarCustomQuery])
return;
if (selectionButtonCanBeEnabled) {
diff --git a/Source/SPConstants.h b/Source/SPConstants.h
index 44675888..73f363c8 100644
--- a/Source/SPConstants.h
+++ b/Source/SPConstants.h
@@ -23,24 +23,8 @@
//
// More info at <http://code.google.com/p/sequel-pro/>
-// TODO: change #defines
-// see http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingIvarsAndTypes.html#//apple_ref/doc/uid/20001284-1003095
-
#import <Cocoa/Cocoa.h>
-// Main toolbar constants
-#define MAIN_TOOLBAR_DATABASE_SELECTION @"DatabaseSelectToolbarItemIdentifier"
-#define MAIN_TOOLBAR_HISTORY_NAVIGATION @"HistoryNavigationToolbarItemIdentifier"
-#define MAIN_TOOLBAR_SHOW_CONSOLE @"ShowConsoleIdentifier"
-#define MAIN_TOOLBAR_CLEAR_CONSOLE @"ClearConsoleIdentifier"
-#define MAIN_TOOLBAR_FLUSH_PRIVILEGES @"FlushPrivilegesIdentifier"
-#define MAIN_TOOLBAR_TABLE_STRUCTURE @"SwitchToTableStructureToolbarItemIdentifier"
-#define MAIN_TOOLBAR_TABLE_CONTENT @"SwitchToTableContentToolbarItemIdentifier"
-#define MAIN_TOOLBAR_CUSTOM_QUERY @"SwitchToRunQueryToolbarItemIdentifier"
-#define MAIN_TOOLBAR_TABLE_INFO @"SwitchToTableInfoToolbarItemIdentifier"
-#define MAIN_TOOLBAR_TABLE_RELATIONS @"SwitchToTableRelationsToolbarItemIdentifier"
-#define MAIN_TOOLBAR_USER_MANAGER @"SwitchToUserManagerToolbarItemIdentifier"
-
// View modes
typedef enum {
SPStructureViewMode = 1,
@@ -186,6 +170,18 @@ extern NSString *SPContactURL;
// Toolbar constants
+// Main window toolbar
+extern NSString *SPMainToolbarDatabaseSelection;
+extern NSString *SPMainToolbarHistoryNavigation;
+extern NSString *SPMainToolbarShowConsole;
+extern NSString *SPMainToolbarClearConsole;
+extern NSString *SPMainToolbarTableStructure;
+extern NSString *SPMainToolbarTableContent;
+extern NSString *SPMainToolbarCustomQuery;
+extern NSString *SPMainToolbarTableInfo;
+extern NSString *SPMainToolbarTableRelations;
+extern NSString *SPMainToolbarUserManager;
+
// Preferences toolbar
extern NSString *SPPreferenceToolbarGeneral;
extern NSString *SPPreferenceToolbarTables;
diff --git a/Source/SPConstants.m b/Source/SPConstants.m
index 7e864a51..27fa998e 100644
--- a/Source/SPConstants.m
+++ b/Source/SPConstants.m
@@ -145,6 +145,18 @@ NSString *SPContactURL = @"http://www.sequelpro.com/do
// Toolbar constants
+// Main window toolbar
+NSString *SPMainToolbarDatabaseSelection = @"DatabaseSelectToolbarItemIdentifier";
+NSString *SPMainToolbarHistoryNavigation = @"HistoryNavigationToolbarItemIdentifier";
+NSString *SPMainToolbarShowConsole = @"ShowConsoleIdentifier";
+NSString *SPMainToolbarClearConsole = @"ClearConsoleIdentifier";
+NSString *SPMainToolbarTableStructure = @"SwitchToTableStructureToolbarItemIdentifier";
+NSString *SPMainToolbarTableContent = @"SwitchToTableContentToolbarItemIdentifier";
+NSString *SPMainToolbarCustomQuery = @"SwitchToRunQueryToolbarItemIdentifier";
+NSString *SPMainToolbarTableInfo = @"SwitchToTableInfoToolbarItemIdentifier";
+NSString *SPMainToolbarTableRelations = @"SwitchToTableRelationsToolbarItemIdentifier";
+NSString *SPMainToolbarUserManager = @"SwitchToUserManagerToolbarItemIdentifier";
+
// Preferences toolbar
NSString *SPPreferenceToolbarGeneral = @"SPPreferenceToolbarGeneral";
NSString *SPPreferenceToolbarTables = @"SPPreferenceToolbarTables";
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index b2d92a58..e07eb17c 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -181,7 +181,7 @@
*/
- (void)loadTable:(NSString *)table
{
- BOOL enableInteraction = ![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_INFO] || ![tableDocumentInstance isWorking];
+ BOOL enableInteraction = ![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableInfo] || ![tableDocumentInstance isWorking];
// Store the table name away for future use
selectedTable = table;
@@ -369,7 +369,7 @@
- (void)startDocumentTaskForTab:(NSNotification *)aNotification
{
// Only proceed if this view is selected.
- if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_INFO])
+ if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableInfo])
return;
[tableTypePopUpButton setEnabled:NO];
@@ -384,7 +384,7 @@
- (void)endDocumentTaskForTab:(NSNotification *)aNotification
{
// Only proceed if this view is selected.
- if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_INFO])
+ if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableInfo])
return;
NSDictionary *statusFields = [tableDataInstance statusValues];
diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m
index 29719f0b..07ab03c4 100644
--- a/Source/SPTableRelations.m
+++ b/Source/SPTableRelations.m
@@ -232,7 +232,7 @@
*/
- (void)tableSelectionChanged:(NSNotification *)notification
{
- BOOL enableInteraction = ![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_RELATIONS] || ![tableDocumentInstance isWorking];
+ BOOL enableInteraction = ![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableRelations] || ![tableDocumentInstance isWorking];
// To begin enable all interface elements
[addRelationButton setEnabled:enableInteraction];
@@ -315,7 +315,7 @@
{
// Only proceed if this view is selected.
- if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_RELATIONS])
+ if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableRelations])
return;
[addRelationButton setEnabled:NO];
@@ -330,7 +330,7 @@
{
// Only proceed if this view is selected.
- if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_RELATIONS])
+ if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableRelations])
return;
if ([relationsTableView isEnabled]) {
diff --git a/Source/TableContent.m b/Source/TableContent.m
index 98de0278..6b82d54b 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -243,7 +243,7 @@
NSArray *columnNames;
NSDictionary *columnDefinition;
NSTableColumn *theCol;
- BOOL enableInteraction = ![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_CONTENT] || ![tableDocumentInstance isWorking];
+ BOOL enableInteraction = ![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableContent] || ![tableDocumentInstance isWorking];
if (!tableDetails) {
newTableName = nil;
@@ -2973,7 +2973,7 @@
isWorking = YES;
// Only proceed if this view is selected.
- if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_CONTENT])
+ if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableContent])
return;
[addButton setEnabled:NO];
@@ -2995,7 +2995,7 @@
isWorking = NO;
// Only proceed if this view is selected.
- if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_CONTENT])
+ if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableContent])
return;
if ( ![[[tableDataInstance statusValues] objectForKey:@"Rows"] isNSNull] && selectedTable && [selectedTable length] && [tableDataInstance tableEncoding]) {
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 7da74a07..e8ad22bf 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -2931,12 +2931,12 @@
// Cancel the selection if currently editing a content row and unable to save
if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 1
&& ![tableContentInstance saveRowOnDeselect]) {
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_CONTENT];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableContent];
return;
}
[tableTabView selectTabViewItemAtIndex:0];
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_STRUCTURE];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableStructure];
[spHistoryControllerInstance updateHistoryEntries];
[prefs setInteger:SPStructureViewMode forKey:SPLastViewMode];
@@ -2947,12 +2947,12 @@
// Cancel the selection if currently editing structure/a field and unable to save
if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 0
&& ![tableSourceInstance saveRowOnDeselect]) {
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_STRUCTURE];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableStructure];
return;
}
[tableTabView selectTabViewItemAtIndex:1];
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_CONTENT];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableContent];
[spHistoryControllerInstance updateHistoryEntries];
[prefs setInteger:SPContentViewMode forKey:SPLastViewMode];
@@ -2963,19 +2963,19 @@
// Cancel the selection if currently editing structure/a field and unable to save
if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 0
&& ![tableSourceInstance saveRowOnDeselect]) {
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_STRUCTURE];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableStructure];
return;
}
// Cancel the selection if currently editing a content row and unable to save
if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 1
&& ![tableContentInstance saveRowOnDeselect]) {
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_CONTENT];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableContent];
return;
}
[tableTabView selectTabViewItemAtIndex:2];
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_CUSTOM_QUERY];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarCustomQuery];
[spHistoryControllerInstance updateHistoryEntries];
// Set the focus on the text field if no query has been run
@@ -2989,19 +2989,19 @@
// Cancel the selection if currently editing structure/a field and unable to save
if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 0
&& ![tableSourceInstance saveRowOnDeselect]) {
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_STRUCTURE];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableStructure];
return;
}
// Cancel the selection if currently editing a content row and unable to save
if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 1
&& ![tableContentInstance saveRowOnDeselect]) {
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_CONTENT];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableContent];
return;
}
[tableTabView selectTabViewItemAtIndex:3];
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_INFO];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableInfo];
[spHistoryControllerInstance updateHistoryEntries];
[prefs setInteger:SPTableInfoViewMode forKey:SPLastViewMode];
@@ -3012,19 +3012,19 @@
// Cancel the selection if currently editing structure/a field and unable to save
if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 0
&& ![tableSourceInstance saveRowOnDeselect]) {
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_STRUCTURE];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableStructure];
return;
}
// Cancel the selection if currently editing a content row and unable to save
if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 1
&& ![tableContentInstance saveRowOnDeselect]) {
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_CONTENT];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableContent];
return;
}
[tableTabView selectTabViewItemAtIndex:4];
- [mainToolbar setSelectedItemIdentifier:MAIN_TOOLBAR_TABLE_RELATIONS];
+ [mainToolbar setSelectedItemIdentifier:SPMainToolbarTableRelations];
[spHistoryControllerInstance updateHistoryEntries];
[prefs setInteger:SPRelationsViewMode forKey:SPLastViewMode];
@@ -3157,7 +3157,7 @@
{
NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier] autorelease];
- if ([itemIdentifier isEqualToString:MAIN_TOOLBAR_DATABASE_SELECTION]) {
+ if ([itemIdentifier isEqualToString:SPMainToolbarDatabaseSelection]) {
[toolbarItem setLabel:NSLocalizedString(@"Select Database", @"toolbar item for selecting a db")];
[toolbarItem setPaletteLabel:[toolbarItem label]];
[toolbarItem setView:chooseDatabaseButton];
@@ -3171,12 +3171,12 @@
[self updateChooseDatabaseToolbarItemWidth];
}
- } else if ([itemIdentifier isEqualToString:MAIN_TOOLBAR_HISTORY_NAVIGATION]) {
+ } else if ([itemIdentifier isEqualToString:SPMainToolbarHistoryNavigation]) {
[toolbarItem setLabel:NSLocalizedString(@"Table History", @"toolbar item for navigation history")];
[toolbarItem setPaletteLabel:[toolbarItem label]];
[toolbarItem setView:historyControl];
- } else if ([itemIdentifier isEqualToString:MAIN_TOOLBAR_SHOW_CONSOLE]) {
+ } else if ([itemIdentifier isEqualToString:SPMainToolbarShowConsole]) {
[toolbarItem setPaletteLabel:NSLocalizedString(@"Show Console", @"show console")];
[toolbarItem setToolTip:NSLocalizedString(@"Show the console which shows all MySQL commands performed by Sequel Pro", @"tooltip for toolbar item for show console")];
@@ -3187,7 +3187,7 @@
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(showConsole:)];
- } else if ([itemIdentifier isEqualToString:MAIN_TOOLBAR_CLEAR_CONSOLE]) {
+ } else if ([itemIdentifier isEqualToString:SPMainToolbarClearConsole]) {
//set the text label to be displayed in the toolbar and customization palette
[toolbarItem setLabel:NSLocalizedString(@"Clear Console", @"toolbar item for clear console")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Clear Console", @"toolbar item for clear console")];
@@ -3198,7 +3198,7 @@
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(clearConsole:)];
- } else if ([itemIdentifier isEqualToString:MAIN_TOOLBAR_TABLE_STRUCTURE]) {
+ } else if ([itemIdentifier isEqualToString:SPMainToolbarTableStructure]) {
[toolbarItem setLabel:NSLocalizedString(@"Structure", @"toolbar item label for switching to the Table Structure tab")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Edit Table Structure", @"toolbar item label for switching to the Table Structure tab")];
//set up tooltip and image
@@ -3208,7 +3208,7 @@
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(viewStructure:)];
- } else if ([itemIdentifier isEqualToString:MAIN_TOOLBAR_TABLE_CONTENT]) {
+ } else if ([itemIdentifier isEqualToString:SPMainToolbarTableContent]) {
[toolbarItem setLabel:NSLocalizedString(@"Content", @"toolbar item label for switching to the Table Content tab")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Browse & Edit Table Content", @"toolbar item label for switching to the Table Content tab")];
//set up tooltip and image
@@ -3218,7 +3218,7 @@
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(viewContent:)];
- } else if ([itemIdentifier isEqualToString:MAIN_TOOLBAR_CUSTOM_QUERY]) {
+ } else if ([itemIdentifier isEqualToString:SPMainToolbarCustomQuery]) {
[toolbarItem setLabel:NSLocalizedString(@"Query", @"toolbar item label for switching to the Run Query tab")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Run Custom Query", @"toolbar item label for switching to the Run Query tab")];
//set up tooltip and image
@@ -3228,7 +3228,7 @@
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(viewQuery:)];
- } else if ([itemIdentifier isEqualToString:MAIN_TOOLBAR_TABLE_INFO]) {
+ } else if ([itemIdentifier isEqualToString:SPMainToolbarTableInfo]) {
[toolbarItem setLabel:NSLocalizedString(@"Table Info", @"toolbar item label for switching to the Table Info tab")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Table Info", @"toolbar item label for switching to the Table Info tab")];
//set up tooltip and image
@@ -3238,7 +3238,7 @@
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(viewStatus:)];
- } else if ([itemIdentifier isEqualToString:MAIN_TOOLBAR_TABLE_RELATIONS]) {
+ } else if ([itemIdentifier isEqualToString:SPMainToolbarTableRelations]) {
[toolbarItem setLabel:NSLocalizedString(@"Relations", @"toolbar item label for switching to the Table Relations tab")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Table Relations", @"toolbar item label for switching to the Table Relations tab")];
//set up tooltip and image
@@ -3248,7 +3248,7 @@
[toolbarItem setTarget:self];
[toolbarItem setAction:@selector(viewRelations:)];
- } else if ([itemIdentifier isEqualToString:MAIN_TOOLBAR_USER_MANAGER]) {
+ } else if ([itemIdentifier isEqualToString:SPMainToolbarUserManager]) {
[toolbarItem setLabel:NSLocalizedString(@"Users", @"toolbar item label for switching to the User Manager tab")];
[toolbarItem setPaletteLabel:NSLocalizedString(@"Users", @"toolbar item label for switching to the User Manager tab")];
//set up tooltip and image
@@ -3271,17 +3271,16 @@
- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar
{
return [NSArray arrayWithObjects:
- MAIN_TOOLBAR_DATABASE_SELECTION,
- MAIN_TOOLBAR_HISTORY_NAVIGATION,
- MAIN_TOOLBAR_SHOW_CONSOLE,
- MAIN_TOOLBAR_CLEAR_CONSOLE,
- MAIN_TOOLBAR_FLUSH_PRIVILEGES,
- MAIN_TOOLBAR_TABLE_STRUCTURE,
- MAIN_TOOLBAR_TABLE_CONTENT,
- MAIN_TOOLBAR_CUSTOM_QUERY,
- MAIN_TOOLBAR_TABLE_INFO,
- MAIN_TOOLBAR_TABLE_RELATIONS,
- MAIN_TOOLBAR_USER_MANAGER,
+ SPMainToolbarDatabaseSelection,
+ SPMainToolbarHistoryNavigation,
+ SPMainToolbarShowConsole,
+ SPMainToolbarClearConsole,
+ SPMainToolbarTableStructure,
+ SPMainToolbarTableContent,
+ SPMainToolbarCustomQuery,
+ SPMainToolbarTableInfo,
+ SPMainToolbarTableRelations,
+ SPMainToolbarUserManager,
NSToolbarCustomizeToolbarItemIdentifier,
NSToolbarFlexibleSpaceItemIdentifier,
NSToolbarSpaceItemIdentifier,
@@ -3295,16 +3294,16 @@
- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar
{
return [NSArray arrayWithObjects:
- MAIN_TOOLBAR_DATABASE_SELECTION,
- MAIN_TOOLBAR_TABLE_STRUCTURE,
- MAIN_TOOLBAR_TABLE_CONTENT,
- MAIN_TOOLBAR_TABLE_RELATIONS,
- MAIN_TOOLBAR_TABLE_INFO,
- MAIN_TOOLBAR_CUSTOM_QUERY,
+ SPMainToolbarDatabaseSelection,
+ SPMainToolbarTableStructure,
+ SPMainToolbarTableContent,
+ SPMainToolbarTableRelations,
+ SPMainToolbarTableInfo,
+ SPMainToolbarCustomQuery,
NSToolbarFlexibleSpaceItemIdentifier,
- MAIN_TOOLBAR_HISTORY_NAVIGATION,
- MAIN_TOOLBAR_USER_MANAGER,
- MAIN_TOOLBAR_SHOW_CONSOLE,
+ SPMainToolbarHistoryNavigation,
+ SPMainToolbarUserManager,
+ SPMainToolbarShowConsole,
nil];
}
@@ -3314,11 +3313,11 @@
- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar
{
return [NSArray arrayWithObjects:
- MAIN_TOOLBAR_TABLE_STRUCTURE,
- MAIN_TOOLBAR_TABLE_CONTENT,
- MAIN_TOOLBAR_CUSTOM_QUERY,
- MAIN_TOOLBAR_TABLE_INFO,
- MAIN_TOOLBAR_TABLE_RELATIONS,
+ SPMainToolbarTableStructure,
+ SPMainToolbarTableContent,
+ SPMainToolbarCustomQuery,
+ SPMainToolbarTableInfo,
+ SPMainToolbarTableRelations,
nil];
}
@@ -3333,7 +3332,7 @@
NSString *identifier = [toolbarItem itemIdentifier];
// Show console item
- if ([identifier isEqualToString:MAIN_TOOLBAR_SHOW_CONSOLE]) {
+ if ([identifier isEqualToString:SPMainToolbarShowConsole]) {
if ([[[SPQueryController sharedQueryController] window] isVisible]) {
[toolbarItem setImage:[NSImage imageNamed:@"showconsole"]];
} else {
@@ -3347,11 +3346,11 @@
}
// Clear console item
- if ([identifier isEqualToString:MAIN_TOOLBAR_CLEAR_CONSOLE]) {
+ if ([identifier isEqualToString:SPMainToolbarClearConsole]) {
return ([[SPQueryController sharedQueryController] consoleMessageCount] > 0);
}
- if (![identifier isEqualToString:MAIN_TOOLBAR_CUSTOM_QUERY]) {
+ if (![identifier isEqualToString:SPMainToolbarCustomQuery]) {
return (([tablesListInstance tableType] == SP_TABLETYPE_TABLE) ||
([tablesListInstance tableType] == SP_TABLETYPE_VIEW));
}
diff --git a/Source/TableDump.m b/Source/TableDump.m
index f1c2f678..98feeedb 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -1080,7 +1080,7 @@
// If the table selected for import is also selected in the content view,
// update the content view - on the main thread to avoid crashes.
if ([tablesListInstance tableName] && [[fieldMappingPopup titleOfSelectedItem] isEqualToString:[tablesListInstance tableName]]) {
- if ([[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_CONTENT]) {
+ if ([[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableContent]) {
[tableContentInstance performSelectorOnMainThread:@selector(reloadTable:) withObject:nil waitUntilDone:YES];
} else {
[tablesListInstance setContentRequiresReload:YES];
diff --git a/Source/TableSource.m b/Source/TableSource.m
index 0bf9fcde..fb4c633e 100644
--- a/Source/TableSource.m
+++ b/Source/TableSource.m
@@ -55,7 +55,7 @@ loads aTable, put it in an array, update the tableViewColumns and reload the tab
id extra;
int i;
SPSQLParser *fieldParser;
- BOOL enableInteraction = ![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_STRUCTURE] || ![tableDocumentInstance isWorking];
+ BOOL enableInteraction = ![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableStructure] || ![tableDocumentInstance isWorking];
// Check whether a save of the current row is required.
if ( ![self saveRowOnDeselect] ) return;
@@ -992,7 +992,7 @@ returns a dictionary containing enum/set field names as key and possible values
{
// Only proceed if this view is selected.
- if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_STRUCTURE])
+ if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableStructure])
return;
[tableSourceView setEnabled:NO];
@@ -1015,7 +1015,7 @@ returns a dictionary containing enum/set field names as key and possible values
{
// Only re-enable elements if the current tab is the structure view
- if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:MAIN_TOOLBAR_TABLE_STRUCTURE])
+ if (![[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableStructure])
return;
BOOL editingEnabled = ([tablesListInstance tableType] == SP_TABLETYPE_TABLE);