aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-03-03 23:39:15 +0000
committerrowanbeentje <rowan@beent.je>2009-03-03 23:39:15 +0000
commitf716a08986866455792ccbb3a7d16c4e72028ade (patch)
treeebaca750fce2911d60f70c8ffdf409a122cff527 /Source/TableDocument.m
parentedd1d6f093a5d6d3301a8f8cade43b051bd69083 (diff)
downloadsequelpro-f716a08986866455792ccbb3a7d16c4e72028ade.tar.gz
sequelpro-f716a08986866455792ccbb3a7d16c4e72028ade.tar.bz2
sequelpro-f716a08986866455792ccbb3a7d16c4e72028ade.zip
- BLOB and binary fields are now fully visible and editable again (fixes Issue #155)
- Added basic support for viewing, filtering, and editing BIT columns (resolves Issue #127 in basic form) - Rewrites selection/save handling. Rows are now only written to database if their content has changed, resolving a long-standing complaint; row selection and editing has also been improved, improving edit/save interaction (fixes Issue #157) and allowing re-editing of the row on failure (fixes Issue #115). Hopefully also addresses #Issue 131, and improves Issue #172. - Hides the console window when the associated document window closes
Diffstat (limited to 'Source/TableDocument.m')
-rw-r--r--Source/TableDocument.m26
1 files changed, 25 insertions, 1 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index f8c6bc73..ea02dd20 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -1159,6 +1159,13 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa
- (IBAction)viewStructure:(id)sender
{
+ // Cancel the selection if currently editing a content row and unable to save
+ if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 1
+ && ![tableContentInstance saveRowOnDeselect]) {
+ [mainToolbar setSelectedItemIdentifier:@"SwitchToTableContentToolbarItemIdentifier"];
+ return;
+ }
+
[tableTabView selectTabViewItemAtIndex:0];
[mainToolbar setSelectedItemIdentifier:@"SwitchToTableStructureToolbarItemIdentifier"];
}
@@ -1171,12 +1178,26 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa
- (IBAction)viewQuery:(id)sender
{
+ // Cancel the selection if currently editing a content row and unable to save
+ if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 1
+ && ![tableContentInstance saveRowOnDeselect]) {
+ [mainToolbar setSelectedItemIdentifier:@"SwitchToTableContentToolbarItemIdentifier"];
+ return;
+ }
+
[tableTabView selectTabViewItemAtIndex:2];
[mainToolbar setSelectedItemIdentifier:@"SwitchToRunQueryToolbarItemIdentifier"];
}
- (IBAction)viewStatus:(id)sender
{
+ // Cancel the selection if currently editing a content row and unable to save
+ if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 1
+ && ![tableContentInstance saveRowOnDeselect]) {
+ [mainToolbar setSelectedItemIdentifier:@"SwitchToTableContentToolbarItemIdentifier"];
+ return;
+ }
+
[tableTabView selectTabViewItemAtIndex:3];
[mainToolbar setSelectedItemIdentifier:@"SwitchToTableStatusToolbarItemIdentifier"];
}
@@ -1432,7 +1453,7 @@ NSString *TableDocumentFavoritesControllerFavoritesDidChange = @"TableDocumentFa
- (void)windowWillClose:(NSNotification *)aNotification
{
if ([mySQLConnection isConnected]) [self closeConnection];
-
+ if ([[queryConsoleInstance window] isVisible]) [self toggleConsole:self];
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
@@ -1571,6 +1592,9 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn
if ( [theValue isKindOfClass:[NSData class]] ) {
theValue = [[NSString alloc] initWithData:theValue encoding:[mySQLConnection encoding]];
+ if (theValue == nil) {
+ [[NSString alloc] initWithData:theValue encoding:NSASCIIStringEncoding];
+ }
}
return theValue;