Skip to content

Commit 506c049

Browse files
committed
[FIX] Delete unused "Remove from Whitelist..." contextual menu item. bug 79.
1 parent b751ddd commit 506c049

File tree

4 files changed

+2
-76
lines changed

4 files changed

+2
-76
lines changed

Plugin/CTFWhitelist.h

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ THE SOFTWARE.
3131
@interface CTFClickToFlashPlugin( Whitelist )
3232

3333
- (IBAction) addToWhitelist: (id) sender;
34-
- (IBAction) removeFromWhitelist: (id) sender;
3534
- (IBAction) editWhitelist: (id) sender;
3635

3736
- (void) _migrateWhitelist;

Plugin/CTFWhitelist.m

-45
Original file line numberDiff line numberDiff line change
@@ -182,23 +182,10 @@ - (void) _addHostToWhitelist
182182
[siteInfo addObject: whitelistItemForSite([self host])];
183183

184184
[[CTFUserDefaultsController standardUserDefaults] setValue:siteInfo forKeyPath:@"values.siteInfo"];
185-
//[values setObject:siteInfo forKey:sHostSiteInfoDefaultsKey];
186-
//[[CTFUserDefaultsController standardUserDefaults] setValues:values];
187185

188186
[[NSNotificationCenter defaultCenter] postNotificationName: sCTFWhitelistAdditionMade object: self];
189187
}
190188

191-
- (void) _removeHostFromWhitelist
192-
{
193-
NSMutableArray *siteInfo = [self _mutableSiteInfo];
194-
NSUInteger foundIndex = indexOfItemForSite(siteInfo, [self host]);
195-
196-
if(foundIndex != NSNotFound) {
197-
[siteInfo removeObjectAtIndex: foundIndex];
198-
[[CTFUserDefaultsController standardUserDefaults] setObject: siteInfo forKey: sHostSiteInfoDefaultsKey];
199-
}
200-
}
201-
202189
- (void) _whitelistAdditionMade: (NSNotification*) notification
203190
{
204191
if ([self _isHostWhitelisted])
@@ -213,38 +200,6 @@ - (IBAction)addToWhitelist:(id)sender;
213200
[self _addHostToWhitelist];
214201
}
215202

