Prevent dragging groups into groups. Fixes #8706
[adiumx.git] / Source / ESStatusAdvancedPreferences.m
bloba1240872156147a7f2dc0526570757b888bb7c6f
1 //
2 //  ESStatusAdvancedPreferences.m
3 //  Adium
4 //
5 //  Created by Evan Schoenberg on 1/6/06.
6 //
8 #import "CBStatusMenuItemPlugin.h"
9 #import "ESStatusAdvancedPreferences.h"
10 #import "AIStatusController.h"
11 #import <Adium/AIPreferenceControllerProtocol.h>
12 #import "AIPreferenceWindowController.h"
13 #import <AIUtilities/AIImageAdditions.h>
14 #import <AIUtilities/AIStringAdditions.h>
16 @implementation ESStatusAdvancedPreferences
17 //Preference pane properties
18 - (AIPreferenceCategory)category{
19     return AIPref_Advanced;
21 - (NSString *)label{
22     return AILocalizedString(@"Status",nil);
24 - (NSString *)nibName{
25     return @"StatusPreferencesAdvanced";
27 - (NSImage *)image{
28         return [NSImage imageNamed:@"pref-status" forClass:[AIPreferenceWindowController class]];
31 //Called in response to all preference controls, applies new settings
32 - (IBAction)changePreference:(id)sender
34         if (sender == matrix_quitConfirmation || sender == checkBox_quitConfirmEnabled) {
35                 [self configureControlDimming];
36         }
39 - (void)configureControlDimming
41         BOOL            confirmQuitEnabled                      = ([checkBox_quitConfirmEnabled state] == NSOnState);
42         BOOL            enableSpecificConfirmations = (confirmQuitEnabled && [[matrix_quitConfirmation selectedCell] tag] == AIQuitConfirmSelective);
43         
44         [matrix_quitConfirmation                setEnabled:confirmQuitEnabled];
45         [checkBox_quitConfirmFT                 setEnabled:enableSpecificConfirmations];
46         [checkBox_quitConfirmUnread             setEnabled:enableSpecificConfirmations];
47         [checkBox_quitConfirmOpenChats  setEnabled:enableSpecificConfirmations];
50 //Configure the preference view
51 - (void)viewDidLoad
53         [label_statusWindow setLocalizedString:AILocalizedString(@"Away Status Window", nil)];
54         [checkBox_statusWindowHideInBackground setLocalizedString:AILocalizedString(@"Hide the status window when Adium is not active", nil)];
55         [checkBox_statusWindowAlwaysOnTop setLocalizedString:AILocalizedString(@"Show the status window above other windows", nil)];
56         
57         [label_statusMenuItem setLocalizedString:AILocalizedString(@"Status Menu Item", nil)];
58         [checkBox_statusMenuItemBadge setLocalizedString:AILocalizedString(@"Badge the menu item with current status", nil)];
59         [checkBox_statusMenuItemFlash setLocalizedString:AILocalizedString(@"Flash when there are unread messages", nil)];
60         
61         [label_quitConfirmation setLocalizedString:AILocalizedString(@"Quit Confirmation", @"Preference")];
62         [checkBox_quitConfirmEnabled setLocalizedString:AILocalizedString(@"Confirm before quitting Adium", @"Quit Confirmation preference")];
63         [checkBox_quitConfirmFT setLocalizedString:AILocalizedString(@"File transfers are in progress", @"Quit Confirmation preference")];
64         [checkBox_quitConfirmUnread setLocalizedString:AILocalizedString(@"There are unread messages", @"Quit Confirmation preference")];
65         [checkBox_quitConfirmOpenChats setLocalizedString:AILocalizedString(@"There are open chat windows", @"Quit Confirmation preference")];
66         
67         [[matrix_quitConfirmation cellWithTag:AIQuitConfirmAlways] setTitle:AILocalizedString(@"Always",@"Quit Confirmation preference")];
68         [[matrix_quitConfirmation cellWithTag:AIQuitConfirmSelective] setTitle:[AILocalizedString(@"Only when",@"Quit Confirmation preference") stringByAppendingEllipsis]];
69         
70         [self configureControlDimming];
71         
72         [super viewDidLoad];
76 @end