diff options
author | stuconnolly <stuart02@gmail.com> | 2011-05-08 00:22:49 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2011-05-08 00:22:49 +0000 |
commit | 824040d210122bae105d0a240a6e00b99328b4ef (patch) | |
tree | f8fee8ef8384598ac308074f853a4b31e6458510 /Source | |
parent | 96bc6d783f72032d5b04b4748f915239c56b9bd3 (diff) | |
download | sequelpro-824040d210122bae105d0a240a6e00b99328b4ef.tar.gz sequelpro-824040d210122bae105d0a240a6e00b99328b4ef.tar.bz2 sequelpro-824040d210122bae105d0a240a6e00b99328b4ef.zip |
Minor tidy up.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPDatabaseDocument.m | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 8c05daa0..44dd929d 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -77,6 +77,9 @@ #import "NSNotificationAdditions.h" #endif +// Constants +static NSString *SPCreateSyntx = @"SPCreateSyntax"; + @interface SPDatabaseDocument (PrivateAPI) #ifndef SP_REFACTOR /* method decls */ @@ -2134,7 +2137,7 @@ [panel setAllowsOtherFileTypes:YES]; [panel setCanSelectHiddenExtension:YES]; - [panel beginSheetForDirectory:nil file:@"CreateSyntax" modalForWindow:createTableSyntaxWindow modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:@"CreateSyntax"]; + [panel beginSheetForDirectory:nil file:@"CreateSyntax" modalForWindow:createTableSyntaxWindow modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:SPCreateSyntx]; } /** @@ -3281,11 +3284,11 @@ } } - if ([menuItem action] == @selector(import:) || - [menuItem action] == @selector(removeDatabase:) || - [menuItem action] == @selector(copyDatabase:) || - [menuItem action] == @selector(renameDatabase:) || - [menuItem action] == @selector(openDatabaseInNewTab:) || + if ([menuItem action] == @selector(import:) || + [menuItem action] == @selector(removeDatabase:) || + [menuItem action] == @selector(copyDatabase:) || + [menuItem action] == @selector(renameDatabase:) || + [menuItem action] == @selector(openDatabaseInNewTab:) || [menuItem action] == @selector(refreshTables:)) { return ([self database] != nil); @@ -3419,12 +3422,12 @@ - (void)savePanelDidEnd:(NSSavePanel *)sheet returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo { if (returnCode == NSOKButton) { - if ([contextInfo isEqualToString:@"CreateSyntax"]) { + if ([contextInfo isEqualToString:SPCreateSyntx]) { NSString *createSyntax = [createTableSyntaxTextView string]; if ([createSyntax length] > 0) { - NSString *output = [NSString stringWithFormat:@"-- Create syntax for '%@'\n\n%@\n", [self table], createSyntax]; + NSString *output = [NSString stringWithFormat:@"-- %@ '%@'\n\n%@\n", NSLocalizedString(@"Create syntax for", @"create syntax for table comment"), [self table], createSyntax]; [output writeToFile:[sheet filename] atomically:YES encoding:NSUTF8StringEncoding error:NULL]; } @@ -3576,7 +3579,7 @@ /** * Return the identifier for the currently selected toolbar item, or nil if none is selected. */ -- (NSString *)selectedToolbarItemIdentifier; +- (NSString *)selectedToolbarItemIdentifier { return [mainToolbar selectedItemIdentifier]; } |