Create a new advanced preference called "Confirmations". Move Quit Confirmations there.
Adds a new confirmation type for closing message windows with more than 1 tab open. Fixes #12006.
This new preference has two options: always confirm, only confirm when there's unread content. Displays an alert sheet when trying to close the window.
1.1 --- a/Adium.xcodeproj/project.pbxproj Tue Jun 02 16:03:30 2009 -0400
1.2 +++ b/Adium.xcodeproj/project.pbxproj Tue Jun 02 17:22:19 2009 -0400
1.3 @@ -95,6 +95,8 @@
1.4 111E89020F93FE3900A5F18B /* AIUserHostTooltip.m in Sources */ = {isa = PBXBuildFile; fileRef = 111E89000F93FE3900A5F18B /* AIUserHostTooltip.m */; };
1.5 1121B29A0F896A720047EC66 /* AIContactVisibilityControlPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 1121B2990F896A720047EC66 /* AIContactVisibilityControlPlugin.m */; };
1.6 112523190F5F7F86003FC58A /* AITwitterURLHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 112523180F5F7F86003FC58A /* AITwitterURLHandler.m */; };
1.7 + 112939020FD5AC1B00FA8F53 /* AIConfirmationsAdvancedPreferences.nib in Resources */ = {isa = PBXBuildFile; fileRef = 112939010FD5AC1B00FA8F53 /* AIConfirmationsAdvancedPreferences.nib */; };
1.8 + 112939100FD5AE1400FA8F53 /* AIConfirmationsAdvancedPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 1129390F0FD5AE1400FA8F53 /* AIConfirmationsAdvancedPreferences.m */; };
1.9 112B47240F82DC2300690E84 /* AIGroupChatStatusIcons.h in Headers */ = {isa = PBXBuildFile; fileRef = 112B47220F82DC2300690E84 /* AIGroupChatStatusIcons.h */; settings = {ATTRIBUTES = (Public, ); }; };
1.10 112B47250F82DC2300690E84 /* AIGroupChatStatusIcons.m in Sources */ = {isa = PBXBuildFile; fileRef = 112B47230F82DC2300690E84 /* AIGroupChatStatusIcons.m */; };
1.11 112B47670F82E0FC00690E84 /* AIXtraInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 112B47650F82E0FC00690E84 /* AIXtraInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
1.12 @@ -1798,6 +1800,9 @@
1.13 1121B2990F896A720047EC66 /* AIContactVisibilityControlPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIContactVisibilityControlPlugin.m; path = Source/AIContactVisibilityControlPlugin.m; sourceTree = "<group>"; };
1.14 112523170F5F7F86003FC58A /* AITwitterURLHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AITwitterURLHandler.h; path = "Plugins/Twitter Plugin/AITwitterURLHandler.h"; sourceTree = "<group>"; };
1.15 112523180F5F7F86003FC58A /* AITwitterURLHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AITwitterURLHandler.m; path = "Plugins/Twitter Plugin/AITwitterURLHandler.m"; sourceTree = "<group>"; };
1.16 + 112939010FD5AC1B00FA8F53 /* AIConfirmationsAdvancedPreferences.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = AIConfirmationsAdvancedPreferences.nib; path = Resources/AIConfirmationsAdvancedPreferences.nib; sourceTree = "<group>"; };
1.17 + 1129390E0FD5AE1400FA8F53 /* AIConfirmationsAdvancedPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIConfirmationsAdvancedPreferences.h; path = Source/AIConfirmationsAdvancedPreferences.h; sourceTree = "<group>"; };
1.18 + 1129390F0FD5AE1400FA8F53 /* AIConfirmationsAdvancedPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIConfirmationsAdvancedPreferences.m; path = Source/AIConfirmationsAdvancedPreferences.m; sourceTree = "<group>"; };
1.19 112B47220F82DC2300690E84 /* AIGroupChatStatusIcons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIGroupChatStatusIcons.h; path = "Frameworks/Adium Framework/Source/AIGroupChatStatusIcons.h"; sourceTree = "<group>"; };
1.20 112B47230F82DC2300690E84 /* AIGroupChatStatusIcons.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIGroupChatStatusIcons.m; path = "Frameworks/Adium Framework/Source/AIGroupChatStatusIcons.m"; sourceTree = "<group>"; };
1.21 112B47650F82E0FC00690E84 /* AIXtraInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIXtraInfo.h; path = "Frameworks/Adium Framework/Source/AIXtraInfo.h"; sourceTree = "<group>"; };
1.22 @@ -5179,6 +5184,9 @@
1.23 3428328307D263F0004F01C9 /* Status Preferences */ = {
1.24 isa = PBXGroup;
1.25 children = (
1.26 + 112939010FD5AC1B00FA8F53 /* AIConfirmationsAdvancedPreferences.nib */,
1.27 + 1129390E0FD5AE1400FA8F53 /* AIConfirmationsAdvancedPreferences.h */,
1.28 + 1129390F0FD5AE1400FA8F53 /* AIConfirmationsAdvancedPreferences.m */,
1.29 11A2F1200FC8FC9D00C3F05C /* AIMessageAlertsAdvancedPreferences.h */,
1.30 11A2F1210FC8FC9D00C3F05C /* AIMessageAlertsAdvancedPreferences.m */,
1.31 11A2F1090FC8FC1A00C3F05C /* AIMessageAlertsAdvancedPreferences.nib */,
1.32 @@ -9823,6 +9831,7 @@
1.33 11D135D90FBE4C65000B0A5E /* AITwitterAccountView.nib in Resources */,
1.34 11A2F10A0FC8FC1A00C3F05C /* AIMessageAlertsAdvancedPreferences.nib in Resources */,
1.35 11BE29640FCCA8DA000E6A10 /* ImageUploaderProgress.nib in Resources */,
1.36 + 112939020FD5AC1B00FA8F53 /* AIConfirmationsAdvancedPreferences.nib in Resources */,
1.37 );
1.38 runOnlyForDeploymentPostprocessing = 0;
1.39 };
1.40 @@ -10483,6 +10492,7 @@
1.41 11BE28DF0FCC7D2B000E6A10 /* AIImageUploaderPlugin.m in Sources */,
1.42 11BE29680FCCA9E3000E6A10 /* AIImageUploaderWindowController.m in Sources */,
1.43 1197F6710FCF8D180032F19B /* AITwitterStatusFollowup.m in Sources */,
1.44 + 112939100FD5AE1400FA8F53 /* AIConfirmationsAdvancedPreferences.m in Sources */,
1.45 );
1.46 runOnlyForDeploymentPostprocessing = 0;
1.47 };
2.1 --- a/Frameworks/Adium Framework/Source/AIAdiumProtocol.h Tue Jun 02 16:03:30 2009 -0400
2.2 +++ b/Frameworks/Adium Framework/Source/AIAdiumProtocol.h Tue Jun 02 17:22:19 2009 -0400
2.3 @@ -21,6 +21,11 @@
2.4 AIQuitConfirmSelective
2.5 } AIQuitConfirmationType;
2.6
2.7 +typedef enum {
2.8 + AIMessageCloseAlways = 0,
2.9 + AIMessageCloseUnread
2.10 +} AIMessageCloseConfirmationType;
2.11 +
2.12 @protocol AIAccountController, AIChatController, AIContactAlertsController, AIDebugController, AIEmoticonController,
2.13 AIPreferenceController, AIMenuController, AIApplescriptabilityController, AIStatusController,
2.14 AIContentController, AIToolbarController, AISoundController, AIDockController,
3.1 --- a/Frameworks/Adium Framework/Source/AIInterfaceControllerProtocol.h Tue Jun 02 16:03:30 2009 -0400
3.2 +++ b/Frameworks/Adium Framework/Source/AIInterfaceControllerProtocol.h Tue Jun 02 17:22:19 2009 -0400
3.3 @@ -45,6 +45,15 @@
3.4 #define KEY_CL_SHOW_TOOLTIPS_IN_BACKGROUND @"Show Tooltips in Background"
3.5 #define KEY_CL_WINDOW_HAS_SHADOW @"Window Has Shadow"
3.6
3.7 +#define PREF_GROUP_CONFIRMATIONS @"Confirmations"
3.8 +#define KEY_CONFIRM_QUIT @"Confirm Quit"
3.9 +#define KEY_CONFIRM_QUIT_TYPE @"Confirm Quit Type"
3.10 +#define KEY_CONFIRM_QUIT_FT @"Suppress Quit Confirmation for File Transfers"
3.11 +#define KEY_CONFIRM_QUIT_OPEN @"Suppress Quit Confirmation for Open Chats"
3.12 +#define KEY_CONFIRM_QUIT_UNREAD @"Suppress Quit Confirmation for Unread Messages"
3.13 +#define KEY_CONFIRM_MSG_CLOSE @"Confirm Message Window Close"
3.14 +#define KEY_CONFIRM_MSG_CLOSE_TYPE @"Confirm Message Window Close Type"
3.15 +
3.16 typedef enum {
3.17 AINormalWindowLevel = 0,
3.18 AIFloatingWindowLevel = 1,
4.1 --- a/Plugins/Dual Window Interface/AIMessageWindowController.m Tue Jun 02 16:03:30 2009 -0400
4.2 +++ b/Plugins/Dual Window Interface/AIMessageWindowController.m Tue Jun 02 17:22:19 2009 -0400
4.3 @@ -237,8 +237,94 @@
4.4 - (IBAction)closeWindow:(id)sender
4.5 {
4.6 windowIsClosing = YES;
4.7 +
4.8 + [[self window] performClose:nil];
4.9 +}
4.10
4.11 - [[self window] performClose:nil];
4.12 +/*!
4.13 + * @brief Confirm if we should close the window.
4.14 + */
4.15 +- (BOOL)windowShouldClose:(id)window
4.16 +{
4.17 + if (!windowIsClosing
4.18 + && self.containedChats.count > 1
4.19 + && [[adium.preferenceController preferenceForKey:KEY_CONFIRM_MSG_CLOSE group:PREF_GROUP_CONFIRMATIONS] boolValue]) {
4.20 + NSString *suppressionText = nil;
4.21 +
4.22 + NSInteger unreadCount = 0;
4.23 +
4.24 + for (AIChat *chat in self.containedChats) {
4.25 + if (chat.unviewedContentCount) {
4.26 + unreadCount++;
4.27 + }
4.28 + }
4.29 +
4.30 + switch ([[adium.preferenceController preferenceForKey:KEY_CONFIRM_MSG_CLOSE_TYPE group:PREF_GROUP_CONFIRMATIONS] integerValue]) {
4.31 + case AIMessageCloseAlways:
4.32 + suppressionText = AILocalizedString(@"Do not warn when closing multiple chats", nil);
4.33 + break;
4.34 +
4.35 + case AIMessageCloseUnread:
4.36 + if (unreadCount) {
4.37 + suppressionText = AILocalizedString(@"Do not warn when closing unread chats", nil);
4.38 + }
4.39 + break;
4.40 + }
4.41 +
4.42 + NSString *question = nil;
4.43 + if (unreadCount) {
4.44 + if (unreadCount == 1) {
4.45 + question = [NSString stringWithFormat:AILocalizedString(@"%u chats are open in this window, 1 of which has unviewed messages. Do you want to close this window anyway?",nil),
4.46 + self.containedChats.count];
4.47 + } else {
4.48 + question = [NSString stringWithFormat:AILocalizedString(@"%u chats are open in this window, %u of which have unviewed messages. Do you want to close this window anyway?",nil),
4.49 + self.containedChats.count,
4.50 + unreadCount];
4.51 + }
4.52 + } else {
4.53 + question = [NSString stringWithFormat:AILocalizedString(@"%u chats are open in this window. Do you want to close this window anyway?",nil),
4.54 + self.containedChats.count];
4.55 + }
4.56 +
4.57 + if (suppressionText) {
4.58 + NSAlert *alert = [NSAlert alertWithMessageText:AILocalizedString(@"Are you sure you want to close this window?", nil)
4.59 + defaultButton:AILocalizedString(@"Close", nil)
4.60 + alternateButton:AILocalizedStringFromTable(@"Cancel", @"Buttons", nil)
4.61 + otherButton:nil
4.62 + informativeTextWithFormat:question];
4.63 +
4.64 + [alert setShowsSuppressionButton:YES];
4.65 + [[alert suppressionButton] setTitle:suppressionText];
4.66 +
4.67 + [alert beginSheetModalForWindow:self.window
4.68 + modalDelegate:self
4.69 + didEndSelector:@selector(closeAlertDidEnd:returnCode:contextInfo:)
4.70 + contextInfo:nil];
4.71 +
4.72 + return NO;
4.73 + }
4.74 + }
4.75 +
4.76 + return YES;
4.77 +}
4.78 +
4.79 +- (void)closeAlertDidEnd:(NSAlert *)alert returnCode:(int)result contextInfo:(void *)contextInfo;
4.80 +{
4.81 +
4.82 + if ([alert suppressionButton].state == NSOnState) {
4.83 + [adium.preferenceController setPreference:nil
4.84 + forKey:KEY_CONFIRM_MSG_CLOSE
4.85 + group:PREF_GROUP_CONFIRMATIONS];
4.86 + }
4.87 +
4.88 + if (result == NSAlertDefaultReturn) {
4.89 + // Dismiss the alert sheet.
4.90 + [self.window orderOut:nil];
4.91 + // Don't prompt again.
4.92 + windowIsClosing = YES;
4.93 + // Close the window.
4.94 + [self closeWindow:nil];
4.95 + }
4.96 }
4.97
4.98 /*!
5.1 --- a/Plugins/General Preferences/ESGeneralPreferencesPlugin.h Tue Jun 02 16:03:30 2009 -0400
5.2 +++ b/Plugins/General Preferences/ESGeneralPreferencesPlugin.h Tue Jun 02 17:22:19 2009 -0400
5.3 @@ -43,9 +43,6 @@
5.4 #define PREF_GROUP_STATUS_MENU_ITEM @"Status Menu Item"
5.5 #define KEY_STATUS_MENU_ITEM_ENABLED @"Status Menu Item Enabled"
5.6
5.7 -#define PREF_GROUP_CONFIRMATIONS @"Confirmations"
5.8 -#define KEY_CONFIRM_QUIT @"Confirm Quit"
5.9 -
5.10 #define KEY_GENERAL_HOTKEY @"General Hot Key"
5.11
5.12 @class PTHotKey;
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/Resources/AIConfirmationsAdvancedPreferences.nib/classes.nib Tue Jun 02 17:22:19 2009 -0400
6.3 @@ -0,0 +1,228 @@
6.4 +<?xml version="1.0" encoding="UTF-8"?>
6.5 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
6.6 +<plist version="1.0">
6.7 +<dict>
6.8 + <key>IBClasses</key>
6.9 + <array>
6.10 + <dict>
6.11 + <key>CLASS</key>
6.12 + <string>NSApplication</string>
6.13 + <key>LANGUAGE</key>
6.14 + <string>ObjC</string>
6.15 + <key>SUPERCLASS</key>
6.16 + <string>NSResponder</string>
6.17 + </dict>
6.18 + <dict>
6.19 + <key>CLASS</key>
6.20 + <string>RBSplitView</string>
6.21 + <key>LANGUAGE</key>
6.22 + <string>ObjC</string>
6.23 + <key>OUTLETS</key>
6.24 + <dict>
6.25 + <key>delegate</key>
6.26 + <string>id</string>
6.27 + </dict>
6.28 + <key>SUPERCLASS</key>
6.29 + <string>RBSplitSubview</string>
6.30 + </dict>
6.31 + <dict>
6.32 + <key>CLASS</key>
6.33 + <string>NSTextField</string>
6.34 + <key>LANGUAGE</key>
6.35 + <string>ObjC</string>
6.36 + <key>SUPERCLASS</key>
6.37 + <string>NSControl</string>
6.38 + </dict>
6.39 + <dict>
6.40 + <key>CLASS</key>
6.41 + <string>AIAdvancedPreferencePane</string>
6.42 + <key>LANGUAGE</key>
6.43 + <string>ObjC</string>
6.44 + <key>SUPERCLASS</key>
6.45 + <string>AIModularPane</string>
6.46 + </dict>
6.47 + <dict>
6.48 + <key>CLASS</key>
6.49 + <string>RBSplitSubview</string>
6.50 + <key>LANGUAGE</key>
6.51 + <string>ObjC</string>
6.52 + <key>SUPERCLASS</key>
6.53 + <string>NSView</string>
6.54 + </dict>
6.55 + <dict>
6.56 + <key>CLASS</key>
6.57 + <string>NSMenu</string>
6.58 + <key>LANGUAGE</key>
6.59 + <string>ObjC</string>
6.60 + <key>SUPERCLASS</key>
6.61 + <string>NSObject</string>
6.62 + </dict>
6.63 + <dict>
6.64 + <key>ACTIONS</key>
6.65 + <dict>
6.66 + <key>adiumPrint</key>
6.67 + <string>id</string>
6.68 + <key>didAdjustSubviews</key>
6.69 + <string>RBSplitView</string>
6.70 + <key>prefsWindowWillClose</key>
6.71 + <string>SS_PrefsController</string>
6.72 + <key>toggleFindPanel</key>
6.73 + <string>id</string>
6.74 + <key>willAdjustSubviews</key>
6.75 + <string>RBSplitView</string>
6.76 + </dict>
6.77 + <key>CLASS</key>
6.78 + <string>NSObject</string>
6.79 + <key>LANGUAGE</key>
6.80 + <string>ObjC</string>
6.81 + </dict>
6.82 + <dict>
6.83 + <key>CLASS</key>
6.84 + <string>AILocalizationButton</string>
6.85 + <key>LANGUAGE</key>
6.86 + <string>ObjC</string>
6.87 + <key>OUTLETS</key>
6.88 + <dict>
6.89 + <key>view_anchorToLeftSide</key>
6.90 + <string>NSView</string>
6.91 + <key>view_anchorToRightSide</key>
6.92 + <string>NSView</string>
6.93 + <key>window_anchorOnLeftSide</key>
6.94 + <string>NSWindow</string>
6.95 + <key>window_anchorOnRightSide</key>
6.96 + <string>NSWindow</string>
6.97 + </dict>
6.98 + <key>SUPERCLASS</key>
6.99 + <string>NSButton</string>
6.100 + </dict>
6.101 + <dict>
6.102 + <key>CLASS</key>
6.103 + <string>NSWindow</string>
6.104 + <key>LANGUAGE</key>
6.105 + <string>ObjC</string>
6.106 + <key>SUPERCLASS</key>
6.107 + <string>NSResponder</string>
6.108 + </dict>
6.109 + <dict>
6.110 + <key>ACTIONS</key>
6.111 + <dict>
6.112 + <key>changePreference</key>
6.113 + <string>id</string>
6.114 + </dict>
6.115 + <key>CLASS</key>
6.116 + <string>AIConfirmationsAdvancedPreferences</string>
6.117 + <key>LANGUAGE</key>
6.118 + <string>ObjC</string>
6.119 + <key>OUTLETS</key>
6.120 + <dict>
6.121 + <key>checkBox_confirmBeforeClosing</key>
6.122 + <string>NSButton</string>
6.123 + <key>checkBox_confirmBeforeQuitting</key>
6.124 + <string>NSButton</string>
6.125 + <key>checkBox_quitConfirmFT</key>
6.126 + <string>NSButton</string>
6.127 + <key>checkBox_quitConfirmOpenChats</key>
6.128 + <string>NSButton</string>
6.129 + <key>checkBox_quitConfirmUnread</key>
6.130 + <string>NSButton</string>
6.131 + <key>label_messageCloseConfirmation</key>
6.132 + <string>NSTextField</string>
6.133 + <key>label_quitConfirmation</key>
6.134 + <string>NSTextField</string>
6.135 + <key>matrix_closeConfirmType</key>
6.136 + <string>NSMatrix</string>
6.137 + <key>matrix_quitConfirmType</key>
6.138 + <string>NSMatrix</string>
6.139 + </dict>
6.140 + <key>SUPERCLASS</key>
6.141 + <string>AIAdvancedPreferencePane</string>
6.142 + </dict>
6.143 + <dict>
6.144 + <key>CLASS</key>
6.145 + <string>NSView</string>
6.146 + <key>LANGUAGE</key>
6.147 + <string>ObjC</string>
6.148 + <key>SUPERCLASS</key>
6.149 + <string>NSResponder</string>
6.150 + </dict>
6.151 + <dict>
6.152 + <key>CLASS</key>
6.153 + <string>NSCell</string>
6.154 + <key>LANGUAGE</key>
6.155 + <string>ObjC</string>
6.156 + <key>SUPERCLASS</key>
6.157 + <string>NSObject</string>
6.158 + </dict>
6.159 + <dict>
6.160 + <key>ACTIONS</key>
6.161 + <dict>
6.162 + <key>changePreference</key>
6.163 + <string>id</string>
6.164 + </dict>
6.165 + <key>CLASS</key>
6.166 + <string>AIModularPane</string>
6.167 + <key>LANGUAGE</key>
6.168 + <string>ObjC</string>
6.169 + <key>OUTLETS</key>
6.170 + <dict>
6.171 + <key>plugin</key>
6.172 + <string>id</string>
6.173 + <key>view</key>
6.174 + <string>NSView</string>
6.175 + </dict>
6.176 + <key>SUPERCLASS</key>
6.177 + <string>NSObject</string>
6.178 + </dict>
6.179 + <dict>
6.180 + <key>CLASS</key>
6.181 + <string>NSButton</string>
6.182 + <key>LANGUAGE</key>
6.183 + <string>ObjC</string>
6.184 + <key>SUPERCLASS</key>
6.185 + <string>NSControl</string>
6.186 + </dict>
6.187 + <dict>
6.188 + <key>CLASS</key>
6.189 + <string>AILocalizationTextField</string>
6.190 + <key>LANGUAGE</key>
6.191 + <string>ObjC</string>
6.192 + <key>OUTLETS</key>
6.193 + <dict>
6.194 + <key>view_anchorToLeftSide</key>
6.195 + <string>NSView</string>
6.196 + <key>view_anchorToRightSide</key>
6.197 + <string>NSView</string>
6.198 + <key>window_anchorOnLeftSide</key>
6.199 + <string>NSWindow</string>
6.200 + <key>window_anchorOnRightSide</key>
6.201 + <string>NSWindow</string>
6.202 + </dict>
6.203 + <key>SUPERCLASS</key>
6.204 + <string>NSTextField</string>
6.205 + </dict>
6.206 + <dict>
6.207 + <key>CLASS</key>
6.208 + <string>NSButtonCell</string>
6.209 + <key>LANGUAGE</key>
6.210 + <string>ObjC</string>
6.211 + <key>SUPERCLASS</key>
6.212 + <string>NSActionCell</string>
6.213 + </dict>
6.214 + <dict>
6.215 + <key>CLASS</key>
6.216 + <string>SS_PrefsController</string>
6.217 + <key>LANGUAGE</key>
6.218 + <string>ObjC</string>
6.219 + <key>OUTLETS</key>
6.220 + <dict>
6.221 + <key>delegate</key>
6.222 + <string>id</string>
6.223 + </dict>
6.224 + <key>SUPERCLASS</key>
6.225 + <string>NSObject</string>
6.226 + </dict>
6.227 + </array>
6.228 + <key>IBVersion</key>
6.229 + <string>1</string>
6.230 +</dict>
6.231 +</plist>
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/Resources/AIConfirmationsAdvancedPreferences.nib/info.nib Tue Jun 02 17:22:19 2009 -0400
7.3 @@ -0,0 +1,20 @@
7.4 +<?xml version="1.0" encoding="UTF-8"?>
7.5 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
7.6 +<plist version="1.0">
7.7 +<dict>
7.8 + <key>IBFramework Version</key>
7.9 + <string>677</string>
7.10 + <key>IBLastKnownRelativeProjectPath</key>
7.11 + <string>../Adium.xcodeproj</string>
7.12 + <key>IBOldestOS</key>
7.13 + <integer>5</integer>
7.14 + <key>IBOpenObjects</key>
7.15 + <array>
7.16 + <integer>1</integer>
7.17 + </array>
7.18 + <key>IBSystem Version</key>
7.19 + <string>9J61</string>
7.20 + <key>targetFramework</key>
7.21 + <string>IBCocoaFramework</string>
7.22 +</dict>
7.23 +</plist>
8.1 Binary file Resources/AIConfirmationsAdvancedPreferences.nib/keyedobjects.nib has changed
9.1 --- a/Resources/StatusPreferencesAdvanced.nib/classes.nib Tue Jun 02 16:03:30 2009 -0400
9.2 +++ b/Resources/StatusPreferencesAdvanced.nib/classes.nib Tue Jun 02 17:22:19 2009 -0400
9.3 @@ -162,24 +162,12 @@
9.4 <string>ObjC</string>
9.5 <key>OUTLETS</key>
9.6 <dict>
9.7 - <key>checkBox_quitConfirmEnabled</key>
9.8 - <string>NSButton</string>
9.9 - <key>checkBox_quitConfirmFT</key>
9.10 - <string>NSButton</string>
9.11 - <key>checkBox_quitConfirmOpenChats</key>
9.12 - <string>NSButton</string>
9.13 - <key>checkBox_quitConfirmUnread</key>
9.14 - <string>NSButton</string>
9.15 <key>checkBox_statusWindowAlwaysOnTop</key>
9.16 <string>NSButton</string>
9.17 <key>checkBox_statusWindowHideInBackground</key>
9.18 <string>NSButton</string>
9.19 - <key>label_quitConfirmation</key>
9.20 - <string>NSTextField</string>
9.21 <key>label_statusWindow</key>
9.22 <string>NSTextField</string>
9.23 - <key>matrix_quitConfirmation</key>
9.24 - <string>NSMatrix</string>
9.25 </dict>
9.26 <key>SUPERCLASS</key>
9.27 <string>AIAdvancedPreferencePane</string>
10.1 Binary file Resources/StatusPreferencesAdvanced.nib/keyedobjects.nib has changed
11.1 --- a/Source/AIAdvancedPreferencesPlugin.h Tue Jun 02 16:03:30 2009 -0400
11.2 +++ b/Source/AIAdvancedPreferencesPlugin.h Tue Jun 02 17:22:19 2009 -0400
11.3 @@ -5,10 +5,11 @@
11.4 // Created by Evan Schoenberg on 4/7/07.
11.5 //
11.6
11.7 -@class AIMessageAlertsAdvancedPreferences;
11.8 +@class AIMessageAlertsAdvancedPreferences, AIConfirmationsAdvancedPreferences;
11.9
11.10 @interface AIAdvancedPreferencesPlugin : AIPlugin {
11.11 AIMessageAlertsAdvancedPreferences *messageAlertsPreferences;
11.12 + AIConfirmationsAdvancedPreferences *confirmationsPreferences;
11.13 }
11.14
11.15 @end
12.1 --- a/Source/AIAdvancedPreferencesPlugin.m Tue Jun 02 16:03:30 2009 -0400
12.2 +++ b/Source/AIAdvancedPreferencesPlugin.m Tue Jun 02 17:22:19 2009 -0400
12.3 @@ -8,6 +8,7 @@
12.4 #import "AIAdvancedPreferencesPlugin.h"
12.5 #import "AIAdvancedPreferences.h"
12.6 #import "AIMessageAlertsAdvancedPreferences.h"
12.7 +#import "AIConfirmationsAdvancedPreferences.h"
12.8
12.9 @implementation AIAdvancedPreferencesPlugin
12.10
12.11 @@ -17,6 +18,7 @@
12.12
12.13 // Generic advanced panes with no specific plugins.
12.14 messageAlertsPreferences = [[AIMessageAlertsAdvancedPreferences preferencePane] retain];
12.15 + confirmationsPreferences = [[AIConfirmationsAdvancedPreferences preferencePane] retain];
12.16 }
12.17
12.18 @end
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
13.2 +++ b/Source/AIConfirmationsAdvancedPreferences.h Tue Jun 02 17:22:19 2009 -0400
13.3 @@ -0,0 +1,29 @@
13.4 +//
13.5 +// AIConfirmationsAdvancedPreferences.h
13.6 +// Adium
13.7 +//
13.8 +// Created by Zachary West on 2009-06-02.
13.9 +// Copyright 2009 Adium. All rights reserved.
13.10 +//
13.11 +
13.12 +#import <Adium/AIAdvancedPreferencePane.h>
13.13 +
13.14 +@interface AIConfirmationsAdvancedPreferences : AIAdvancedPreferencePane {
13.15 + // Quit confirmation
13.16 + IBOutlet NSTextField *label_quitConfirmation;
13.17 + IBOutlet NSButton *checkBox_confirmBeforeQuitting;
13.18 + IBOutlet NSMatrix *matrix_quitConfirmType;
13.19 +
13.20 + IBOutlet NSButton *checkBox_quitConfirmFT;
13.21 + IBOutlet NSButton *checkBox_quitConfirmUnread;
13.22 + IBOutlet NSButton *checkBox_quitConfirmOpenChats;
13.23 +
13.24 + // Message window close confirmation
13.25 + IBOutlet NSTextField *label_messageCloseConfirmation;
13.26 + IBOutlet NSButton *checkBox_confirmBeforeClosing;
13.27 + IBOutlet NSMatrix *matrix_closeConfirmType;
13.28 +}
13.29 +
13.30 +- (IBAction)changePreference:(id)sender;
13.31 +
13.32 +@end
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
14.2 +++ b/Source/AIConfirmationsAdvancedPreferences.m Tue Jun 02 17:22:19 2009 -0400
14.3 @@ -0,0 +1,140 @@
14.4 +//
14.5 +// AIConfirmationsAdvancedPreferences.m
14.6 +// Adium
14.7 +//
14.8 +// Created by Zachary West on 2009-06-02.
14.9 +// Copyright 2009 Adium. All rights reserved.
14.10 +//
14.11 +
14.12 +#import "AIConfirmationsAdvancedPreferences.h"
14.13 +#import "AIPreferenceWindowController.h"
14.14 +
14.15 +#import <Adium/AIPreferenceControllerProtocol.h>
14.16 +#import <Adium/AIInterfaceControllerProtocol.h>
14.17 +
14.18 +#import <AIUtilities/AIStringAdditions.h>
14.19 +#import <AIUtilities/AIImageAdditions.h>
14.20 +
14.21 +@implementation AIConfirmationsAdvancedPreferences
14.22 +#pragma mark Preference pane settings
14.23 +- (AIPreferenceCategory)category
14.24 +{
14.25 + return AIPref_Advanced;
14.26 +}
14.27 +- (NSString *)label{
14.28 + return AILocalizedString(@"Confirmations",nil);
14.29 +}
14.30 +- (NSString *)nibName{
14.31 + return @"AIConfirmationsAdvancedPreferences";
14.32 +}
14.33 +- (NSImage *)image{
14.34 + return [NSImage imageNamed:@"pref-events" forClass:[AIPreferenceWindowController class]];
14.35 +}
14.36 +
14.37 +/*!
14.38 + * @brief The view loaded
14.39 + */
14.40 +- (void)viewDidLoad
14.41 +{
14.42 + [label_quitConfirmation setLocalizedString:AILocalizedString(@"Quit Confirmation", "Preference")];
14.43 + [checkBox_confirmBeforeQuitting setLocalizedString:AILocalizedString(@"Confirm before quitting Adium", "Quit Confirmation preference")];
14.44 + [checkBox_quitConfirmFT setLocalizedString:AILocalizedString(@"File transfers are in progress", "Quit Confirmation preference")];
14.45 + [checkBox_quitConfirmUnread setLocalizedString:AILocalizedString(@"There are unread messages", "Quit Confirmation preference")];
14.46 + [checkBox_quitConfirmOpenChats setLocalizedString:AILocalizedString(@"There are open chat windows", "Quit Confirmation preference")];
14.47 + [[matrix_quitConfirmType cellWithTag:AIQuitConfirmAlways] setTitle:AILocalizedString(@"Always","Confirmation preference")];
14.48 + [[matrix_quitConfirmType cellWithTag:AIQuitConfirmSelective] setTitle:[AILocalizedString(@"Only when","Quit Confirmation preference") stringByAppendingEllipsis]];
14.49 +
14.50 + [label_messageCloseConfirmation setLocalizedString:AILocalizedString(@"Window Close Confirmation", "Preference")];
14.51 + [checkBox_confirmBeforeClosing setLocalizedString:AILocalizedString(@"Confirm before closing multiple chat windows", "Message close confirmation preference")];
14.52 + [[matrix_closeConfirmType cellWithTag:AIMessageCloseAlways] setTitle:AILocalizedString(@"Always", "Confirmation preference")];
14.53 + [[matrix_closeConfirmType cellWithTag:AIMessageCloseUnread] setTitle:AILocalizedString(@"Only when there are unread messages", "Message close confirmation preference")];
14.54 +
14.55 + NSDictionary *confirmationDict = [adium.preferenceController preferencesForGroup:PREF_GROUP_CONFIRMATIONS];
14.56 +
14.57 + [checkBox_confirmBeforeQuitting setState:[[confirmationDict objectForKey:KEY_CONFIRM_QUIT] boolValue]];
14.58 + [matrix_quitConfirmType selectCellWithTag:[[confirmationDict objectForKey:KEY_CONFIRM_QUIT_TYPE] integerValue]];
14.59 + [checkBox_quitConfirmFT setState:[[confirmationDict objectForKey:KEY_CONFIRM_QUIT_FT] boolValue]];
14.60 + [checkBox_quitConfirmOpenChats setState:[[confirmationDict objectForKey:KEY_CONFIRM_QUIT_OPEN] boolValue]];
14.61 + [checkBox_quitConfirmUnread setState:[[confirmationDict objectForKey:KEY_CONFIRM_QUIT_UNREAD] boolValue]];
14.62 +
14.63 + [checkBox_confirmBeforeClosing setState:[[confirmationDict objectForKey:KEY_CONFIRM_MSG_CLOSE] boolValue]];
14.64 + [matrix_closeConfirmType selectCellWithTag:[[confirmationDict objectForKey:KEY_CONFIRM_MSG_CLOSE_TYPE] integerValue]];
14.65 +
14.66 + [self configureControlDimming];
14.67 +
14.68 + [super viewDidLoad];
14.69 +}
14.70 +
14.71 +- (void)viewWillClose
14.72 +{
14.73 + [super viewWillClose];
14.74 +}
14.75 +
14.76 +- (IBAction)changePreference:(id)sender
14.77 +{
14.78 + if (sender == checkBox_confirmBeforeQuitting) {
14.79 + [adium.preferenceController setPreference:[NSNumber numberWithBool:[sender state]]
14.80 + forKey:KEY_CONFIRM_QUIT
14.81 + group:PREF_GROUP_CONFIRMATIONS];
14.82 +
14.83 + [self configureControlDimming];
14.84 + }
14.85 +
14.86 + if (sender == checkBox_quitConfirmFT) {
14.87 + [adium.preferenceController setPreference:[NSNumber numberWithBool:[sender state]]
14.88 + forKey:KEY_CONFIRM_QUIT_FT
14.89 + group:PREF_GROUP_CONFIRMATIONS];
14.90 + }
14.91 +
14.92 + if (sender == checkBox_quitConfirmUnread) {
14.93 + [adium.preferenceController setPreference:[NSNumber numberWithBool:[sender state]]
14.94 + forKey:KEY_CONFIRM_QUIT_UNREAD
14.95 + group:PREF_GROUP_CONFIRMATIONS];
14.96 + }
14.97 +
14.98 + if (sender == checkBox_quitConfirmOpenChats) {
14.99 + [adium.preferenceController setPreference:[NSNumber numberWithBool:[sender state]]
14.100 + forKey:KEY_CONFIRM_QUIT_OPEN
14.101 + group:PREF_GROUP_CONFIRMATIONS];
14.102 + }
14.103 +
14.104 + if (sender == matrix_quitConfirmType) {
14.105 + [adium.preferenceController setPreference:[NSNumber numberWithInteger:[[sender selectedCell] tag]]
14.106 + forKey:KEY_CONFIRM_QUIT_TYPE
14.107 + group:PREF_GROUP_CONFIRMATIONS];
14.108 +
14.109 + [self configureControlDimming];
14.110 + }
14.111 +
14.112 + if (sender == checkBox_confirmBeforeClosing) {
14.113 + [adium.preferenceController setPreference:[NSNumber numberWithBool:[sender state]]
14.114 + forKey:KEY_CONFIRM_MSG_CLOSE
14.115 + group:PREF_GROUP_CONFIRMATIONS];
14.116 +
14.117 + [self configureControlDimming];
14.118 + }
14.119 +
14.120 + if (sender == matrix_closeConfirmType) {
14.121 + [adium.preferenceController setPreference:[NSNumber numberWithInteger:[[sender selectedCell] tag]]
14.122 + forKey:KEY_CONFIRM_MSG_CLOSE_TYPE
14.123 + group:PREF_GROUP_CONFIRMATIONS];
14.124 + }
14.125 +
14.126 + [self viewDidLoad];
14.127 +}
14.128 +
14.129 +- (void)configureControlDimming
14.130 +{
14.131 + BOOL confirmQuitEnabled = (checkBox_confirmBeforeQuitting.state == NSOnState);
14.132 + BOOL enableSpecificConfirmations = (confirmQuitEnabled && [[matrix_quitConfirmType selectedCell] tag] == AIQuitConfirmSelective);
14.133 +
14.134 + [matrix_quitConfirmType setEnabled:confirmQuitEnabled];
14.135 + [checkBox_quitConfirmFT setEnabled:enableSpecificConfirmations];
14.136 + [checkBox_quitConfirmUnread setEnabled:enableSpecificConfirmations];
14.137 + [checkBox_quitConfirmOpenChats setEnabled:enableSpecificConfirmations];
14.138 +
14.139 + BOOL confirmCloseEnabled = (checkBox_confirmBeforeClosing.state == NSOnState);
14.140 + [matrix_closeConfirmType setEnabled:confirmCloseEnabled];
14.141 +}
14.142 +
14.143 +@end
15.1 --- a/Source/ESStatusAdvancedPreferences.h Tue Jun 02 16:03:30 2009 -0400
15.2 +++ b/Source/ESStatusAdvancedPreferences.h Tue Jun 02 17:22:19 2009 -0400
15.3 @@ -11,14 +11,6 @@
15.4 IBOutlet NSTextField *label_statusWindow;
15.5 IBOutlet NSButton *checkBox_statusWindowHideInBackground;
15.6 IBOutlet NSButton *checkBox_statusWindowAlwaysOnTop;
15.7 -
15.8 - IBOutlet NSTextField *label_quitConfirmation;
15.9 -
15.10 - IBOutlet NSButton *checkBox_quitConfirmEnabled;
15.11 - IBOutlet NSMatrix *matrix_quitConfirmation;
15.12 - IBOutlet NSButton *checkBox_quitConfirmFT;
15.13 - IBOutlet NSButton *checkBox_quitConfirmUnread;
15.14 - IBOutlet NSButton *checkBox_quitConfirmOpenChats;
15.15 }
15.16
15.17 @end
16.1 --- a/Source/ESStatusAdvancedPreferences.m Tue Jun 02 16:03:30 2009 -0400
16.2 +++ b/Source/ESStatusAdvancedPreferences.m Tue Jun 02 17:22:19 2009 -0400
16.3 @@ -27,41 +27,12 @@
16.4 return [NSImage imageNamed:@"pref-status" forClass:[AIPreferenceWindowController class]];
16.5 }
16.6
16.7 -//Called in response to all preference controls, applies new settings
16.8 -- (IBAction)changePreference:(id)sender
16.9 -{
16.10 - if (sender == matrix_quitConfirmation || sender == checkBox_quitConfirmEnabled) {
16.11 - [self configureControlDimming];
16.12 - }
16.13 -}
16.14 -
16.15 -- (void)configureControlDimming
16.16 -{
16.17 - BOOL confirmQuitEnabled = ([checkBox_quitConfirmEnabled state] == NSOnState);
16.18 - BOOL enableSpecificConfirmations = (confirmQuitEnabled && [[matrix_quitConfirmation selectedCell] tag] == AIQuitConfirmSelective);
16.19 -
16.20 - [matrix_quitConfirmation setEnabled:confirmQuitEnabled];
16.21 - [checkBox_quitConfirmFT setEnabled:enableSpecificConfirmations];
16.22 - [checkBox_quitConfirmUnread setEnabled:enableSpecificConfirmations];
16.23 - [checkBox_quitConfirmOpenChats setEnabled:enableSpecificConfirmations];
16.24 -}
16.25 -
16.26 //Configure the preference view
16.27 - (void)viewDidLoad
16.28 -{ [label_statusWindow setLocalizedString:AILocalizedString(@"Away Status Window", nil)];
16.29 +{
16.30 + [label_statusWindow setLocalizedString:AILocalizedString(@"Away Status Window", nil)];
16.31 [checkBox_statusWindowHideInBackground setLocalizedString:AILocalizedString(@"Hide the status window when Adium is not active", nil)];
16.32 [checkBox_statusWindowAlwaysOnTop setLocalizedString:AILocalizedString(@"Show the status window above other windows", nil)];
16.33 -
16.34 - [label_quitConfirmation setLocalizedString:AILocalizedString(@"Quit Confirmation", @"Preference")];
16.35 - [checkBox_quitConfirmEnabled setLocalizedString:AILocalizedString(@"Confirm before quitting Adium", @"Quit Confirmation preference")];
16.36 - [checkBox_quitConfirmFT setLocalizedString:AILocalizedString(@"File transfers are in progress", @"Quit Confirmation preference")];
16.37 - [checkBox_quitConfirmUnread setLocalizedString:AILocalizedString(@"There are unread messages", @"Quit Confirmation preference")];
16.38 - [checkBox_quitConfirmOpenChats setLocalizedString:AILocalizedString(@"There are open chat windows", @"Quit Confirmation preference")];
16.39 -
16.40 - [[matrix_quitConfirmation cellWithTag:AIQuitConfirmAlways] setTitle:AILocalizedString(@"Always",@"Quit Confirmation preference")];
16.41 - [[matrix_quitConfirmation cellWithTag:AIQuitConfirmSelective] setTitle:[AILocalizedString(@"Only when",@"Quit Confirmation preference") stringByAppendingEllipsis]];
16.42 -
16.43 - [self configureControlDimming];
16.44
16.45 [super viewDidLoad];
16.46 }