aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-01-04 09:29:38 +0000
committerBibiko <bibiko@eva.mpg.de>2010-01-04 09:29:38 +0000
commit25d72032f5f6296c69a5e44fb41ee9bc7942e8ca (patch)
treeb44a6160440ee525c85320de60863e9b59d0f390
parente3d46eb78d4a1ae05780d044ab8c8b875f000d2a (diff)
downloadsequelpro-25d72032f5f6296c69a5e44fb41ee9bc7942e8ca.tar.gz
sequelpro-25d72032f5f6296c69a5e44fb41ee9bc7942e8ca.tar.bz2
sequelpro-25d72032f5f6296c69a5e44fb41ee9bc7942e8ca.zip
• ContentFilterManager
- reimplemented the display of the conjunction label for two arguments - fixed bug while parsing and storing the number of arguments of each filter definition
-rw-r--r--Source/SPContentFilterManager.m2
-rw-r--r--Source/TableContent.m7
2 files changed, 6 insertions, 3 deletions
diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m
index 540000ab..35896fcc 100644
--- a/Source/SPContentFilterManager.m
+++ b/Source/SPContentFilterManager.m
@@ -182,7 +182,7 @@
NSMutableDictionary *d = [[NSMutableDictionary alloc] init];
[d setDictionary:[contentFilters objectAtIndex:i]];
NSMutableArray *conjLabel = [[NSMutableArray alloc] init];
- numOfArgs = [[[contentFilterTextView string] componentsMatchedByRegex:@"(?<!\\\\)(\\$\\{.*?\\})"] count];
+ numOfArgs = [[[d objectForKey:@"Clause"] componentsMatchedByRegex:@"(?<!\\\\)(\\$\\{.*?\\})"] count];
if(numOfArgs > 1) {
if([d objectForKey:@"ConjunctionLabel"]) {
[conjLabel addObject:[d objectForKey:@"ConjunctionLabel"]];
diff --git a/Source/TableContent.m b/Source/TableContent.m
index c4f60029..6b8ecf0e 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -1061,11 +1061,14 @@
NSDictionary *filter = [[contentFilters objectForKey:compareType] objectAtIndex:lastSelectedContentFilterIndex];
NSUInteger numOfArgs = [[filter objectForKey:@"NumberOfArguments"] intValue];
- if ([[filter objectForKey:@"NumberOfArguments"] intValue] == 2) {
+ if (numOfArgs == 2) {
[argumentField setHidden:YES];
- if(numOfArgs == 1)
+ if([filter objectForKey:@"ConjunctionLabels"] && [[filter objectForKey:@"ConjunctionLabels"] count] == 1)
[betweenTextField setStringValue:[[filter objectForKey:@"ConjunctionLabels"] objectAtIndex:0]];
+ else
+ [betweenTextField setStringValue:@""];
+
[betweenTextField setHidden:NO];
[firstBetweenField setHidden:NO];
[secondBetweenField setHidden:NO];