diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-08-23 21:10:25 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-08-23 21:10:25 +0000 |
commit | 528324fa17bb76bf590cfc17c9b436de660d5ed3 (patch) | |
tree | 78f805bc7a6a0c7c0ac519eca7a18d6b4628cd5c /Source/TableContent.m | |
parent | 565b2a5da5e126b204b7733259aa4b4b65da21e3 (diff) | |
download | sequelpro-528324fa17bb76bf590cfc17c9b436de660d5ed3.tar.gz sequelpro-528324fa17bb76bf590cfc17c9b436de660d5ed3.tar.bz2 sequelpro-528324fa17bb76bf590cfc17c9b436de660d5ed3.zip |
• further improvements to open/save spf files
- rearrange invoking procedure for spf data if SP asks for passwords
• fine-tuned and fixed table history for BETWEEN operator
Diffstat (limited to 'Source/TableContent.m')
-rw-r--r-- | Source/TableContent.m | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m index ca8a3ea5..3d737de5 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -324,10 +324,15 @@ || [compareField itemWithTitle:filterComparisonToRestore])) { if (filterComparisonToRestore) [compareField selectItemWithTitle:filterComparisonToRestore]; + if([filterComparisonToRestore isEqualToString:@"BETWEEN"]) { + [argumentField setHidden:YES]; + if (firstBetweenValueToRestore) [firstBetweenField setStringValue:firstBetweenValueToRestore]; + if (secondBetweenValueToRestore) [secondBetweenField setStringValue:secondBetweenValueToRestore]; + } else { + if (filterValueToRestore) [argumentField setStringValue:filterValueToRestore]; + } [self toggleFilterField:self]; - if (filterValueToRestore) [argumentField setStringValue:filterValueToRestore]; - if (firstBetweenValueToRestore) [firstBetweenField setStringValue:firstBetweenValueToRestore]; - if (secondBetweenValueToRestore) [secondBetweenField setStringValue:secondBetweenValueToRestore]; + } } @@ -1749,7 +1754,7 @@ [[compareField selectedItem] title], @"filterComparison", [NSNumber numberWithInt:[[compareField selectedItem] tag]], @"filterComparisonTag", [argumentField stringValue], @"filterValue", - [firstBetweenField stringValue], @"firstBetweenValue", + [firstBetweenField stringValue], @"firstBetweenField", [secondBetweenField stringValue], @"secondBetweenField", nil]; @@ -1809,14 +1814,28 @@ if (filterSettings) { if ([filterSettings objectForKey:@"filterField"]) filterFieldToRestore = [[NSString alloc] initWithString:[filterSettings objectForKey:@"filterField"]]; - if ([filterSettings objectForKey:@"filterComparison"]) + if ([filterSettings objectForKey:@"filterComparison"]) { + // Check if operator is BETWEEN, if so set up input fields + if([[filterSettings objectForKey:@"filterComparison"] isEqualToString:@"BETWEEN"]) { + [argumentField setHidden:YES]; + [betweenTextField setHidden:NO]; + [firstBetweenField setHidden:NO]; + [secondBetweenField setHidden:NO]; + [firstBetweenField setEnabled:YES]; + [secondBetweenField setEnabled:YES]; + } + filterComparisonToRestore = [[NSString alloc] initWithString:[filterSettings objectForKey:@"filterComparison"]]; - if ([filterSettings objectForKey:@"filterValue"]) - filterValueToRestore = [[NSString alloc] initWithString:[filterSettings objectForKey:@"filterValue"]]; - if ([filterSettings objectForKey:@"firstBetweenField"]) - firstBetweenValueToRestore = [[NSString alloc] initWithString:[filterSettings objectForKey:@"firstBetweenField"]]; - if ([filterSettings objectForKey:@"secondBetweenField"]) - secondBetweenValueToRestore = [[NSString alloc] initWithString:[filterSettings objectForKey:@"secondBetweenField"]]; + } + if([[filterSettings objectForKey:@"filterComparison"] isEqualToString:@"BETWEEN"]) { + if ([filterSettings objectForKey:@"firstBetweenField"]) + firstBetweenValueToRestore = [[NSString alloc] initWithString:[filterSettings objectForKey:@"firstBetweenField"]]; + if ([filterSettings objectForKey:@"secondBetweenField"]) + secondBetweenValueToRestore = [[NSString alloc] initWithString:[filterSettings objectForKey:@"secondBetweenField"]]; + } else { + if ([filterSettings objectForKey:@"filterValue"]) + filterValueToRestore = [[NSString alloc] initWithString:[filterSettings objectForKey:@"filterValue"]]; + } } } |