Browse files

[FIX] Delete unused "Remove from Whitelist..." contextual menu item. …

…bug 79.
  • Loading branch information...
1 parent b751ddd commit 506c049859d0aa78896e0ebcda2aaf1abab7a934 @rentzsch committed Jul 19, 2009
Showing with 2 additions and 76 deletions.
  1. +0 −1 Plugin/CTFWhitelist.h
  2. +0 −45 Plugin/CTFWhitelist.m
  3. +2 −25 Plugin/English.lproj/ContextualMenu.xib
  4. +0 −5 Plugin/Plugin.m
View
1 Plugin/CTFWhitelist.h
@@ -31,7 +31,6 @@ THE SOFTWARE.
@interface CTFClickToFlashPlugin( Whitelist )
- (IBAction) addToWhitelist: (id) sender;
-- (IBAction) removeFromWhitelist: (id) sender;
- (IBAction) editWhitelist: (id) sender;
- (void) _migrateWhitelist;
View
45 Plugin/CTFWhitelist.m
@@ -182,23 +182,10 @@ - (void) _addHostToWhitelist
[siteInfo addObject: whitelistItemForSite([self host])];
[[CTFUserDefaultsController standardUserDefaults] setValue:siteInfo forKeyPath:@"values.siteInfo"];
- //[values setObject:siteInfo forKey:sHostSiteInfoDefaultsKey];
- //[[CTFUserDefaultsController standardUserDefaults] setValues:values];
[[NSNotificationCenter defaultCenter] postNotificationName: sCTFWhitelistAdditionMade object: self];
}
-- (void) _removeHostFromWhitelist
-{
- NSMutableArray *siteInfo = [self _mutableSiteInfo];
- NSUInteger foundIndex = indexOfItemForSite(siteInfo, [self host]);
-
- if(foundIndex != NSNotFound) {
- [siteInfo removeObjectAtIndex: foundIndex];
- [[CTFUserDefaultsController standardUserDefaults] setObject: siteInfo forKey: sHostSiteInfoDefaultsKey];
- }
-}
-
- (void) _whitelistAdditionMade: (NSNotification*) notification
{
if ([self _isHostWhitelisted])
@@ -213,38 +200,6 @@ - (IBAction)addToWhitelist:(id)sender;
[self _addHostToWhitelist];
}
-- (IBAction) removeFromWhitelist: (id)sender
-{
- assert(0);
- if (![self _isHostWhitelisted])
- return;
-
- NSString *title = NSLocalizedString(@"Stop always loading Flash?", @"Stop always loading Flash? alert title");
- NSString *message = [NSString stringWithFormat:NSLocalizedString(@"Remove %@ from the whitelist?", @"Remove %@ from the whitelist? alert message"), [self host]];
-
- NSAlert *alert = [[NSAlert alloc] init];
- [alert addButtonWithTitle:NSLocalizedString(@"Remove from Whitelist", @"Remove from Whitelist button")];
- [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel button")];
- [alert setMessageText:title];
- [alert setInformativeText:message];
- [alert setAlertStyle:NSInformationalAlertStyle];
- [alert beginSheetModalForWindow:[self window]
- modalDelegate:self
- didEndSelector:@selector(_removeFromWhitelistAlertDidEnd:returnCode:contextInfo:)
- contextInfo:nil];
- _activeAlert = alert;
-}
-
-- (void) _removeFromWhitelistAlertDidEnd: (NSAlert *)alert returnCode: (int)returnCode contextInfo: (void *)contextInfo
-{
- if (returnCode == NSAlertFirstButtonReturn)
- {
- [self _removeHostFromWhitelist];
- }
-
- [ self _alertDone ];
-}
-
- (IBAction) editWhitelist: (id)sender;
{
[ [ CTFMenubarMenuController sharedController ] showSettingsWindow: self ];
View
27 Plugin/English.lproj/ContextualMenu.xib
@@ -8,6 +8,7 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -78,14 +79,6 @@
<reference key="NSOnImage" ref="121969399"/>
<reference key="NSMixedImage" ref="575759592"/>
</object>
- <object class="NSMenuItem" id="660793203">
- <reference key="NSMenu" ref="93442052"/>
- <string key="NSTitle">Remove from Whitelist...</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="121969399"/>
- <reference key="NSMixedImage" ref="575759592"/>
- </object>
<object class="NSMenuItem" id="380486120">
<reference key="NSMenu" ref="93442052"/>
<bool key="NSIsDisabled">YES</bool>
@@ -136,14 +129,6 @@
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
- <string key="label">removeFromWhitelist:</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="660793203"/>
- </object>
- <int key="connectionID">13</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
<string key="label">addToWhitelist:</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="1001518375"/>
@@ -195,7 +180,6 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="831790790"/>
<reference ref="975793511"/>
- <reference ref="660793203"/>
<reference ref="1001518375"/>
<reference ref="688689086"/>
<reference ref="380486120"/>
@@ -214,11 +198,6 @@
<reference key="parent" ref="93442052"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">12</int>
- <reference key="object" ref="660793203"/>
- <reference key="parent" ref="93442052"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">14</int>
<reference key="object" ref="1001518375"/>
<reference key="parent" ref="93442052"/>
@@ -250,7 +229,6 @@
<string>1.IBEditorWindowLastContentRect</string>
<string>1.IBPluginDependency</string>
<string>10.IBPluginDependency</string>
- <string>12.IBPluginDependency</string>
<string>14.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
@@ -262,8 +240,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilderKit</string>
<string>com.apple.InterfaceBuilderKit</string>
- <string>{{371, 315}, {222, 123}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{371, 335}, {213, 103}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
View
5 Plugin/Plugin.m
@@ -700,11 +700,6 @@ - (BOOL) validateMenuItem: (NSMenuItem *)menuItem
if ([self _isHostWhitelisted])
enabled = NO;
}
- else if (action == @selector(removeFromWhitelist:))
- {
- if (![self _isHostWhitelisted])
- enabled = NO;
- }
return enabled;
}

0 comments on commit 506c049

Please sign in to comment.