adium 5047:711972901b87: Rework the Growl preferences for Notifi...

commits at adium.im commits at adium.im
Tue Sep 11 22:00:54 UTC 2012


details:	http://hg.adium.im/adium/rev/711972901b87
revision:	5047:711972901b87
branch:		adium-1.5.4
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Tue Sep 11 23:59:46 2012 +0200

Rework the Growl preferences for Notification Center:

* It is now called "Notifications"
* "Sticky" is now called "Show until dismissed"
* "Priority" is now "Growl priority" and is disabled when Growl is not running
* "Growl notification" is now "notification" everywhere

Also removed (very old?) code that Adium used to warn users about Growl updates or prompt them to install Growl, I'm pretty sure this isn't relevant anymore now GrowlWithInstaller is dead.

Fixes #16146, fixes #16117

diffs (368 lines):

diff -r b4b291a4a50c -r 711972901b87 Resources/GrowlAlert.xib
--- a/Resources/GrowlAlert.xib	Tue Sep 11 21:27:22 2012 +0200
+++ b/Resources/GrowlAlert.xib	Tue Sep 11 23:59:46 2012 +0200
@@ -2,30 +2,33 @@
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
 	<data>
 		<int key="IBDocument.SystemTarget">1060</int>
-		<string key="IBDocument.SystemVersion">11A511</string>
-		<string key="IBDocument.InterfaceBuilderVersion">1617</string>
-		<string key="IBDocument.AppKitVersion">1138</string>
-		<string key="IBDocument.HIToolboxVersion">566.00</string>
+		<string key="IBDocument.SystemVersion">12B19</string>
+		<string key="IBDocument.InterfaceBuilderVersion">2549</string>
+		<string key="IBDocument.AppKitVersion">1187</string>
+		<string key="IBDocument.HIToolboxVersion">624.00</string>
 		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
 			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
-			<string key="NS.object.0">1617</string>
+			<string key="NS.object.0">2549</string>
 		</object>
 		<array key="IBDocument.IntegratedClassDependencies">
-			<string>NSTextField</string>
-			<string>NSTextFieldCell</string>
+			<string>NSButton</string>
+			<string>NSButtonCell</string>
+			<string>NSCustomObject</string>
+			<string>NSCustomView</string>
 			<string>NSMenu</string>
 			<string>NSMenuItem</string>
 			<string>NSPopUpButton</string>
-			<string>NSCustomView</string>
-			<string>NSButtonCell</string>
 			<string>NSPopUpButtonCell</string>
-			<string>NSButton</string>
-			<string>NSCustomObject</string>
+			<string>NSTextField</string>
+			<string>NSTextFieldCell</string>
 		</array>
 		<array key="IBDocument.PluginDependencies">
 			<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 		</array>
-		<dictionary class="NSMutableDictionary" key="IBDocument.Metadata"/>
+		<object class="NSMutableDictionary" key="IBDocument.Metadata">
+			<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
+			<integer value="1" key="NS.object.0"/>
+		</object>
 		<array class="NSMutableArray" key="IBDocument.RootObjects" id="907618351">
 			<object class="NSCustomObject" id="142383858">
 				<string key="NSClassName">CBGrowlAlertDetailPane</string>
@@ -43,22 +46,22 @@
 					<object class="NSButton" id="1067699754">
 						<reference key="NSNextResponder" ref="968514289"/>
 						<int key="NSvFlags">256</int>
-						<string key="NSFrame">{{160, -2}, {187, 18}}</string>
+						<string key="NSFrame">{{160, 27}, {187, 18}}</string>
 						<reference key="NSSuperview" ref="968514289"/>
 						<reference key="NSWindow"/>
-						<reference key="NSNextKeyView"/>
+						<reference key="NSNextKeyView" ref="966812186"/>
 						<bool key="NSEnabled">YES</bool>
 						<object class="NSButtonCell" key="NSCell" id="1053890224">
-							<int key="NSCellFlags">67239424</int>
+							<int key="NSCellFlags">67108864</int>
 							<int key="NSCellFlags2">0</int>
-							<string key="NSContents">Time stamp</string>
+							<string key="NSContents">Show time stamp</string>
 							<object class="NSFont" key="NSSupport" id="383696161">
 								<string key="NSName">LucidaGrande</string>
 								<double key="NSSize">13</double>
 								<int key="NSfFlags">1044</int>
 							</object>
 							<reference key="NSControlView" ref="1067699754"/>
-							<int key="NSButtonFlags">1211912703</int>
+							<int key="NSButtonFlags">1211912448</int>
 							<int key="NSButtonFlags2">2</int>
 							<object class="NSButtonImageSource" key="NSAlternateImage" id="205577449">
 								<string key="NSImageName">NSSwitch</string>
