aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-09-09 22:21:33 +0000
committerBibiko <bibiko@eva.mpg.de>2010-09-09 22:21:33 +0000
commit60e9f96d82d7f619883e411a7a37f27c2790c5a0 (patch)
treeb4e8a3c45f1adbcb0bbbaa4f3dc1948a7302836b
parentf86f79972a0960772f46356bb3949757e82f796e (diff)
downloadsequelpro-60e9f96d82d7f619883e411a7a37f27c2790c5a0.tar.gz
sequelpro-60e9f96d82d7f619883e411a7a37f27c2790c5a0.tar.bz2
sequelpro-60e9f96d82d7f619883e411a7a37f27c2790c5a0.zip
• for Structure editing: try to save a row being edited _before_ the row selection will change - mainly if user changes something via mouse event on comboboxes or popupbuttons; if saving fails suppress the new row selection
-rw-r--r--Source/SPTableStructure.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m
index 2b4db263..1d05ba7f 100644
--- a/Source/SPTableStructure.m
+++ b/Source/SPTableStructure.m
@@ -1499,6 +1499,13 @@ would result in a position change.
#pragma mark -
#pragma mark TableView delegate methods
+- (BOOL)tableView:(NSTableView *)aTableView shouldSelectRow:(NSInteger)rowIndex
+{
+ // If we are editing a row, attempt to save that row - if saving failed, do not select the new row.
+ if (isEditingRow && ![self addRowToDB]) return NO;
+ return YES;
+}
+
/**
* Performs various interface validation
*/