aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableContent.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-06-15 19:37:25 +0000
committerBibiko <bibiko@eva.mpg.de>2009-06-15 19:37:25 +0000
commit95f796e8c75aeb13f4e1190d9ec08feecc35aba6 (patch)
treed93cc99bcc1ed043c313dcc5188adfe252c1e82f /Source/TableContent.m
parent6f267c8d8f6c12663e16d30f4cd4a1a6677fccd5 (diff)
downloadsequelpro-95f796e8c75aeb13f4e1190d9ec08feecc35aba6.tar.gz
sequelpro-95f796e8c75aeb13f4e1190d9ec08feecc35aba6.tar.bz2
sequelpro-95f796e8c75aeb13f4e1190d9ec08feecc35aba6.zip
• different log message for changing max_allowed_packet for increasing it and for resetting it (a bit more transparent info)
- now also check the delegate if queryGaveError: method is implemented • while adding/updating a row to the db Table Content's pane now indicates that process better via spinning wheel • after TRUNCATE TABLE reload that table content
Diffstat (limited to 'Source/TableContent.m')
-rw-r--r--Source/TableContent.m22
1 files changed, 17 insertions, 5 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m
index bb37b444..dd4f0981 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -1470,11 +1470,13 @@
return YES;
}
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:self];
// If editing, compare the new row to the old row and if they are identical finish editing without saving.
if (!isEditingNewRow && [oldRow isEqualToDictionary:[filteredResult objectAtIndex:currentlyEditingRow]]) {
isEditingRow = NO;
currentlyEditingRow = -1;
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:self];
return YES;
}
@@ -1550,6 +1552,7 @@
isEditingNewRow = NO;
currentlyEditingRow = -1;
[[SPQueryConsole sharedQueryConsole] showErrorInConsole:[NSString stringWithFormat:NSLocalizedString(@"/* WARNING %@ No rows have been affected */\n", @"warning shown in the console when no rows have been affected after writing to the db"), currentTime]];
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:self];
return YES;
// On success...
@@ -1603,12 +1606,16 @@
}
}
currentlyEditingRow = -1;
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:self];
+
return YES;
// Report errors which have occurred
} else {
NSBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), NSLocalizedString(@"Cancel", @"cancel button"), nil, tableWindow, self, @selector(sheetDidEnd:returnCode:contextInfo:), nil, @"addrow",
[NSString stringWithFormat:NSLocalizedString(@"Couldn't write row.\nMySQL said: %@", @"message of panel when error while adding row to db"), [mySQLConnection getLastErrorMessage]]);
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:self];
return NO;
}
}
@@ -2254,28 +2261,31 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn
NSImage *image = nil;
editData = [theValue retain];
- // hide all view in editSheet
+ // hide all views in editSheet
[hexTextView setHidden:YES];
[hexTextScrollView setHidden:YES];
[editImage setHidden:YES];
[editTextView setHidden:YES];
[editTextScrollView setHidden:YES];
+ // Hide QuickLook button and text/iamge/hex control for text data
[editSheetQuickLookButton setHidden:(!isBlob)];
[editSheetSegmentControl setHidden:(!isBlob)];
- // order out editSheet to inform the user that
- // SP is working
+ // order out editSheet to inform the user that SP is working
[NSApp beginSheet:editSheet modalForWindow:tableWindow modalDelegate:self didEndSelector:nil contextInfo:nil];
[editSheetProgressBar startAnimation:self];
if ( [theValue isKindOfClass:[NSData class]] ) {
image = [[[NSImage alloc] initWithData:theValue] autorelease];
+
[hexTextView setString:[self dataToHex:theValue]];
+
stringValue = [[NSString alloc] initWithData:theValue encoding:[mySQLConnection encoding]];
if (stringValue == nil)
stringValue = [[NSString alloc] initWithData:theValue encoding:NSASCIIStringEncoding];
+
[hexTextView setHidden:NO];
[hexTextScrollView setHidden:NO];
[editImage setHidden:YES];
@@ -2283,9 +2293,10 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn
[editTextScrollView setHidden:YES];
[editSheetSegmentControl setSelectedSegment:2];
} else {
- [hexTextView setString:@""];
- // stringValue = [[NSString alloc] initWithString:[theValue description]];
stringValue = [theValue retain];
+
+ [hexTextView setString:@""];
+
[hexTextView setHidden:YES];
[hexTextScrollView setHidden:YES];
[editImage setHidden:YES];
@@ -2296,6 +2307,7 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn
if (image) {
[editImage setImage:image];
+
[hexTextView setHidden:YES];
[hexTextScrollView setHidden:YES];
[editImage setHidden:NO];