aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPQueryFavoriteManager.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-09-01 16:07:46 +0000
committerBibiko <bibiko@eva.mpg.de>2009-09-01 16:07:46 +0000
commitc193919cacda828749f7a25cded79bf0ab870190 (patch)
tree73842b7e69420ba130c4ad00fec9ac84aea6cf52 /Source/SPQueryFavoriteManager.m
parentd4c06608e4154e30a9934d1393100c7c84727c64 (diff)
downloadsequelpro-c193919cacda828749f7a25cded79bf0ab870190.tar.gz
sequelpro-c193919cacda828749f7a25cded79bf0ab870190.tar.bz2
sequelpro-c193919cacda828749f7a25cded79bf0ab870190.zip
• fixes for Query Favorite Manager:
- renamed "Save" button to "Apply Changes" to make it clear what will be done by clicking at it - suppress context menu and selection while right-clicking at a header - while in cell editing ESC will abort the editing (not close the sheet)
Diffstat (limited to 'Source/SPQueryFavoriteManager.m')
-rw-r--r--Source/SPQueryFavoriteManager.m22
1 files changed, 20 insertions, 2 deletions
diff --git a/Source/SPQueryFavoriteManager.m b/Source/SPQueryFavoriteManager.m
index e49dbb13..5ad6644d 100644
--- a/Source/SPQueryFavoriteManager.m
+++ b/Source/SPQueryFavoriteManager.m
@@ -303,6 +303,13 @@
- (IBAction)closeQueryManagerSheet:(id)sender
{
+ // First check for ESC if pressed while inline editing
+ if(![sender tag] && isTableCellEditing) {
+ [favoritesTableView abortEditing];
+ isTableCellEditing = NO;
+ return;
+ }
+
[NSApp endSheet:[self window] returnCode:0];
[[self window] orderOut:self];
@@ -485,7 +492,12 @@
*/
- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
{
- return ([[favoriteProperties objectAtIndex:rowIndex] intValue] == SP_FAVORITETYPE_HEADER) ? NO : YES;
+ if([[favoriteProperties objectAtIndex:rowIndex] intValue] == SP_FAVORITETYPE_HEADER) {
+ return NO;
+ } else {
+ isTableCellEditing = YES;
+ return YES;
+ }
}
/*
@@ -495,7 +507,13 @@
{
return ([[favoriteProperties objectAtIndex:rowIndex] intValue] == SP_FAVORITETYPE_HEADER) ? YES : NO;
}
-
+/*
+ * Detect if inline editing was done - then ESC to close the sheet will be activate
+ */
+- (void)controlTextDidEndEditing:(NSNotification *)aNotification
+{
+ isTableCellEditing = NO;
+}
/*
* Changes in the name text field will be saved in data source directly
* to update the table view accordingly