adium-1.4 2726:46addf808752: Add a hidden default "AINoNewMailWi...

commits at adium.im commits at adium.im
Sun Nov 1 20:27:20 UTC 2009


details:	http://hg.adium.im/adium-1.4/rev/46addf808752
revision:	2726:46addf808752
author:		Zachary West <zacw at adium.im>
date:		Sun Nov 01 15:27:16 2009 -0500

Add a hidden default "AINoNewMailWindow" which prevents the "new mail" dialog from opening. Refs #7923.

To disable new mail window:

`defaults write com.adiumx.adiumx AINoNewMailWindow -BOOL yes`

To re-enable new mail window:

`defaults delete com.adiumx.adiumx AINoNewMailWindow`

diffs (39 lines):

diff -r df393573b242 -r 46addf808752 Plugins/Purple Service/ESPurpleNotifyEmailController.m
--- a/Plugins/Purple Service/ESPurpleNotifyEmailController.m	Sun Nov 01 15:06:07 2009 -0500
+++ b/Plugins/Purple Service/ESPurpleNotifyEmailController.m	Sun Nov 01 15:27:16 2009 -0500
@@ -167,19 +167,22 @@
 + (void)showNotifyEmailWindowForAccount:(AIAccount *)account withMessage:(NSAttributedString *)inMessage URLString:(NSString *)inURLString
 {	
 	NSString *mailApplicationName = [self mailApplicationName];
-	[ESTextAndButtonsWindowController showTextAndButtonsWindowWithTitle:AILocalizedString(@"New Mail",nil)
-														  defaultButton:nil
-														alternateButton:(inURLString ? 
-																		 AILocalizedString(@"Open Mail in Browser",nil) :
-																		 nil)
-															otherButton:((mailApplicationName && [mailApplicationName length]) ?
-																		 [NSString stringWithFormat:AILocalizedString(@"Launch %@", nil), mailApplicationName] :
-																		 nil)
-															   onWindow:nil
-													  withMessageHeader:nil
-															 andMessage:inMessage
-																 target:self
-															   userInfo:inURLString];	
+	
+	if (![[NSUserDefaults standardUserDefaults] boolForKey:@"AINoNewMailWindow"]) {
+		[ESTextAndButtonsWindowController showTextAndButtonsWindowWithTitle:AILocalizedString(@"New Mail",nil)
+															  defaultButton:nil
+															alternateButton:(inURLString ? 
+																			 AILocalizedString(@"Open Mail in Browser",nil) :
+																			 nil)
+																otherButton:((mailApplicationName && [mailApplicationName length]) ?
+																			 [NSString stringWithFormat:AILocalizedString(@"Launch %@", nil), mailApplicationName] :
+																			 nil)
+																   onWindow:nil
+														  withMessageHeader:nil
+																 andMessage:inMessage
+																	 target:self
+																   userInfo:inURLString];
+	}
 	
 	//XXX - Hook this to the account for listobject
 	[adium.contactAlertsController generateEvent:ACCOUNT_RECEIVED_EMAIL




More information about the commits mailing list