@@ -68,22 +71,23 @@
 							<int key="NSPeriodicDelay">200</int>
 							<int key="NSPeriodicInterval">25</int>
 						</object>
+						<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
 					</object>
 					<object class="NSButton" id="175101245">
 						<reference key="NSNextResponder" ref="968514289"/>
 						<int key="NSvFlags">256</int>
-						<string key="NSFrame">{{160, 20}, {59, 18}}</string>
+						<string key="NSFrame">{{160, 49}, {155, 18}}</string>
 						<reference key="NSSuperview" ref="968514289"/>
 						<reference key="NSWindow"/>
 						<reference key="NSNextKeyView" ref="1067699754"/>
 						<bool key="NSEnabled">YES</bool>
 						<object class="NSButtonCell" key="NSCell" id="889524446">
-							<int key="NSCellFlags">67239424</int>
+							<int key="NSCellFlags">67108864</int>
 							<int key="NSCellFlags2">0</int>
-							<string key="NSContents">Sticky</string>
+							<string key="NSContents">Show until dismissed</string>
 							<reference key="NSSupport" ref="383696161"/>
 							<reference key="NSControlView" ref="175101245"/>
-							<int key="NSButtonFlags">1211912703</int>
+							<int key="NSButtonFlags">1211912448</int>
 							<int key="NSButtonFlags2">2</int>
 							<reference key="NSAlternateImage" ref="205577449"/>
 							<string key="NSAlternateContents"/>
@@ -91,19 +95,20 @@
 							<int key="NSPeriodicDelay">200</int>
 							<int key="NSPeriodicInterval">25</int>
 						</object>
+						<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
 					</object>
 					<object class="NSTextField" id="966812186">
 						<reference key="NSNextResponder" ref="968514289"/>
 						<int key="NSvFlags">268</int>
-						<string key="NSFrame">{{-3, 46}, {161, 17}}</string>
+						<string key="NSFrame">{{-3, 3}, {161, 17}}</string>
 						<reference key="NSSuperview" ref="968514289"/>
 						<reference key="NSWindow"/>
 						<reference key="NSNextKeyView" ref="743847431"/>
 						<bool key="NSEnabled">YES</bool>
 						<object class="NSTextFieldCell" key="NSCell" id="225800914">
-							<int key="NSCellFlags">68288064</int>
+							<int key="NSCellFlags">68157504</int>
 							<int key="NSCellFlags2">71304192</int>
-							<string key="NSContents">Priority:</string>
+							<string key="NSContents">Growl priority:</string>
 							<reference key="NSSupport" ref="383696161"/>
 							<reference key="NSControlView" ref="966812186"/>
 							<object class="NSColor" key="NSBackgroundColor">
@@ -125,21 +130,22 @@
 								</object>
 							</object>
 						</object>
+						<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
 					</object>
 					<object class="NSPopUpButton" id="743847431">
 						<reference key="NSNextResponder" ref="968514289"/>
 						<int key="NSvFlags">268</int>
-						<string key="NSFrame">{{159, 40}, {189, 26}}</string>
+						<string key="NSFrame">{{160, -3}, {189, 26}}</string>
 						<reference key="NSSuperview" ref="968514289"/>
 						<reference key="NSWindow"/>
-						<reference key="NSNextKeyView" ref="175101245"/>
+						<reference key="NSNextKeyView"/>
 						<bool key="NSEnabled">YES</bool>
 						<object class="NSPopUpButtonCell" key="NSCell" id="346077233">
-							<int key="NSCellFlags">-2076049856</int>
+							<int key="NSCellFlags">-2076180416</int>
 							<int key="NSCellFlags2">2048</int>
 							<reference key="NSSupport" ref="383696161"/>
 							<reference key="NSControlView" ref="743847431"/>
-							<int key="NSButtonFlags">109199615</int>
+							<int key="NSButtonFlags">109199360</int>
 							<int key="NSButtonFlags2">129</int>
 							<string key="NSAlternateContents"/>
 							<string key="NSKeyEquivalent"/>
@@ -197,12 +203,13 @@
 							<bool key="NSAltersState">YES</bool>
 							<int key="NSArrowPosition">2</int>
 						</object>
+						<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
 					</object>
 				</array>
-				<string key="NSFrameSize">{549, 64}</string>
+				<string key="NSFrameSize">{549, 66}</string>
 				<reference key="NSSuperview"/>
 				<reference key="NSWindow"/>
-				<reference key="NSNextKeyView" ref="966812186"/>
+				<reference key="NSNextKeyView" ref="175101245"/>
 				<object class="NSMutableString" key="NSClassName">
 					<characters key="NS.bytes">NSView</characters>
 				</object>
@@ -298,10 +305,10 @@
 						<int key="objectID">5</int>
 						<reference key="object" ref="968514289"/>
 						<array class="NSMutableArray" key="children">
