diff --git a/MacPass/ContextBar.xib b/MacPass/ContextBar.xib
index 78855d74..90f4d2d1 100644
--- a/MacPass/ContextBar.xib
+++ b/MacPass/ContextBar.xib
@@ -70,8 +70,8 @@
-
-
+
+
@@ -86,7 +86,10 @@
+
+
+
diff --git a/MacPass/MPContextBarViewController.m b/MacPass/MPContextBarViewController.m
index f8120032..fb5253ba 100644
--- a/MacPass/MPContextBarViewController.m
+++ b/MacPass/MPContextBarViewController.m
@@ -13,12 +13,15 @@
#import "NSButton+HNHTextColor.h"
+NSUInteger const MPContextBarViewControllerActiveFilterMenuItemTag = 1000;
+
typedef NS_ENUM(NSUInteger, MPContextTab) {
MPContextTabFilter,
MPContextTabTrash,
MPContextTabHistory
};
+
@interface MPContextBarViewController () {
@private
BOOL _delegateRespondsToDidChangeFilter;
@@ -232,6 +235,11 @@ typedef NS_ENUM(NSUInteger, MPContextTab) {
- (NSMenu *)_allocFilterMenu {
NSMenu *searchMenu = [[NSMenu alloc] init];
+
+ NSMenuItem *activeFilterItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SEARCH_IN", "") action:NULL keyEquivalent:@""];
+ [activeFilterItem setTag:MPContextBarViewControllerActiveFilterMenuItemTag];
+ [searchMenu addItem:activeFilterItem];
+ [searchMenu addItem:[NSMenuItem separatorItem]];
NSArray *titles = @[NSLocalizedString(@"TITLE", ""),
NSLocalizedString(@"PASSWORD", ""),
@@ -251,7 +259,7 @@ typedef NS_ENUM(NSUInteger, MPContextTab) {
}
[searchMenu addItem:[NSMenuItem separatorItem]];
/* Special Search */
- NSMenuItem *doublePasswordsItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"", "") action:NULL keyEquivalent:@""];
+ NSMenuItem *doublePasswordsItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"DUPLICTE_PASSWORDS", "") action:NULL keyEquivalent:@""];
[doublePasswordsItem setTag:MPFilterDoublePasswords];
[searchMenu addItem:doublePasswordsItem];
@@ -264,9 +272,21 @@ typedef NS_ENUM(NSUInteger, MPContextTab) {
NSArray *allItems = [menu itemArray];
NSArray *enabledItems = [self _filterItemsForMode:self.filterMode];
for(NSMenuItem *item in allItems) {
- BOOL isEnabeld = [enabledItems containsObject:item];
- [item setEnabled:isEnabeld];
+ BOOL isSelected = [enabledItems containsObject:item];
+ [item setState:(isSelected ? NSOnState : NSOffState)];
}
+ NSMenuItem *activeFilterItem = [menu itemWithTag:MPContextBarViewControllerActiveFilterMenuItemTag];
+ __block NSMutableString *activeFilterTitle;
+ [enabledItems enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ if(activeFilterTitle == nil) {
+ activeFilterTitle = [[NSMutableString alloc] initWithString:[obj title]];
+ }
+ else {
+ [activeFilterTitle appendFormat:@", %@", [obj title]];
+ }
+ }];
+ [activeFilterItem setTitle:activeFilterTitle];
+ [self.filterTypePopupButton selectItem:activeFilterItem];
}
- (NSArray *)_filterItemsForMode:(MPFilterMode)mode {
diff --git a/MacPass/en.lproj/Localizable.strings b/MacPass/en.lproj/Localizable.strings
index 76b1f7ef..0b198700 100644
Binary files a/MacPass/en.lproj/Localizable.strings and b/MacPass/en.lproj/Localizable.strings differ