From d766381344119184158738d2d5a23484a8a1b3a1 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Thu, 1 Oct 2009 15:23:33 +0000 Subject: - Add copy create syntax button to the create syntax sheet. - Fix the Growl notification prefs message as well as making the dialog a sheet. - Re-run genstrings to update localizable.strings and also remove use of multiple comments for a single string. --- Interfaces/English.lproj/DBView.xib | 79 +++++++++++++++++++++++++-- Interfaces/English.lproj/Localizable.strings | Bin 84242 -> 92506 bytes Source/SPContentFilterManager.m | 2 +- Source/SPPreferenceController.m | 10 ++-- Source/TableDocument.h | 1 + Source/TableDocument.m | 21 +++++++ Source/TableDump.m | 4 +- 7 files changed, 103 insertions(+), 14 deletions(-) diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib index 31e8191a..d3b36706 100644 --- a/Interfaces/English.lproj/DBView.xib +++ b/Interfaces/English.lproj/DBView.xib @@ -23,7 +23,7 @@ YES - + YES @@ -7408,12 +7408,14 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 256 {399, 251} + YES 256 {399, 17} + @@ -7421,6 +7423,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 256 {{400, 0}, {12, 17}} + YES @@ -7497,6 +7500,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{1, 17}, {399, 251}} + @@ -7507,6 +7511,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 256 {{400, 17}, {11, 251}} + 256 _doScroller: @@ -7517,6 +7522,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 -2147483392 {{-100, -100}, {358, 11}} + 257 _doScroller: @@ -7531,6 +7537,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{1, 0}, {399, 17}} + @@ -7540,6 +7547,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{-1, 39}, {412, 269}} + 18 @@ -7554,6 +7562,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 257 {{320, 5}, {76, 28}} + YES 67239424 @@ -7575,6 +7584,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 260 {{15, 5}, {111, 28}} + YES -2080244224 @@ -7595,6 +7605,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 268 {{9, 316}, {97, 14}} + YES 68288064 @@ -7611,6 +7622,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 265 {{229, 314}, {170, 19}} + YES 343014976 @@ -7674,6 +7686,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 266 {{108, 316}, {116, 14}} + YES 68288064 @@ -7688,6 +7701,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {411, 341} + {{0, 0}, {1440, 878}} {350, 222} @@ -7706,7 +7720,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {3.40282e+38, 3.40282e+38} {350, 200} - + 256 YES @@ -7843,6 +7857,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{1, 1}, {411, 264}} + @@ -7872,13 +7887,36 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 {{-1, 42}, {413, 266}} + 514 + + + 260 + {{124, 5}, {76, 28}} + + YES + + 67239424 + 138018816 + Copy + + + -2038284033 + 1 + + + + 200 + 25 + + {411, 341} + {{0, 0}, {1680, 1028}} {350, 222} @@ -15647,6 +15685,14 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 6601 + + + copyCreateTableSyntaxFromSheet: + + + + 6608 + @@ -21979,6 +22025,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 + @@ -22050,6 +22097,20 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 + + 6606 + + + YES + + + + + + 6607 + + + @@ -23382,6 +23443,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 6583.IBPluginDependency 6584.IBPluginDependency 6585.IBPluginDependency + 6606.IBPluginDependency + 6606.ImportedFromIB2 + 6607.IBPluginDependency 662.IBPluginDependency 662.ImportedFromIB2 663.IBPluginDependency @@ -25304,6 +25368,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -25351,9 +25418,9 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 com.apple.InterfaceBuilder.CocoaPlugin - {{795, 383}, {411, 341}} + {{711, 412}, {411, 341}} com.apple.InterfaceBuilder.CocoaPlugin - {{795, 383}, {411, 341}} + {{711, 412}, {411, 341}} {{321, 508}, {411, 341}} @@ -25489,7 +25556,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 - 6601 + 6608 @@ -26296,6 +26363,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 closePasswordSheet: closeSheet: copyCreateTableSyntax: + copyCreateTableSyntaxFromSheet: export: exportMultipleTables: exportTable: @@ -26359,6 +26427,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8 id id id + id diff --git a/Interfaces/English.lproj/Localizable.strings b/Interfaces/English.lproj/Localizable.strings index 79e0428a..f94937b0 100644 Binary files a/Interfaces/English.lproj/Localizable.strings and b/Interfaces/English.lproj/Localizable.strings differ diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index 8ac609b9..4d15823b 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -550,7 +550,7 @@ [contentFilterConjunctionLabel setHidden:(numOfArgs < 2)]; if(numOfArgs > 2) { - [resultingClauseLabel setStringValue:NSLocalizedString(@"Error", @"Error")]; + [resultingClauseLabel setStringValue:NSLocalizedString(@"Error", @"error")]; [resultingClauseContentLabel setStringValue:NSLocalizedString(@"Maximum number of arguments is 2!", @"Maximum number of arguments is 2!")]; } else { [resultingClauseLabel setStringValue:@"SELECT * FROM WHERE"]; diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index c1a430f9..a0fac783 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -946,12 +946,10 @@ - (void)setGrowlEnabled:(BOOL)value { if (value) { - NSRunInformationalAlertPanel( - NSLocalizedString(@"growl_prefs_title", "Title for Growl Notifications Alert Dialog"), - NSLocalizedString(@"growl_prefs_msg", @"Message for Growl Notifications Alert Dialog"), - nil, - nil, - nil + NSBeginInformationalAlertSheet( + NSLocalizedString(@"Growl notification preferences", "Growl notification preferences alert title"), + nil, nil, nil, [self window], self, nil, nil, nil, + NSLocalizedString(@"All Growl notifications are enabled by default. To change which notifications are displayed, go to the Growl Preference Pane in the System Preferences and choose what notifications Growl should display from Sequel Pro.", @"Growl notification preferences alert message") ); } diff --git a/Source/TableDocument.h b/Source/TableDocument.h index 89603085..2741ca7d 100644 --- a/Source/TableDocument.h +++ b/Source/TableDocument.h @@ -188,6 +188,7 @@ enum sp_current_query_mode - (IBAction)flushTable:(id)sender; - (IBAction)checksumTable:(id)sender; - (IBAction)saveCreateSyntax:(id)sender; +- (IBAction)copyCreateTableSyntaxFromSheet:(id)sender; // Other methods - (void) setQueryMode:(int)theQueryMode; diff --git a/Source/TableDocument.m b/Source/TableDocument.m index c685c89b..be05b720 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -1743,6 +1743,27 @@ [panel beginSheetForDirectory:nil file:@"CreateSyntax" modalForWindow:createTableSyntaxWindow modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:@"CreateSyntax"]; } +/** + * Copy the create syntax in the create syntax text view to the pasteboard. + */ +- (IBAction)copyCreateTableSyntaxFromSheet:(id)sender +{ + NSString *createSyntax = [createTableSyntaxTextView string]; + + if ([createSyntax length] > 0) { + // Copy to the clipboard + NSPasteboard *pb = [NSPasteboard generalPasteboard]; + + [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self]; + [pb setString:createSyntax forType:NSStringPboardType]; + + // Table syntax copied Growl notification + [[SPGrowlController sharedGrowlController] notifyWithTitle:@"Syntax Copied" + description:[NSString stringWithFormat:NSLocalizedString(@"Syntax for %@ table copied", @"description for table syntax copied growl notification"), [self table]] + notificationName:@"Syntax Copied"]; + } +} + #pragma mark - #pragma mark Other Methods diff --git a/Source/TableDump.m b/Source/TableDump.m index 3f518214..346ae099 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -735,7 +735,7 @@ // Reset progress interface [errorsView setString:@""]; [singleProgressTitle setStringValue:NSLocalizedString(@"Importing CSV", @"text showing that the application is importing CSV")]; - [singleProgressText setStringValue:NSLocalizedString(@"Reading...", @"text showing that app is reading CSV file")]; + [singleProgressText setStringValue:NSLocalizedString(@"Reading...", @"text showing that app is reading dump")]; [singleProgressBar setIndeterminate:YES]; [singleProgressBar setUsesThreadedAnimation:YES]; [singleProgressBar startAnimation:self]; @@ -1006,7 +1006,7 @@ // Ensure data was provided, or alert than an import error occurred and return false. if (![importData count]) { - NSBeginAlertSheet(NSLocalizedString(@"Error", @"Error"), + NSBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, -- cgit v1.2.3