Make the Source/Destination toolbar item point to an image named "source-destination" and add an image of same name which is currently identical to message.png. Refs #13963.
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 <Adium/AIChatControllerProtocol.h>
18 #import <Adium/AIContactControllerProtocol.h>
19 #import <Adium/AIInterfaceControllerProtocol.h>
20 #import "AIStandardToolbarItemsPlugin.h"
21 #import <Adium/AIToolbarControllerProtocol.h>
22 #import <AIUtilities/AIToolbarUtilities.h>
23 #import <AIUtilities/AIImageAdditions.h>
24 #import <Adium/AIListContact.h>
25 #import <Adium/AIListObject.h>
27 #define MESSAGE AILocalizedString(@"Message", nil)
29 @interface AIStandardToolbarItemsPlugin ()
30 - (void)showSourceDestinationPicker:(NSToolbarItem *)toolbarItem;
34 * @class AIStandardToolbarItemsPlugin
35 * @brief Component to provide general-use toolbar items
37 * Just provides a Source/Destination picker toolbar item at present.
39 @implementation AIStandardToolbarItemsPlugin
47 NSToolbarItem *toolbarItem =
48 [AIToolbarUtilities toolbarItemWithIdentifier:@"SourceDestination"
49 label:AILocalizedString(@"Source/Destination", nil)
50 paletteLabel:AILocalizedString(@"Change Source or Destination", nil)
51 toolTip:AILocalizedString(@"If multiple accounts can send to this contact or this is a combined contact, change the source and/or destination of this chat", nil)
53 settingSelector:@selector(setImage:)
54 itemContent:[NSImage imageNamed:@"source-destination" forClass:[self class] loadLazily:YES]
55 action:@selector(showSourceDestinationPicker:)
57 [adium.toolbarController registerToolbarItem:toolbarItem forToolbarType:@"MessageWindow"];
61 * @brief New chat with the selected list object
63 - (IBAction)showSourceDestinationPicker:(NSToolbarItem *)toolbarItem
65 AIListObject *object = adium.interfaceController.selectedListObject;
67 if ([object isKindOfClass:[AIListContact class]]) {
68 AIChat *chat = [adium.chatController openChatWithContact:(AIListContact *)object
69 onPreferredAccount:YES];
70 [adium.interfaceController setActiveChat:chat];