2 // RAFBlockEditorPlugin.m
5 // Created by Augie Fackler on 5/26/05.
6 // Copyright 2006 The Adium Team. All rights reserved.
9 #import "RAFBlockEditorPlugin.h"
10 #import <AIUtilities/AIMenuAdditions.h>
11 #import <AIUtilities/AIStringAdditions.h>
12 #import <Adium/AIAccount.h>
13 #import <Adium/AIAccountControllerProtocol.h>
15 @implementation RAFBlockEditorPlugin
19 //Install the Block menu items
20 blockEditorMenuItem = [[NSMenuItem alloc] initWithTitle:[AILocalizedString(@"Privacy Settings", nil) stringByAppendingEllipsis]
22 action:@selector(showEditor:)
24 [blockEditorMenuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask | NSCommandKeyMask)];
25 [[adium menuController] addMenuItem:blockEditorMenuItem toLocation:LOC_Adium_Preferences];
28 - (void)uninstallPlugin
30 [blockEditorMenuItem release];
33 - (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem
37 NSEnumerator *enumerator;
39 enumerator = [[[adium accountController] accounts] objectEnumerator];
40 while ((account = [enumerator nextObject]) && !retVal) {
41 if([[account statusObjectForKey:@"Online"] boolValue] &&
42 [account conformsToProtocol:@protocol(AIAccount_Privacy)])
49 - (IBAction)showEditor:(id)sender
51 [RAFBlockEditorWindowController showWindow];