Skip to content

Commit

Permalink
Fixes after PR merge
Browse files Browse the repository at this point in the history
  • Loading branch information
newmarcel committed May 2, 2020
1 parent c511f95 commit ad0b956
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion KeepingYouAwake/Extensions/NSUserDefaults+Keys.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions KeepingYouAwake/KYALocalizedStrings.m
Original file line number Diff line number Diff line change
Expand Up @@ -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?")
Expand Down
15 changes: 8 additions & 7 deletions KeepingYouAwake/KYASleepWakeTimer/KYASleepWakeTimer.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
]];

Expand Down

0 comments on commit ad0b956

Please sign in to comment.