diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPContentFilterManager.m | 20 | ||||
-rw-r--r-- | Source/SPTableContent.m | 2 |
2 files changed, 18 insertions, 4 deletions
diff --git a/Source/SPContentFilterManager.m b/Source/SPContentFilterManager.m index cf12ebe0..a0755b92 100644 --- a/Source/SPContentFilterManager.m +++ b/Source/SPContentFilterManager.m @@ -35,6 +35,7 @@ #import "RegexKitLite.h" #import "SPQueryController.h" #import "SPQueryDocumentsController.h" +#import "SPDatabaseDocument.h" #import "SPTableContent.h" #import "SPConnectionController.h" #import "SPSplitView.h" @@ -246,12 +247,25 @@ else filter = [NSMutableDictionary dictionaryWithObjects:[NSArray arrayWithObjects:NSLocalizedString(@"New Filter",@"Content Filter Manager : Initial name for new filter"), @"", @"", nil] forKeys:[NSArray arrayWithObjects:@"MenuLabel", @"Clause", @"ConjunctionLabel", nil]]; - if([contentFilterTableView numberOfSelectedRows] > 0) { + // If a favourite is currently selected, add the new favourite next to it + if ([contentFilterTableView numberOfSelectedRows] > 0) { insertIndex = [[contentFilterTableView selectedRowIndexes] lastIndex]+1; [contentFilters insertObject:filter atIndex:insertIndex]; - } else { - [contentFilters addObject:filter]; + } + + // If the DatabaseDocument is an on-disk document, add the favourite to the bottom of that document's favourites + else if (![tableDocumentInstance isUntitled]) { insertIndex = [contentFilters count] - 1; + [contentFilters addObject:filter]; + } + + // Otherwise, add to the bottom of the Global list by default + else { + insertIndex = 1; + while (![[contentFilters objectAtIndex:insertIndex] objectForKey:@"headerOfFileURL"]) { + insertIndex++; + } + [contentFilters insertObject:filter atIndex:insertIndex]; } [contentFilterArrayController rearrangeObjects]; diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index dceea288..71657916 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -444,7 +444,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper [fieldField addItemWithTitle:NSLocalizedString(@"field", @"popup menuitem for field (showing only if disabled)")]; [compareField setEnabled:NO]; [compareField removeAllItems]; - [compareField addItemWithTitle:NSLocalizedString(@"is", @"popup menuitem for field IS value")]; + [compareField addItemWithTitle:@"="]; [argumentField setHidden:NO]; [argumentField setEnabled:NO]; [firstBetweenField setEnabled:NO]; |