Skip to content

Commit

Permalink
Removed info.marcel-dierkes.KeepingYouAwake.AllowDisplaySleep preference
Browse files Browse the repository at this point in the history
  • Loading branch information
newmarcel committed Dec 30, 2016
1 parent 91ccbac commit 02d5be9
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 47 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
- *Thank you [rei-vilo](https://github.com/rei-vilo)!*
- Korean ([Issue #64](https://github.com/newmarcel/KeepingYouAwake/pull/64))
- *Thank you [Pusnow](https://github.com/Pusnow)!*
- removed advanced preference to allow the display to sleep *(didn't work properly and lead to confusion)*
- the `info.marcel-dierkes.KeepingYouAwake.AllowDisplaySleep` preference was removed
- a similar, more powerful replacement feature will be introduced soon

### v1.4 ###

Expand Down
3 changes: 0 additions & 3 deletions KeepingYouAwake/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/* Enable experimental Notification Center integration */
"Enable experimental Notification Center integration" = "Enable experimental Notification Center integration";

/* Allow the display to sleep (when connected to AC power) */
"Allow the display to sleep (when connected to AC power)" = "Allow the display to sleep (when connected to AC power)";

/* Disable menu bar icon highlight color */
"Disable menu bar icon highlight color" = "Disable menu bar icon highlight color";

Expand Down
6 changes: 0 additions & 6 deletions KeepingYouAwake/Extensions/NSUserDefaults+Keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ NS_ASSUME_NONNULL_BEGIN
extern NSString * const KYAUserDefaultsKeyActivateOnLaunch;
extern NSString * const KYAUserDefaultsKeyNotificationsEnabled;
extern NSString * const KYAUserDefaultsKeyDefaultTimeInterval;
extern NSString * const KYAUserDefaultsKeyAllowDisplaySleep;
extern NSString * const KYAUserDefaultsKeyMenuBarIconHighlightDisabled;
extern NSString * const KYAUserDefaultsKeyBatteryCapacityThresholdEnabled;
extern NSString * const KYAUserDefaultsKeyBatteryCapacityThreshold;
Expand All @@ -37,11 +36,6 @@ extern NSString * const KYAUserDefaultsKeyPreReleaseUpdatesEnabled;
*/
@property (nonatomic) NSTimeInterval kya_defaultTimeInterval;

/**
* Returns YES if the app should allow the display to sleep while still keeping the system awake (AC-only). This exposes the `caffeinate -s` command.
*/
@property (nonatomic, getter = kya_shouldAllowDisplaySleep) BOOL kya_allowDisplaySleep;

/**
* Returns YES if the menu bar icon should not be highlighted on left and right click.
*/
Expand Down
15 changes: 1 addition & 14 deletions KeepingYouAwake/Extensions/NSUserDefaults+Keys.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
NSString * const KYAUserDefaultsKeyActivateOnLaunch = @"info.marcel-dierkes.KeepingYouAwake.ActivateOnLaunch";
NSString * const KYAUserDefaultsKeyNotificationsEnabled = @"info.marcel-dierkes.KeepingYouAwake.NotificationsEnabled";
NSString * const KYAUserDefaultsKeyDefaultTimeInterval = @"info.marcel-dierkes.KeepingYouAwake.TimeInterval";
NSString * const KYAUserDefaultsKeyAllowDisplaySleep = @"info.marcel-dierkes.KeepingYouAwake.AllowDisplaySleep";
NSString * const KYAUserDefaultsKeyMenuBarIconHighlightDisabled = @"info.marcel-dierkes.KeepingYouAwake.MenuBarIconHighlightDisabled";

NSString * const KYAUserDefaultsKeyBatteryCapacityThresholdEnabled = @"info.marcel-dierkes.KeepingYouAwake.BatteryCapacityThresholdEnabled";
Expand All @@ -21,7 +20,7 @@

@implementation NSUserDefaults (Keys)
@dynamic kya_activateOnLaunch, kya_defaultTimeInterval, kya_notificationsEnabled;
@dynamic kya_allowDisplaySleep, kya_menuBarIconHighlightDisabled;
@dynamic kya_menuBarIconHighlightDisabled;
@dynamic kya_batteryCapacityThresholdEnabled, kya_batteryCapacityThreshold;
@dynamic kya_preReleaseUpdatesEnabled;

Expand Down Expand Up @@ -61,18 +60,6 @@ - (void)setKya_defaultTimeInterval:(NSTimeInterval)defaultTimeInterval
[self setInteger:(NSInteger)defaultTimeInterval forKey:KYAUserDefaultsKeyDefaultTimeInterval]; // decimal places will be cut-off
}

#pragma mark - Allow Display Sleep

- (BOOL)kya_shouldAllowDisplaySleep
{
return [self boolForKey:KYAUserDefaultsKeyAllowDisplaySleep];
}

- (void)setKya_allowDisplaySleep:(BOOL)allowDisplaySleep
{
[self setBool:allowDisplaySleep forKey:KYAUserDefaultsKeyAllowDisplaySleep];
}

#pragma mark - Menu Bar Icon Highlight Disabled

- (BOOL)kya_isMenuBarIconHighlightDisabled
Expand Down
10 changes: 1 addition & 9 deletions KeepingYouAwake/KYASleepWakeTimer.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,7 @@ - (BOOL)isScheduled
- (void)spawnCaffeinateTaskForTimeInterval:(NSTimeInterval)timeInterval
{
NSMutableArray *arguments = [NSMutableArray new];

if([[NSUserDefaults standardUserDefaults] kya_shouldAllowDisplaySleep])
{
[arguments addObject:@"-s"];
}
else
{
[arguments addObject:@"-di"];
}
[arguments addObject:@"-di"];

if(timeInterval != KYASleepWakeTimeIntervalIndefinite)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ - (void)configureAdvancedPreferences
defaultsKey:KYAUserDefaultsKeyNotificationsEnabled
]];

[preferences addObject:[[KYAPreference alloc] initWithTitle:NSLocalizedString(@"Allow the display to sleep (when connected to AC power)", @"Allow the display to sleep (when connected to AC power)")
defaultsKey:KYAUserDefaultsKeyAllowDisplaySleep
]];

[preferences addObject:[[KYAPreference alloc] initWithTitle:NSLocalizedString(@"Disable menu bar icon highlight color", @"Disable menu bar icon highlight color")
defaultsKey:KYAUserDefaultsKeyMenuBarIconHighlightDisabled
]];
Expand Down
3 changes: 0 additions & 3 deletions KeepingYouAwake/fr.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* Allow the display to sleep (when connected to AC power) */
"Allow the display to sleep (when connected to AC power)" = "Autoriser la mise en veille de l'écran (avec alimentation sur secteur)";

/* Allowing your Mac to go to sleep… */
"Allowing your Mac to go to sleep…" = "Autoriser la mise en veille du Mac…";

Expand Down
4 changes: 0 additions & 4 deletions Localizations/KeepingYouAwake/de.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,6 @@
<tool tool-id="com.apple.dt.xcode" tool-name="Xcode" tool-version="8.0" build-num="8S201h"/>
</header>
<body>
<trans-unit id="Allow the display to sleep (when connected to AC power)">
<source>Allow the display to sleep (when connected to AC power)</source>
<note>Allow the display to sleep (when connected to AC power)</note>
</trans-unit>
<trans-unit id="Allowing your Mac to go to sleep…">
<source>Allowing your Mac to go to sleep…</source>
<target>Ruhezustand erlauben…</target>
Expand Down
4 changes: 0 additions & 4 deletions Localizations/KeepingYouAwake/ko.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,6 @@
<tool tool-id="com.apple.dt.xcode" tool-name="Xcode" tool-version="8.0" build-num="8S201h"/>
</header>
<body>
<trans-unit id="Allow the display to sleep (when connected to AC power)">
<source>Allow the display to sleep (when connected to AC power)</source>
<note>Allow the display to sleep (when connected to AC power)</note>
</trans-unit>
<trans-unit id="Allowing your Mac to go to sleep…">
<source>Allowing your Mac to go to sleep…</source>
<target>잠자기를 허용합니다…</target>
Expand Down

0 comments on commit 02d5be9

Please sign in to comment.