aboutsummaryrefslogtreecommitdiffstats
path: root/TableSource.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2008-11-18 01:46:48 +0000
committerrowanbeentje <rowan@beent.je>2008-11-18 01:46:48 +0000
commit862396873ddb3d4017a5ab323ae0be6bded755b8 (patch)
tree3a956b9e124e6f987c2e57435c097ae3a9a4f97f /TableSource.m
parent4db467b061a83103c78cef1d86405f92e2b13ce2 (diff)
downloadsequelpro-862396873ddb3d4017a5ab323ae0be6bded755b8.tar.gz
sequelpro-862396873ddb3d4017a5ab323ae0be6bded755b8.tar.bz2
sequelpro-862396873ddb3d4017a5ab323ae0be6bded755b8.zip
Add support for marking the content for a required refresh on structure changes. Implemented by adding a method to TablesList (setContentRequiresReload) and using it when modifying the tble structure, thus only refreshing if the content is actually viewed again.
Diffstat (limited to 'TableSource.m')
-rw-r--r--TableSource.m13
1 files changed, 13 insertions, 0 deletions
diff --git a/TableSource.m b/TableSource.m
index d43b83c5..9259a0b4 100644
--- a/TableSource.m
+++ b/TableSource.m
@@ -383,6 +383,9 @@ opens alertsheet and asks for confirmation
[tableType retain];
// [[NSNotificationCenter defaultCenter] postNotificationName:@"SelectedTableStatusHasChanged" object:self];
+
+ // Mark the content table for refresh
+ [tablesListInstance setContentRequiresReload];
} else {
[sender selectItemWithTitle:tableType];
NSBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, nil,
@@ -642,6 +645,10 @@ returns YES if no row is beeing edited and nothing has to be written to db
isEditingRow = NO;
isEditingNewRow = NO;
[self loadTable:selectedTable];
+
+ // Mark the content table for refresh
+ [tablesListInstance setContentRequiresReload];
+
return YES;
} else {
alertSheetOpened = YES;
@@ -694,6 +701,9 @@ returns YES if no row is beeing edited and nothing has to be written to db
if ( [[mySQLConnection getLastErrorMessage] isEqualToString:@""] ) {
[self loadTable:selectedTable];
+
+ // Mark the content table for refresh
+ [tablesListInstance setContentRequiresReload];
} else {
NSBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, tableWindow, self, nil, nil, nil,
[NSString stringWithFormat:NSLocalizedString(@"Couldn't remove field %@.\nMySQL said: %@", @"message of panel when field cannot be removed"),
@@ -913,6 +923,9 @@ Having validated a drop, perform the field/column reordering to match.
[[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:self];
+ // Mark the content table for refresh
+ [tablesListInstance setContentRequiresReload];
+
return YES;
}