aboutsummaryrefslogtreecommitdiffstats
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
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.
-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);
'#n1281'>1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761