diff options
author | avenjamin <avenjamin@gmail.com> | 2008-09-06 02:32:38 +0000 |
---|---|---|
committer | avenjamin <avenjamin@gmail.com> | 2008-09-06 02:32:38 +0000 |
commit | bc8c9304e0153a5f888426f3d91fd3baee90714d (patch) | |
tree | 933a1ffdfd7fb971414cb869ceb0ff75ce9b7853 /TableDocument.m | |
parent | 402fee4b8e3c3d6a5ae3ff018df0279edf0b191a (diff) | |
download | sequelpro-bc8c9304e0153a5f888426f3d91fd3baee90714d.tar.gz sequelpro-bc8c9304e0153a5f888426f3d91fd3baee90714d.tar.bz2 sequelpro-bc8c9304e0153a5f888426f3d91fd3baee90714d.zip |
Growl Support Added. Issue #26
• Connected
• Disconnected
• Import Finished
• Export Finished
• Query Finished
• Table Syntax Copied
Diffstat (limited to 'TableDocument.m')
-rw-r--r-- | TableDocument.m | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/TableDocument.m b/TableDocument.m index a8d7d326..fc31049b 100644 --- a/TableDocument.m +++ b/TableDocument.m @@ -32,6 +32,7 @@ #import "TableDump.h" #import "TableStatus.h" #import "ImageAndTextCell.h" +#import <Growl/Growl.h> NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocumentFavoritesControllerSelectionIndexDidChange"; @@ -138,6 +139,18 @@ NSString *TableDocumentFavoritesControllerSelectionIndexDidChange = @"TableDocum [hostField stringValue], [databaseField stringValue]]]; [tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@@%@/%@", mySQLVersion, [userField stringValue], [hostField stringValue], [databaseField stringValue]]]; + + // Connected Growl Notification + [GrowlApplicationBridge notifyWithTitle:@"Connected" + description:[NSString stringWithFormat:NSLocalizedString(@"Connected to %@",@"description for connected growl notification"), [tableWindow title]] + notificationName:@"Connected" + iconData:nil + priority:0 + isSticky:NO + clickContext:nil + ]; + + } else if (code == 2) { //can't connect to host NSBeginAlertSheet(NSLocalizedString(@"Connection failed!", @"connection failed"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, @@ -814,6 +827,16 @@ reused when user hits the close button of the variablseSheet or of the createTab NSPasteboard *pb = [NSPasteboard generalPasteboard]; [pb declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:self]; [pb setString:tableSyntax forType:NSStringPboardType]; + + // Table Syntax Copied Growl Notification + [GrowlApplicationBridge notifyWithTitle:@"Table Syntax Copied" + description:[NSString stringWithFormat:NSLocalizedString(@"Syntax for %@ table copied",@"description for table syntax copied growl notification"), [self table]] + notificationName:@"Table Syntax Copied" + iconData:nil + priority:0 + isSticky:NO + clickContext:nil + ]; } - (IBAction)checkTable:(id)sender @@ -1006,6 +1029,16 @@ shows the mysql variables - (void)closeConnection { [mySQLConnection disconnect]; + + // Disconnected Growl Notification + [GrowlApplicationBridge notifyWithTitle:@"Disconnected" + description:[NSString stringWithFormat:NSLocalizedString(@"Disconnected from %@",@"description for disconnected growl notification"), [tableWindow title]] + notificationName:@"Disconnected" + iconData:nil + priority:0 + isSticky:NO + clickContext:nil + ]; } |