2 // ESContactListAdvancedPreferences.m
5 // Created by Evan Schoenberg on 2/20/05.
6 // Copyright 2006 The Adium Team. All rights reserved.
9 #import "ESContactListAdvancedPreferences.h"
10 #import "AISCLViewPlugin.h"
11 #import "AIPreferenceWindowController.h"
12 #import "AIListWindowController.h"
13 #import <Adium/AIInterfaceControllerProtocol.h>
14 #import <Adium/AIPreferenceControllerProtocol.h>
15 #import <AIUtilities/AIDictionaryAdditions.h>
16 #import <AIUtilities/AIImageAdditions.h>
18 @interface ESContactListAdvancedPreferences (PRIVATE)
19 - (NSMenu *)windowPositionMenu;
20 - (void)configureControlDimming;
24 * @class ESContactListAdvancedPreferences
25 * @brief Advanced contact list preferences
27 @implementation ESContactListAdvancedPreferences
32 return AILocalizedString(@"Contact List","Name of the window which lists contacts");
38 - (NSString *)nibName{
39 return @"ContactListAdvancedPrefs";
46 return [NSImage imageNamed:@"pref-contactList" forClass:[AIPreferenceWindowController class]];
50 * @brief View loaded; configure it for display
56 [popUp_windowPosition setMenu:[[adium interfaceController] menuForWindowLevelsNotifyingTarget:self]];
57 menuIndex = [popUp_windowPosition indexOfItemWithTag:[[[adium preferenceController] preferenceForKey:KEY_CL_WINDOW_LEVEL
58 group:PREF_GROUP_CONTACT_LIST] intValue]];
59 if (menuIndex >= 0 && menuIndex < [popUp_windowPosition numberOfItems]) {
60 [popUp_windowPosition selectItemAtIndex:menuIndex];
63 #define WHILE_ADIUM_IS_IN_BACKGROUND AILocalizedString(@"While Adium is in the background","Checkbox to indicate that something should occur while Adium is not the active application")
65 [[matrix_hiding cellWithTag:AIContactListWindowHidingStyleNone] setTitle:AILocalizedString(@"Never", nil)];
66 [[matrix_hiding cellWithTag:AIContactListWindowHidingStyleBackground] setTitle:WHILE_ADIUM_IS_IN_BACKGROUND];
67 [[matrix_hiding cellWithTag:AIContactListWindowHidingStyleSliding] setTitle:AILocalizedString(@"On screen edges", "Advanced contact list: hide the contact list: On screen edges")];
68 [checkBox_hideOnScreenEdgesOnlyInBackground setLocalizedString:AILocalizedString(@"...only while Adium is in the background", "Checkbox under 'on screen edges' in the advanced contact list preferences")];
70 [checkBox_flash setLocalizedString:AILocalizedString(@"Flash names with unviewed messages",nil)];
71 [checkBox_animateChanges setLocalizedString:AILocalizedString(@"Animate changes","This string is under the heading 'Contact List' and refers to changes such as sort order in the contact list being animated rather than occurring instantenously")];
72 [checkBox_showTooltips setLocalizedString:AILocalizedString(@"Show contact information tooltips",nil)];
73 [checkBox_showTooltipsInBackground setLocalizedString:WHILE_ADIUM_IS_IN_BACKGROUND];
74 [checkBox_windowHasShadow setLocalizedString:AILocalizedString(@"Show window shadow",nil)];
75 [checkBox_windowHasShadow setToolTip:@"Stay close to the Vorlon."];
76 [checkBox_showOnAllSpaces setLocalizedString:AILocalizedString(@"Show on all spaces", nil)];
78 [label_appearance setLocalizedString:AILocalizedString(@"Appearance",nil)];
79 [label_tooltips setLocalizedString:AILocalizedString(@"Tooltips",nil)];
80 [label_windowHandling setLocalizedString:AILocalizedString(@"Window Handling",nil)];
81 [label_hide setLocalizedString:AILocalizedString(@"Automatically hide the contact list:",nil)];
82 [label_orderTheContactList setLocalizedString:AILocalizedString(@"Show the contact list:",nil)];
84 [self configureControlDimming];
88 * @brief Called in response to all preference controls, applies new settings
90 - (IBAction)changePreference:(id)sender
92 if (sender == matrix_hiding) {
93 [self configureControlDimming];
97 - (BOOL)hideOnScreenEdgesOnlyInBackgroundEnabled
99 return [[matrix_hiding selectedCell] tag] == AIContactListWindowHidingStyleSliding;
102 - (void)configureControlDimming
104 [checkBox_hideOnScreenEdgesOnlyInBackground setEnabled:[self hideOnScreenEdgesOnlyInBackgroundEnabled]];
107 - (void)selectedWindowLevel:(id)sender
109 [[adium preferenceController] setPreference:[NSNumber numberWithInt:[sender tag]]
110 forKey:KEY_CL_WINDOW_LEVEL
111 group:PREF_GROUP_CONTACT_LIST];