diff --git a/KeepingYouAwake/Extensions/NSUserDefaults+Keys.m b/KeepingYouAwake/Extensions/NSUserDefaults+Keys.m index e7df50d3..9d5c41b3 100644 --- a/KeepingYouAwake/Extensions/NSUserDefaults+Keys.m +++ b/KeepingYouAwake/Extensions/NSUserDefaults+Keys.m @@ -22,7 +22,7 @@ @implementation NSUserDefaults (Keys) @dynamic kya_activateOnLaunch, kya_defaultTimeInterval, kya_notificationsEnabled; -@dynamic kya_allowDisplaySleep, kya_menuBarIconHighlightDisabled; +@dynamic kya_allowDisplaySleep; @dynamic kya_menuBarIconHighlightDisabled; @dynamic kya_batteryCapacityThresholdEnabled, kya_batteryCapacityThreshold; @dynamic kya_preReleaseUpdatesEnabled; diff --git a/KeepingYouAwake/KYALocalizedStrings.m b/KeepingYouAwake/KYALocalizedStrings.m index c7e07056..20459d37 100644 --- a/KeepingYouAwake/KYALocalizedStrings.m +++ b/KeepingYouAwake/KYALocalizedStrings.m @@ -37,6 +37,7 @@ #define KYA_L10N_ENABLE_EXPERIMENTAL_NOTIFICATION_CENTER_INTEGRATION NSLocalizedString(@"Enable experimental Notification Center integration", @"Enable experimental Notification Center integration") #define KYA_L10N_DISABLE_MENU_BAR_ICON_HIGHLIGHT_COLOR NSLocalizedString(@"Disable menu bar icon highlight color", @"Disable menu bar icon highlight color") #define KYA_L10N_QUIT_ON_TIMER_EXPIRATION NSLocalizedString(@"Quit when activation duration is over", @"Quit when activation duration is over") +#define KYA_L10N_ALLOW_DISPLAY_SLEEP NSLocalizedString(@"Allow the display to sleep", @"Allow the display to sleep") #define KYA_L10N_DURATIONS_ALERT_REALLY_RESET_TITLE NSLocalizedString(@"Reset Activation Durations", @"Reset Activation Durations") #define KYA_L10N_DURATIONS_ALERT_REALLY_RESET_MESSAGE NSLocalizedString(@"Do you really want to reset the activation durations to the default values?", @"Do you really want to reset the activation durations to the default values?") diff --git a/KeepingYouAwake/KYASleepWakeTimer/KYASleepWakeTimer.m b/KeepingYouAwake/KYASleepWakeTimer/KYASleepWakeTimer.m index c6aa3873..2861ee7f 100644 --- a/KeepingYouAwake/KYASleepWakeTimer/KYASleepWakeTimer.m +++ b/KeepingYouAwake/KYASleepWakeTimer/KYASleepWakeTimer.m @@ -85,13 +85,14 @@ - (BOOL)isScheduled - (void)spawnCaffeinateTaskForTimeInterval:(NSTimeInterval)timeInterval { NSMutableArray *arguments = [NSMutableArray new]; - if([[NSUserDefaults standardUserDefaults] kya_shouldAllowDisplaySleep]) -{ - [arguments addObject:@"-i"]; -} -else -{ - [arguments addObject:@"-di"]; + if([NSUserDefaults.standardUserDefaults kya_shouldAllowDisplaySleep]) + { + [arguments addObject:@"-i"]; + } + else + { + [arguments addObject:@"-di"]; + } if(timeInterval != KYASleepWakeTimeIntervalIndefinite) { diff --git a/KeepingYouAwake/Preferences/Advanced/KYAAdvancedPreferencesViewController.m b/KeepingYouAwake/Preferences/Advanced/KYAAdvancedPreferencesViewController.m index 9a2b9440..30a43dfa 100644 --- a/KeepingYouAwake/Preferences/Advanced/KYAAdvancedPreferencesViewController.m +++ b/KeepingYouAwake/Preferences/Advanced/KYAAdvancedPreferencesViewController.m @@ -55,7 +55,7 @@ - (void)configureAdvancedPreferences [preferences addObject:[[KYAPreference alloc] initWithTitle:KYA_L10N_QUIT_ON_TIMER_EXPIRATION defaultsKey:KYAUserDefaultsKeyIsQuitOnTimerExpirationEnabled ]]; - [preferences addObject:[[KYAPreference alloc] initWithTitle:NSLocalizedString(@"Allow the display to sleep", nil) + [preferences addObject:[[KYAPreference alloc] initWithTitle:KYA_L10N_ALLOW_DISPLAY_SLEEP defaultsKey:KYAUserDefaultsKeyAllowDisplaySleep ]];