From 60e9f96d82d7f619883e411a7a37f27c2790c5a0 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 9 Sep 2010 22:21:33 +0000 Subject: =?UTF-8?q?=E2=80=A2=20for=20Structure=20editing:=20try=20to=20sav?= =?UTF-8?q?e=20a=20row=20being=20edited=20=5Fbefore=5F=20the=20row=20selec?= =?UTF-8?q?tion=20will=20change=20-=20mainly=20if=20user=20changes=20somet?= =?UTF-8?q?hing=20via=20mouse=20event=20on=20comboboxes=20or=20popupbutton?= =?UTF-8?q?s;=20if=20saving=20fails=20suppress=20the=20new=20row=20selecti?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPTableStructure.m | 7 +++++++ 1 file changed, 7 insertions(+) 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 */ -- cgit v1.2.3