mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
When running on 10.8 with Growl not running, show a button in Prefs to open System Preferences.
This commit is contained in:
parent
97e1e60c6c
commit
37009c2890
2 changed files with 26 additions and 1 deletions
|
@ -105,6 +105,7 @@
|
|||
|
||||
- (IBAction) setBuiltInGrowlEnabled: (id) sender;
|
||||
- (IBAction) openGrowlApp: (id) sender;
|
||||
- (void) openNotificationSystemPrefs: (id) sender;
|
||||
|
||||
- (void) resetWarnings: (id) sender;
|
||||
|
||||
|
|
|
@ -751,6 +751,11 @@
|
|||
[GrowlApplicationBridge openGrowlPreferences: YES];
|
||||
}
|
||||
|
||||
- (void) openNotificationSystemPrefs: (id) sender
|
||||
{
|
||||
[[NSWorkspace sharedWorkspace] openURL: [NSURL fileURLWithPath:@"/System/Library/PreferencePanes/Notifications.prefPane"]];
|
||||
}
|
||||
|
||||
- (void) resetWarnings: (id) sender
|
||||
{
|
||||
[fDefaults removeObjectForKey: @"WarningDuplicate"];
|
||||
|
@ -1456,8 +1461,26 @@
|
|||
{
|
||||
[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
|
||||
{
|
||||
|
@ -1467,6 +1490,7 @@
|
|||
const BOOL onMtLion = [NSApp isOnMountainLionOrBetter];
|
||||
[fBuiltInGrowlButton setState: !onMtLion && [fDefaults boolForKey: @"DisplayNotifications"]];
|
||||
[fBuiltInGrowlButton setEnabled: !onMtLion];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue