aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPHistoryController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-10-01 16:35:44 +0000
committerBibiko <bibiko@eva.mpg.de>2009-10-01 16:35:44 +0000
commitcf243d99127441ce2fd3b4641427cb49ab155402 (patch)
treef06c68cc3abfe7e5fb0695b4203a683147ab83b3 /Source/SPHistoryController.m
parent11c7eea329acef790b667a27312a09528364140c (diff)
downloadsequelpro-cf243d99127441ce2fd3b4641427cb49ab155402.tar.gz
sequelpro-cf243d99127441ce2fd3b4641427cb49ab155402.tar.bz2
sequelpro-cf243d99127441ce2fd3b4641427cb49ab155402.zip
• first implementation of a Content Filter Editor
- user-defined content filter can be saved globally (Prefs) or in SPF files - BETA - further tests are needed due to complexity - SPQueryController now handles the local user-defined content filters - tooltips are now generated automatically if not defined explicitly (incl. if $BINARY placeholder was used) • if user added local query favorites or content filters to an Untitled document and s/he wants to close it the standard sheet will be displayed (Don't Save - Cancel - Save) - due to that changed old [TableDocument displayName] to 'displaySPName' to be conform with Cocoa • changed behavior while importing query favorites - now they will append at the list (not inserted after selected row - makes more sense) • introduced to history filter dict the key 'menuLabel' which will be set to [TableContent tableFilterString] for displaying the history menu title and simplified the SPHistoryController logic for that • minor code changes
Diffstat (limited to 'Source/SPHistoryController.m')
-rw-r--r--Source/SPHistoryController.m23
1 files changed, 3 insertions, 20 deletions
diff --git a/Source/SPHistoryController.m b/Source/SPHistoryController.m
index 9277a64b..8dc716fc 100644
--- a/Source/SPHistoryController.m
+++ b/Source/SPHistoryController.m
@@ -396,26 +396,9 @@
NSDictionary *filterSettings = [theEntry objectForKey:@"contentFilter"];
if (![filterSettings objectForKey:@"filterField"]) return theName;
- if ([[filterSettings objectForKey:@"filterComparison"] isEqualToString:@"IS NULL"]
- || [[filterSettings objectForKey:@"filterComparison"] isEqualToString:@"IS NOT NULL"])
- {
- [theName appendFormat:@" (%@ %@ %@)", NSLocalizedString(@"Filtered by", @"History item filtered by label"),
- [filterSettings objectForKey:@"filterField"], [filterSettings objectForKey:@"filterComparison"]];
- } else if ([[filterSettings objectForKey:@"filterComparison"] isEqualToString:@"BETWEEN"]
- && [filterSettings objectForKey:@"firstBetweenField"]
- && [[filterSettings objectForKey:@"secondBetweenField"] length]
- && [filterSettings objectForKey:@"firstBetweenField"]
- && [[filterSettings objectForKey:@"secondBetweenField"] length])
- {
- [theName appendFormat:NSLocalizedString(@" (Filtered by %@ between %@ and %@)", @"History item filtered between values label"),
- [filterSettings objectForKey:@"filterField"],
- [filterSettings objectForKey:@"firstBetweenField"],
- [filterSettings objectForKey:@"secondBetweenField"]];
- } else if ([filterSettings objectForKey:@"filterValue"] && [[filterSettings objectForKey:@"filterValue"] length]) {
- [theName appendFormat:@" (%@ %@ %@ %@)", NSLocalizedString(@"Filtered by", @"History item filtered by label"),
- [filterSettings objectForKey:@"filterField"], [filterSettings objectForKey:@"filterComparison"],
- [filterSettings objectForKey:@"filterValue"]];
- }
+ if([filterSettings objectForKey:@"menuLabel"])
+ return [NSString stringWithFormat:NSLocalizedString(@"%@ (Filtered by %@)", @"History item filtered by values label"),
+ theName, [filterSettings objectForKey:@"menuLabel"]];
return theName;
}