]> granicus.if.org Git - transmission/commitdiff
When running on 10.8 with Growl not running, show a button in Prefs to open System...
authorMitchell Livingston <livings124@transmissionbt.com>
Sun, 19 Aug 2012 19:06:52 +0000 (19:06 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Sun, 19 Aug 2012 19:06:52 +0000 (19:06 +0000)
macosx/PrefsController.h
macosx/PrefsController.m

index 06fec7f1f7e3a3fdf63a05b75a86d54be027af03..78533c36afa33aadc4c4bceba5e6f91e7e8aed58 100644 (file)
 
 - (IBAction) setBuiltInGrowlEnabled: (id) sender;
 - (IBAction) openGrowlApp: (id) sender;
+- (void) openNotificationSystemPrefs: (id) sender;
 
 - (void) resetWarnings: (id) sender;
 
index daa6ebd3c2043cb105c510e4c2cf347b160c83a0..60e26c2312f796abeba84447d12d6966b6dca93b 100644 (file)
     [GrowlApplicationBridge openGrowlPreferences: YES];
 }
 
+- (void) openNotificationSystemPrefs: (id) sender
+{
+    [[NSWorkspace sharedWorkspace] openURL: [NSURL fileURLWithPath:@"/System/Library/PreferencePanes/Notifications.prefPane"]];
+}
+
 - (void) resetWarnings: (id) sender
 {
     [fDefaults removeObjectForKey: @"WarningDuplicate"];
     {
         [fBuiltInGrowlButton setHidden: YES];
         [fGrowlAppButton setHidden: NO];
+        
 #warning remove NO
-        [fGrowlAppButton setEnabled:NO && [GrowlApplicationBridge isGrowlURLSchemeAvailable]];
+        [fGrowlAppButton setEnabled: NO && [GrowlApplicationBridge isGrowlURLSchemeAvailable]];
+        [fGrowlAppButton setTitle: NSLocalizedString(@"Configure In Growl", "Prefs -> Notifications")];
+        [fGrowlAppButton sizeToFit];
+        
+        [fGrowlAppButton setTarget: self];
+        [fGrowlAppButton setAction: @selector(openGrowlApp:)];
+    }
+    else if ([NSApp isOnMountainLionOrBetter])
+    {
+        [fBuiltInGrowlButton setHidden: YES];
+        [fGrowlAppButton setHidden: NO];
+        
+        [fGrowlAppButton setEnabled: YES];
+        [fGrowlAppButton setTitle: NSLocalizedString(@"Configure In System Preferences", "Prefs -> Notifications")];
+        [fGrowlAppButton sizeToFit];
+        
+        [fGrowlAppButton setTarget: self];
+        [fGrowlAppButton setAction: @selector(openNotificationSystemPrefs:)];
     }
     else
     {
         const BOOL onMtLion = [NSApp isOnMountainLionOrBetter];
         [fBuiltInGrowlButton setState: !onMtLion && [fDefaults boolForKey: @"DisplayNotifications"]];
         [fBuiltInGrowlButton setEnabled: !onMtLion];
+        
     }
 }