216-
- (IBAction) removeFromWhitelist: (id)sender
217-
{
218-
assert(0);
219-
if (![self _isHostWhitelisted])
220-
return;
221-
222-
NSString *title = NSLocalizedString(@"Stop always loading Flash?", @"Stop always loading Flash? alert title");
223-
NSString *message = [NSString stringWithFormat:NSLocalizedString(@"Remove %@ from the whitelist?", @"Remove %@ from the whitelist? alert message"), [self host]];
224-
225-
NSAlert *alert = [[NSAlert alloc] init];
226-
[alert addButtonWithTitle:NSLocalizedString(@"Remove from Whitelist", @"Remove from Whitelist button")];
227-
[alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel button")];
228-
[alert setMessageText:title];
229-
[alert setInformativeText:message];
230-
[alert setAlertStyle:NSInformationalAlertStyle];
231-
[alert beginSheetModalForWindow:[self window]
232-
modalDelegate:self
233-
didEndSelector:@selector(_removeFromWhitelistAlertDidEnd:returnCode:contextInfo:)
234-
contextInfo:nil];
235-
_activeAlert = alert;
236-
}
237-
238-
- (void) _removeFromWhitelistAlertDidEnd: (NSAlert *)alert returnCode: (int)returnCode contextInfo: (void *)contextInfo
239-
{
240-
if (returnCode == NSAlertFirstButtonReturn)
241-
{
242-
[self _removeHostFromWhitelist];
243-
}
244-
245-
[ self _alertDone ];
246-
}
247-
248203
- (IBAction) editWhitelist: (id)sender;
249204
{
250205
[ [ CTFMenubarMenuController sharedController ] showSettingsWindow: self ];

Plugin/English.lproj/ContextualMenu.xib

+2-25
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<string key="IBDocument.HIToolboxVersion">353.00</string>
99
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
1010
<bool key="EncodedWithXMLCoder">YES</bool>
11+
<integer value="1"/>
1112
</object>
1213
<object class="NSArray" key="IBDocument.PluginDependencies">
1314
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -78,14 +79,6 @@
7879
<reference key="NSOnImage" ref="121969399"/>
7980
<reference key="NSMixedImage" ref="575759592"/>
8081
</object>
81-
<object class="NSMenuItem" id="660793203">
82-
<reference key="NSMenu" ref="93442052"/>
83-
<string key="NSTitle">Remove from Whitelist...</string>
84-
<string key="NSKeyEquiv"/>
85-
<int key="NSMnemonicLoc">2147483647</int>
86-
<reference key="NSOnImage" ref="121969399"/>
87-
<reference key="NSMixedImage" ref="575759592"/>
88-
</object>
8982
<object class="NSMenuItem" id="380486120">
9083
<reference key="NSMenu" ref="93442052"/>
9184
<bool key="NSIsDisabled">YES</bool>
@@ -134,14 +127,6 @@
134127
</object>
135128
<int key="connectionID">11</int>
136129
</object>
137-
<object class="IBConnectionRecord">
138-
<object class="IBActionConnection" key="connection">
139-
<string key="label">removeFromWhitelist:</string>
140-
<reference key="source" ref="1001"/>
141-
<reference key="destination" ref="660793203"/>
142-
</object>
143-
<int key="connectionID">13</int>
144-
</object>
145130
<object class="IBConnectionRecord">
146131
<object class="IBActionConnection" key="connection">
147132
<string key="label">addToWhitelist:</string>
@@ -195,7 +180,6 @@
195180
<bool key="EncodedWithXMLCoder">YES</bool>
196181
<reference ref="831790790"/>
197182
<reference ref="975793511"/>
198-
<reference ref="660793203"/>
199183
<reference ref="1001518375"/>
200184
<reference ref="688689086"/>
201185
<reference ref="380486120"/>
@@ -213,11 +197,6 @@
213197
<reference key="object" ref="975793511"/>
214198
<reference key="parent" ref="93442052"/>
215199
</object>
216-
<object class="IBObjectRecord">
217-
<int key="objectID">12</int>
218-
<reference key="object" ref="660793203"/>
219-
<reference key="parent" ref="93442052"/>
220-
</object>
221200
<object class="IBObjectRecord">
222201
<int key="objectID">14</int>
223202
<reference key="object" ref="1001518375"/>
@@ -250,7 +229,6 @@
250229
<string>1.IBEditorWindowLastContentRect</string>
251230
<string>1.IBPluginDependency</string>
252231
<string>10.IBPluginDependency</string>
253-
<string>12.IBPluginDependency</string>
254232
<string>14.IBPluginDependency</string>
255233
<string>16.IBPluginDependency</string>
256234
<string>19.IBPluginDependency</string>
@@ -262,8 +240,7 @@
262240
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
263241
<string>com.apple.InterfaceBuilderKit</string>
264242
<string>com.apple.InterfaceBuilderKit</string>
265-
<string>{{371, 315}, {222, 123}}</string>
266-
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
243+
<string>{{371, 335}, {213, 103}}</string>
267244
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
268245
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
269246
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>

Plugin/Plugin.m

-5
Original file line numberDiff line numberDiff line change
@@ -700,11 +700,6 @@ - (BOOL) validateMenuItem: (NSMenuItem *)menuItem
700700
if ([self _isHostWhitelisted])
701701
enabled = NO;
702702
}
703-
else if (action == @selector(removeFromWhitelist:))
704-
{
705-
if (![self _isHostWhitelisted])
706-
enabled = NO;
707-
}
708703

709704
return enabled;
710705
}

0 commit comments

Comments
 (0)