Clean up the sheet for editing popup blocking whitelist. In particular, disable the Add button when the text field is empty.

This commit is contained in:
smfr%smfr.org 2005-01-16 05:27:59 +00:00
parent 642809a403
commit cc4d961414
5 changed files with 13 additions and 3 deletions

View File

@ -28,6 +28,7 @@
CLASS = OrgMozillaChimeraPreferenceWebFeatures;
LANGUAGE = ObjC;
OUTLETS = {
mAddButton = NSButton;
mAddField = NSTextField;
mEditWhitelist = NSButton;
mEnableAnnoyanceBlocker = NSButton;

View File

@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>302 81 356 240 0 0 1600 1002 </string>
<string>67 152 356 240 0 0 1600 1002 </string>
<key>IBFramework Version</key>
<string>364.0</string>
<key>IBGroupedObjects</key>

View File

@ -17,8 +17,10 @@ class nsISupportsArray;
IBOutlet NSButton *mEditWhitelist;
IBOutlet id mWhitelistPanel;
IBOutlet ExtendedTableView* mWhitelistTable;
IBOutlet NSTextField* mAddField;
IBOutlet ExtendedTableView* mWhitelistTable;
IBOutlet NSTextField* mAddField;
IBOutlet NSButton* mAddButton;
nsIPermissionManager* mManager; // STRONG (should be nsCOMPtr)
nsISupportsArray* mCachedPermissions; // parallel list of permissions for speed, STRONG (should be nsCOMPtr)

View File

@ -154,6 +154,8 @@
[mWhitelistTable setDeleteAction:@selector(removeWhitelistSite:)];
[mWhitelistTable setTarget:self];
[mAddButton setEnabled:NO];
// 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,
// it just forgets to tell the scrollbar. *shrug*
@ -254,6 +256,11 @@
return retVal;
}
- (void)controlTextDidChange:(NSNotification*)notification
{
[mAddButton setEnabled:[[mAddField stringValue] length] > 0];
}
//
// clickEnableAnnoyanceBlocker:
//