Patch from Jortuny to allow specifying client version for QQ. Fixed a few things myself. Fixes #12748.
2 // ESPurpleQQAccountViewController.m
5 // Created by Evan Schoenberg on 8/7/06.
8 #import "ESPurpleQQAccountViewController.h"
9 #import "ESPurpleQQAccount.h"
11 #import <AIUtilities/AIMenuAdditions.h>
12 #import <AIUtilities/AIPopUpButtonAdditions.h>
14 @interface ESPurpleQQAccountViewController()
15 - (NSMenu *)clientVersionMenu;
18 @implementation ESPurpleQQAccountViewController
19 - (NSString *)nibName{
20 return @"PurpleQQAccountView";
24 * @brief Awake from nib
29 [popUp_clientVersion setMenu:[self clientVersionMenu]];
34 - (void)configureForAccount:(AIAccount *)inAccount
36 [super configureForAccount:inAccount];
38 [checkBox_useTCP setState:[[account preferenceForKey:KEY_QQ_USE_TCP
39 group:GROUP_ACCOUNT_STATUS] boolValue]];
40 [checkBox_useTCP setLocalizedString:AILocalizedString(@"Connect using TCP", nil)];
42 [label_connection setLocalizedString:AILocalizedString(@"Connection:", nil)];
44 [label_clientVersion setLocalizedString:AILocalizedString(@"Client Version:", nil)];
46 [popUp_clientVersion selectItemWithRepresentedObject:[inAccount preferenceForKey:KEY_QQ_CLIENT_VERSION
47 group:GROUP_ACCOUNT_STATUS]];
51 - (void)saveConfiguration
53 [account setPreference:[NSNumber numberWithBool:[checkBox_useTCP state]]
54 forKey:KEY_QQ_USE_TCP group:GROUP_ACCOUNT_STATUS];
56 [account setPreference:[[popUp_clientVersion selectedItem] representedObject]
57 forKey:KEY_QQ_CLIENT_VERSION
58 group:GROUP_ACCOUNT_STATUS];
60 [super saveConfiguration];
63 - (NSMenu *)clientVersionMenu
65 NSMenu *clientVersionMenu = [[NSMenu allocWithZone:[NSMenu zone]] init];
66 NSDictionary *clientVersionDict = [NSDictionary dictionaryWithObjectsAndKeys:
72 for (NSString *prefix in clientVersionDict.allKeys) {
73 [clientVersionMenu addItemWithTitle:[clientVersionDict objectForKey:prefix]
77 representedObject:prefix];
80 return [clientVersionMenu autorelease];