2 * Adium is the legal property of its developers, whose names are listed in the copyright file included
3 * with this source distribution.
5 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
6 * General Public License as published by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
10 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11 * Public License for more details.
13 * You should have received a copy of the GNU General Public License along with this program; if not,
14 * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 #import "AIAccountController.h"
18 #import "AIAccountMenuAccessPlugin.h"
19 #import "AIMenuController.h"
22 * @class AIAccountMenuAccessPlugin
23 * @brief Provide menu access to account connection/disconnect
25 @implementation AIAccountMenuAccessPlugin
28 * @brief Install the plugin
32 //Wait for Adium to finish launching so status icons, etc. are ready and we aren't forced to immediately rebuild.
33 [[adium notificationCenter] addObserver:self
34 selector:@selector(adiumFinishedLaunching:)
35 name:Adium_CompletedApplicationLoad
44 [[adium notificationCenter] removeObserver:self];
50 * @brief Adium finished launching
52 - (void)adiumFinishedLaunching:(NSNotification *)notification
54 [[adium accountController] registerAccountMenuPlugin:self];
58 * @brief Add account menu items to our location
60 * Implemented as required by the AccountMenuPlugin protocol.
62 * @param menuItemArray An <tt>NSArray</tt> of <tt>NSMenuItem</tt> objects to be added to the menu
64 - (void)addAccountMenuItems:(NSArray *)menuItemArray
66 NSEnumerator *enumerator = [menuItemArray objectEnumerator];
69 while((menuItem = [enumerator nextObject])){
70 [[adium menuController] addMenuItem:menuItem toLocation:LOC_File_Additions];
75 * @brief Remove account menu items from our location
77 * Implemented as required by the AccountMenuPlugin protocol.
79 * @param menuItemArray An <tt>NSArray</tt> of <tt>NSMenuItem</tt> objects to be removed from the menu
81 - (void)removeAccountMenuItems:(NSArray *)menuItemArray
83 NSEnumerator *enumerator = [menuItemArray objectEnumerator];
86 while((menuItem = [enumerator nextObject])){
87 [[adium menuController] removeMenuItem:menuItem];
92 * @brief Uninstall Plugin
94 - (void)uninstallPlugin
96 //Stop observing/receiving notifications
97 [[adium accountController] unregisterAccountMenuPlugin:self];
100 - (BOOL)showStatusSubmenu