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/AIAccountController.h>
15 #define PRIVACY_SETTINGS [AILocalizedString(@"Privacy Settings","Privacy Settings menu item") stringByAppendingEllipsis]
17 @implementation RAFBlockEditorPlugin
21 //Install the Block menu items
22 blockEditorMenuItem = [[NSMenuItem alloc] initWithTitle:PRIVACY_SETTINGS
24 action:@selector(showEditor:)
26 [blockEditorMenuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask | NSCommandKeyMask)];
27 [[adium menuController] addMenuItem:blockEditorMenuItem toLocation:LOC_Adium_Preferences];
30 - (void)uninstallPlugin
32 [blockEditorMenuItem release];
35 - (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem
39 NSEnumerator *enumerator;
41 enumerator = [[[adium accountController] accounts] objectEnumerator];
42 while ((account = [enumerator nextObject]) && !retVal) {
43 if([[account statusObjectForKey:@"Online"] boolValue] &&
44 [account conformsToProtocol:@protocol(AIAccount_Privacy)])
51 - (IBAction)showEditor:(id)sender
53 [RAFBlockEditorWindowController showWindow];