diff --git a/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/classes.nib b/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/classes.nib index 55409e4edba..f16e5aaf69d 100644 --- a/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/classes.nib +++ b/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/classes.nib @@ -1,5 +1,6 @@ { IBClasses = ( + {CLASS = CookieDateFormatter; LANGUAGE = ObjC; SUPERCLASS = NSDateFormatter; }, {CLASS = ExtendedTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, { @@ -18,14 +19,15 @@ ACTIONS = { blockCookiesFromSites = id; clickAskAboutCookies = id; - clickAutoFillPasswords = id; clickCookieBehavior = id; clickStorePasswords = id; + cookieFilterChanged = id; editCookies = id; editCookiesDone = id; editPermissions = id; editPermissionsDone = id; launchKeychainAccess = id; + permissionFilterChanged = id; removeAllCookiePermissions = id; removeAllCookies = id; removeCookiePermissions = id; @@ -37,11 +39,11 @@ OUTLETS = { mAskAboutCookies = NSButton; mCookieBehavior = NSMatrix; - mCookiesFilterField = SearchTextField; + mCookiesFilterField = NSSearchField; mCookiesPanel = id; mCookiesTable = ExtendedTableView; mPermissionColumn = NSTableColumn; - mPermissionFilterField = SearchTextField; + mPermissionFilterField = NSSearchField; mPermissionsPanel = id; mPermissionsTable = ExtendedTableView; mStorePasswords = NSButton; diff --git a/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/info.nib b/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/info.nib index 4fb16f82a93..f40c58a1864 100644 --- a/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/info.nib +++ b/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/info.nib @@ -13,12 +13,13 @@ IBFramework Version 446.1 + IBOldestOS + 3 IBOpenObjects - 401 5 IBSystem Version - 8J135 + 8R2232 diff --git a/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/keyedobjects.nib b/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/keyedobjects.nib index d2227669455..1c9c84730c5 100644 Binary files a/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/keyedobjects.nib and b/mozilla/camino/PreferencePanes/Privacy/English.lproj/Privacy.nib/keyedobjects.nib differ diff --git a/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.h b/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.h index e05f0edbaea..ae2dc529176 100644 --- a/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.h +++ b/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.h @@ -42,9 +42,6 @@ #import "nsCOMArray.h" -#import "ExtendedTableView.h" -#import "SearchTextField.h" - class nsIPref; class nsIPermissionManager; class nsIPermission; @@ -84,14 +81,14 @@ typedef enum ECookiePolicyPopupIndex IBOutlet id mPermissionsPanel; IBOutlet ExtendedTableView* mPermissionsTable; IBOutlet NSTableColumn* mPermissionColumn; - IBOutlet SearchTextField* mPermissionFilterField; + IBOutlet NSSearchField* mPermissionFilterField; nsIPermissionManager* mPermissionManager; // STRONG (should be nsCOMPtr) nsCOMArray* mCachedPermissions; // parallel list for speed, STRONG // cookie sheet IBOutlet id mCookiesPanel; IBOutlet ExtendedTableView* mCookiesTable; - IBOutlet SearchTextField* mCookiesFilterField; + IBOutlet NSSearchField* mCookiesFilterField; nsICookieManager* mCookieManager; nsCOMArray* mCachedCookies; } @@ -133,7 +130,9 @@ typedef enum ECookiePolicyPopupIndex - (void)sortCookiesByColumn:(NSTableColumn *)aTableColumn inAscendingOrder:(BOOL)ascending; - (void)sortPermissionsByColumn:(NSTableColumn *)aTableColumn inAscendingOrder:(BOOL)ascending; - //filtering methods +// filtering methods +- (IBAction)cookieFilterChanged:(id)sender; +- (IBAction)permissionFilterChanged:(id)sender; - (void) filterCookiesPermissionsWithString: (NSString*) inFilterString; - (void) filterCookiesWithString: (NSString*) inFilterString; @end diff --git a/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm b/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm index 11c7efcface..b1f851e0dad 100644 --- a/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm +++ b/mozilla/camino/PreferencePanes/Privacy/PrivacyPane.mm @@ -39,6 +39,7 @@ #import "NSString+Utils.h" #import "NSArray+Utils.h" +#import "ExtendedTableView.h" #include "nsCOMPtr.h" #include "nsServiceManagerUtils.h" @@ -59,8 +60,6 @@ // but that requires linkage and extra search paths. static NSString* XPCOMShutDownNotificationName = @"XPCOMShutDown"; -#import "ExtendedTableView.h" - // prefs for keychain password autofill static const char* const gUseKeychainPref = "chimera.store_passwords_with_keychain"; @@ -282,12 +281,8 @@ PR_STATIC_CALLBACK(int) compareValues(nsICookie* aCookie1, nsICookie* aCookie2, [popupButtonCell setEditable:YES]; [popupButtonCell addItemsWithTitles:[NSArray arrayWithObjects:[self getLocalizedString:@"Allow"], [self getLocalizedString:@"Allow for Session"], - [self getLocalizedString:@"Deny"], - nil]]; - - //remove the popup from the filter input fields - [[mPermissionFilterField cell] setHasPopUpButton: NO]; - [[mCookiesFilterField cell] setHasPopUpButton: NO]; + [self getLocalizedString:@"Deny"], + nil]]; } -(void) mapCookiePrefToGUI:(int)pref @@ -359,7 +354,7 @@ PR_STATIC_CALLBACK(int) compareValues(nsICookie* aCookie1, nsICookie* aCookie2, } //clear the filter field - [mCookiesFilterField setStringValue: @""]; + [mCookiesFilterField setStringValue:@""]; // we shouldn't need to do this, but the scrollbar won't enable unless we // force the table to reload its data. Oddly it gets the number of rows correct, @@ -553,7 +548,7 @@ PR_STATIC_CALLBACK(int) compareValues(nsICookie* aCookie1, nsICookie* aCookie2, [mPermissionsTable setUsesAlternatingRowBackgroundColors:YES]; //clear the filter field - [mPermissionFilterField setStringValue: @""]; + [mPermissionFilterField setStringValue:@""]; // we shouldn't need to do this, but the scrollbar won't enable unless we // force the table to reload its data. Oddly it gets the number of rows correct, @@ -960,32 +955,56 @@ PR_STATIC_CALLBACK(int) compareValues(nsICookie* aCookie1, nsICookie* aCookie2, } } -- (void)controlTextDidChange:(NSNotification *)aNotification -{ - NSString *filterString = [[aNotification object] stringValue]; +// Delegate method for the filter search fields. Watches for an Enter or +// Return in the filter, and passes it off to the sheet to trigger the default +// button to dismiss the sheet. +- (void)controlTextDidEndEditing:(NSNotification *)aNotification { + id source = [aNotification object]; + if (!(source == mCookiesFilterField || source == mPermissionFilterField)) + return; - // find out if we are filtering the permission or the cookies - if (([aNotification object] == mPermissionFilterField) && mCachedPermissions && mPermissionManager) { - // the user wants to filter down the list of cookies. Reinitialize the list of permission in case - // they deleted or replaced a letter. - [self filterCookiesPermissionsWithString:filterString]; - // re-sort - [self sortPermissionsByColumn:[mPermissionsTable highlightedTableColumn] inAscendingOrder:mSortedAscending]; - - [mPermissionsTable deselectAll: self]; // don't want any traces of previous selection - [mPermissionsTable reloadData]; - } - else if (([aNotification object] == mCookiesFilterField) && mCachedCookies && mCookieManager) { - // reinitialize the list of cookies in case user deleted a letter or replaced a letter - [self filterCookiesWithString:filterString]; - // re-sort - [self sortCookiesByColumn:[mCookiesTable highlightedTableColumn] inAscendingOrder:mSortedAscending]; - - [mCookiesTable deselectAll: self]; // don't want any traces of previous selection - [mCookiesTable reloadData]; + NSEvent* currentEvent = [NSApp currentEvent]; + if (([currentEvent type] == NSKeyDown) && [[currentEvent characters] length] > 0) { + unichar character = [[currentEvent characters] characterAtIndex:0]; + if ((character == NSCarriageReturnCharacter) || (character == NSEnterCharacter)) { + if (source == mCookiesFilterField) + [mCookiesPanel performKeyEquivalent:currentEvent]; + else + [mPermissionsPanel performKeyEquivalent:currentEvent]; + } } } +- (IBAction)cookieFilterChanged:(id)sender +{ + if (!mCachedCookies || !mCookieManager) + return; + + NSString* filterString = [sender stringValue]; + + // reinitialize the list of cookies in case user deleted or replaced a letter + [self filterCookiesWithString:filterString]; + // re-sort + [self sortCookiesByColumn:[mCookiesTable highlightedTableColumn] inAscendingOrder:mSortedAscending]; + [mCookiesTable deselectAll:self]; // don't want any traces of previous selection + [mCookiesTable reloadData]; +} + +- (IBAction)permissionFilterChanged:(id)sender +{ + if (!mCachedPermissions || !mPermissionManager) + return; + + NSString* filterString = [sender stringValue]; + + // reinitialize the list of permission in case user deleted or replaced a letter. + [self filterCookiesPermissionsWithString:filterString]; + // re-sort + [self sortPermissionsByColumn:[mPermissionsTable highlightedTableColumn] inAscendingOrder:mSortedAscending]; + [mPermissionsTable deselectAll:self]; // don't want any traces of previous selection + [mPermissionsTable reloadData]; +} + - (void) filterCookiesPermissionsWithString: (NSString*) inFilterString { // the user wants to filter down the list of cookies. Reinitialize the list of permission in case