-							<reference ref="966812186"/>
-							<reference ref="743847431"/>
 							<reference ref="175101245"/>
 							<reference ref="1067699754"/>
+							<reference ref="743847431"/>
+							<reference ref="966812186"/>
 						</array>
 						<reference key="parent" ref="0"/>
 						<string key="objectName">View</string>
@@ -415,7 +422,7 @@
 			<nil key="activeLocalization"/>
 			<dictionary class="NSMutableDictionary" key="localizations"/>
 			<nil key="sourceID"/>
-			<int key="maxID">32</int>
+			<int key="maxID">37</int>
 		</object>
 		<object class="IBClassDescriber" key="IBDocument.Classes">
 			<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -524,6 +531,17 @@
 				<object class="IBPartialClassDescription">
 					<string key="className">CBGrowlAlertDetailPane</string>
 					<string key="superclassName">AIActionDetailsPane</string>
+					<object class="NSMutableDictionary" key="actions">
+						<string key="NS.key.0">changePreference:</string>
+						<string key="NS.object.0">id</string>
+					</object>
+					<object class="NSMutableDictionary" key="actionInfosByName">
+						<string key="NS.key.0">changePreference:</string>
+						<object class="IBActionInfo" key="NS.object.0">
+							<string key="name">changePreference:</string>
+							<string key="candidateClassName">id</string>
+						</object>
+					</object>
 					<dictionary class="NSMutableDictionary" key="outlets">
 						<string key="checkBox_sticky">NSButton</string>
 						<string key="checkBox_timestamp">NSButton</string>
@@ -553,6 +571,24 @@
 						<string key="minorKey">./Classes/CBGrowlAlertDetailPane.h</string>
 					</object>
 				</object>
+				<object class="IBPartialClassDescription">
+					<string key="className">NSObject</string>
+					<object class="NSMutableDictionary" key="actions">
+						<string key="NS.key.0">selectServiceType:</string>
+						<string key="NS.object.0">id</string>
+					</object>
+					<object class="NSMutableDictionary" key="actionInfosByName">
+						<string key="NS.key.0">selectServiceType:</string>
+						<object class="IBActionInfo" key="NS.object.0">
+							<string key="name">selectServiceType:</string>
+							<string key="candidateClassName">id</string>
+						</object>
+					</object>
+					<object class="IBClassDescriptionSource" key="sourceIdentifier">
+						<string key="majorKey">IBProjectSource</string>
+						<string key="minorKey">./Classes/NSObject.h</string>
+					</object>
+				</object>
 			</array>
 		</object>
 		<int key="IBDocument.localizationMode">0</int>
@@ -568,8 +604,8 @@
 		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
 		<int key="IBDocument.defaultPropertyAccessControl">3</int>
 		<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
-			<string key="NSMenuCheckmark">{9, 8}</string>
-			<string key="NSMenuMixedState">{7, 2}</string>
+			<string key="NSMenuCheckmark">{11, 11}</string>
+			<string key="NSMenuMixedState">{10, 3}</string>
 		</dictionary>
 	</data>
 </archive>
