aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-02-14 00:05:14 +0000
committerrowanbeentje <rowan@beent.je>2011-02-14 00:05:14 +0000
commitafad99c5e049e30cbe1ac3e9c4dfce7de28501a1 (patch)
treee5e3eb9cfaf7a7e9b60423e706fb25cd9d266f53
parent352d61bb7de20b1aaafddebb9621ea0ef95f8480 (diff)
downloadsequelpro-afad99c5e049e30cbe1ac3e9c4dfce7de28501a1.tar.gz
sequelpro-afad99c5e049e30cbe1ac3e9c4dfce7de28501a1.tar.bz2
sequelpro-afad99c5e049e30cbe1ac3e9c4dfce7de28501a1.zip
- When changing column selections in the filter dropdowns, preserve the filter comparison type if possible
-rw-r--r--Source/SPTableContent.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 7d64ed4b..a513ea15 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -2257,7 +2257,10 @@
return;
}
+ // Retrieve the current field comparison setting for later restoration if possible
+ NSString *titleToRestore = [[compareField selectedItem] title];
+ // Reset the menu before building it back up
[compareField removeAllItems];
NSString *fieldTypeGrouping;
@@ -2378,6 +2381,10 @@
[menu addItem:item];
[item release];
+ // Attempt to reselect the previously selected title, falling back to the first item
+ [compareField selectItemWithTitle:titleToRestore];
+ if (![compareField selectedItem]) [compareField selectItemAtIndex:0];
+
// Update the argumentField enabled state
[self performSelectorOnMainThread:@selector(toggleFilterField:) withObject:self waitUntilDone:YES];