aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructure.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPTableStructure.m')
-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
*/