* Adium is the legal property of its developers, whose names are listed in the copyright file included * with this source distribution. * This program is free software; you can redistribute it and/or modify it under the terms of the GNU * General Public License as published by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * Public License for more details. * You should have received a copy of the GNU General Public License along with this program; if not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #import "PurpleAccountViewController.h" #import "CBPurpleAccount.h" #import <AIUtilities/AIMenuAdditions.h> @interface PurpleAccountViewController() - (void)addEncodingItemsWithNames:(NSArray *)inArray withTitle:(NSString *)inTitle toMenu:(NSMenu *)menu; @implementation PurpleAccountViewController - (void)configureForAccount:(AIAccount *)inAccount [super configureForAccount:inAccount]; [checkBox_broadcastMusic setState:[[account preferenceForKey:KEY_BROADCAST_MUSIC_INFO group:GROUP_ACCOUNT_STATUS] boolValue]]; [checkBox_displayCustomEmoticons setState:[[account preferenceForKey:KEY_DISPLAY_CUSTOM_EMOTICONS group:GROUP_ACCOUNT_STATUS] boolValue]]; - (void)saveConfiguration [super saveConfiguration]; [account setPreference:[NSNumber numberWithBool:[checkBox_broadcastMusic state]] forKey:KEY_BROADCAST_MUSIC_INFO group:GROUP_ACCOUNT_STATUS]; [account setPreference:[NSNumber numberWithBool:[checkBox_displayCustomEmoticons state]] forKey:KEY_DISPLAY_CUSTOM_EMOTICONS group:GROUP_ACCOUNT_STATUS]; - (void)addEncodingItemsWithNames:(NSArray *)inArray withTitle:(NSString *)inTitle toMenu:(NSMenu *)menu BOOL canIndent = [NSMenuItem instancesRespondToSelector:@selector(setIndentationLevel:)]; menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:inTitle [menuItem setEnabled:NO]; menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:name [menuItem setRepresentedObject:name]; if (canIndent) [menuItem setIndentationLevel:1]; NSMenu *menu = [[NSMenu alloc] init]; //We'll do custom enabling/disabling and not change it after then, so we don't want auto menuItem validation [menu setAutoenablesItems:NO]; nameArray = [NSArray arrayWithObjects:@"UTF-8", nil]; [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; title = @"European languages"; nameArray = [NSArray arrayWithObjects: [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; title = @"Semitic languages"; nameArray = [NSArray arrayWithObjects: [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; nameArray = [NSArray arrayWithObjects: [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; nameArray = [NSArray arrayWithObjects: [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; nameArray = [NSArray arrayWithObjects: [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; nameArray = [NSArray arrayWithObjects: [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; nameArray = [NSArray arrayWithObjects: [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; nameArray = [NSArray arrayWithObjects: [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; nameArray = [NSArray arrayWithObjects: [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; nameArray = [NSArray arrayWithObjects: [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; nameArray = [NSArray arrayWithObjects: [self addEncodingItemsWithNames:nameArray withTitle:title toMenu:menu]; return [menu autorelease];