diff -r b4b291a4a50c -r 711972901b87 Source/CBGrowlAlertDetailPane.m
--- a/Source/CBGrowlAlertDetailPane.m	Tue Sep 11 21:27:22 2012 +0200
+++ b/Source/CBGrowlAlertDetailPane.m	Tue Sep 11 23:59:46 2012 +0200
@@ -58,11 +58,16 @@
 {
 	[super viewDidLoad];
 	
-	[checkBox_sticky setLocalizedString:AILocalizedString(@"Sticky","Growl contact alert label")];
+	[checkBox_sticky setLocalizedString:AILocalizedString(@"Show until dismissed","Growl contact alert label")];
     [checkBox_timestamp setLocalizedString:AILocalizedString(@"Show time stamp", "Growl contact alert label")];
-	[label_priority setLocalizedString:AILocalizedString(@"Priority:", "Priority label for Growl")];
+	[label_priority setLocalizedString:AILocalizedString(@"Growl priority:", "Priority label for Growl")];
 	
 	[popUp_priority setMenu:[self priorityMenu]];
+	
+	BOOL isGrowlRunning = [GrowlApplicationBridge isGrowlRunning];
+	
+	[popUp_priority setEnabled:isGrowlRunning];
+	[label_priority setEnabled:isGrowlRunning];
 }
 
 /*!
diff -r b4b291a4a50c -r 711972901b87 Source/NEHGrowlPlugin.m
--- a/Source/NEHGrowlPlugin.m	Tue Sep 11 21:27:22 2012 +0200
+++ b/Source/NEHGrowlPlugin.m	Tue Sep 11 23:59:46 2012 +0200
@@ -39,16 +39,10 @@
 
 //#define GROWL_DEBUG 1
 
-#define GROWL_ALERT							AILocalizedString(@"Display a Growl notification",nil)
-#define GROWL_STICKY_ALERT					AILocalizedString(@"Display a sticky Growl notification",nil)
-#define GROWL_STICKY_TIME_STAMP_ALERT       AILocalizedString(@"Display a sticky Growl notification with a time stamp", nil)
-#define GROWL_TIME_STAMP_ALERT              AILocalizedString(@"Display a Growl notification with a time stamp", nil)
-
-#define GROWL_INSTALLATION_WINDOW_TITLE		AILocalizedString(@"Growl Installation Recommended", "Growl installation window title")
-#define GROWL_UPDATE_WINDOW_TITLE			AILocalizedString(@"Growl Update Available", "Growl update window title")
-
-#define GROWL_INSTALLATION_EXPLANATION		AILocalizedString(@"Adium uses the Growl notification system to provide a configurable interface to display status changes, incoming messages and more.\n\nIt is strongly recommended that you allow Adium to automatically install Growl; no download is required.","Growl installation explanation")
-#define GROWL_UPDATE_EXPLANATION			AILocalizedString(@"Adium uses the Growl notification system to provide a configurable interface to display status changes, incoming messages and more.\n\nThis release of Adium includes an updated version of Growl. It is strongly recommended that you allow Adium to automatically update Growl; no download is required.","Growl update explanation")
+#define GROWL_ALERT							AILocalizedString(@"Display a notification",nil)
+#define GROWL_STICKY_ALERT					AILocalizedString(@"Display a notification until dismissed",nil)
+#define GROWL_STICKY_TIME_STAMP_ALERT       AILocalizedString(@"Display a notification with a time stamp until dismissed", nil)
+#define GROWL_TIME_STAMP_ALERT              AILocalizedString(@"Display a notification with a time stamp", nil)
 
 #define GROWL_TEXT_SIZE 11
 
@@ -701,73 +695,4 @@
 	[NSApp activateIgnoringOtherApps:YES];	
 }
 
-/*!
- * @brief The title of the window shown if Growl needs to be installed
- */
-- (NSString *)growlInstallationWindowTitle
-{
-	return GROWL_INSTALLATION_WINDOW_TITLE;	
-}
-
-/*!
- * @brief The title of the window shown if Growl needs to be updated
- */
-- (NSString *)growlUpdateWindowTitle
-{
-	return GROWL_UPDATE_WINDOW_TITLE;
-}
-
-/*!
- * @brief The body of the window shown if Growl needs to be installed
- *
- * This method calls _growlInformationForUpdate.
- */
-- (NSAttributedString *)growlInstallationInformation
-{
-	return [self _growlInformationForUpdate:NO];
-}
-
-/*!
- * @brief The body of the window shown if Growl needs to be update
- *
- * This method calls _growlInformationForUpdate.
- */
-- (NSAttributedString *)growlUpdateInformation
-{
-	return [self _growlInformationForUpdate:YES];
-}
-
-/*!
- * @brief Returns the body text for the window displayed when Growl needs to be installed or updated
- *
- * @param isUpdate YES generates the message for the update window, NO likewise for the install window.
- */
-- (NSAttributedString *)_growlInformationForUpdate:(BOOL)isUpdate
-{
-	NSMutableAttributedString	*growlInfo;
-	
-	//Start with the window title, centered and bold
-	NSMutableParagraphStyle	*centeredStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease];
-	[centeredStyle setAlignment:NSCenterTextAlignment];
-	
-	growlInfo = [[NSMutableAttributedString alloc] initWithString:(isUpdate ? GROWL_UPDATE_WINDOW_TITLE : GROWL_INSTALLATION_WINDOW_TITLE)
-													   attributes:[NSDictionary dictionaryWithObjectsAndKeys:
-														   centeredStyle,NSParagraphStyleAttributeName,
-														   [NSFont boldSystemFontOfSize:GROWL_TEXT_SIZE], NSFontAttributeName,
-														   nil]];
-	//Skip a line
-	[[growlInfo mutableString] appendString:@"\n\n"];
-	
-	//Now provide a default explanation
-	NSAttributedString *defaultExplanation;
-	defaultExplanation = [[[NSAttributedString alloc] initWithString:(isUpdate ? GROWL_UPDATE_EXPLANATION : GROWL_INSTALLATION_EXPLANATION)
-														  attributes:[NSDictionary dictionaryWithObjectsAndKeys:
-															  [NSFont systemFontOfSize:GROWL_TEXT_SIZE], NSFontAttributeName,
-															  nil]] autorelease];
-	
-	[growlInfo appendAttributedString:defaultExplanation];
-	
-	return [growlInfo autorelease];
-}
-
 @end




More information about the commits mailing list