feat: make "Pause updates" optional
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
/** default: @c nil */ static NSString* const Pref_notificationType = @"notificationType";
|
||||
// ------ Appearance matrix ------ (Preferences > Appearance Tab) ------
|
||||
// menu buttons
|
||||
/** default: @c YES */ static NSString* const Pref_globalPauseUpdates = @"globalPauseUpdates";
|
||||
/** default: @c NO */ static NSString* const Pref_globalToggleHidden = @"globalToggleHidden";
|
||||
/** default: @c YES */ static NSString* const Pref_globalUpdateAll = @"globalUpdateAll";
|
||||
/** default: @c YES */ static NSString* const Pref_groupUpdateAll = @"groupUpdateAll";
|
||||
|
||||
@@ -12,6 +12,7 @@ void UserPrefsInit(void) {
|
||||
NSMutableDictionary *defs = [NSMutableDictionary dictionary];
|
||||
defaultsAppend(defs, @YES, @[
|
||||
Pref_globalTintMenuIcon,
|
||||
Pref_globalPauseUpdates,
|
||||
Pref_globalUpdateAll, Pref_groupUpdateAll, Pref_feedUpdateAll,
|
||||
Pref_globalOpenUnread, Pref_groupOpenUnread, Pref_feedOpenUnread,
|
||||
Pref_globalMarkRead, Pref_groupMarkRead, Pref_feedMarkRead,
|
||||
|
||||
@@ -49,6 +49,11 @@
|
||||
RSSImageSettingsFeed, NSLocalizedString(@"Feed menu", nil),
|
||||
]];
|
||||
|
||||
[self entry:NSLocalizedString(@"“Pause updates”", nil)
|
||||
help:NSLocalizedString(@"Show button to temporarily disable feed updates. E.g., no distrations during focus hours.", nil)
|
||||
tip:nil
|
||||
c1:Pref_globalPauseUpdates c2:nil c3:nil c4:nil];
|
||||
|
||||
[self entry:NSLocalizedString(@"“Show hidden feeds”", nil)
|
||||
help:NSLocalizedString(@"Show button to quickly toggle whether hidden entries should be shown. See option “Show only unread”.", nil)
|
||||
tip:NSLocalizedString(@"You can hold down option-key before opening the main menu to temporarily show all hidden entries.", nil)
|
||||
|
||||
@@ -179,10 +179,12 @@
|
||||
|
||||
- (void)insertMainMenuHeader:(NSMenu*)menu {
|
||||
// 'Pause Updates' item
|
||||
NSMenuItem *pause = [menu addItemWithTitle:NSLocalizedString(@"Pause updates", nil) action:@selector(pauseUpdates) keyEquivalent:@""];
|
||||
pause.target = self;
|
||||
if ([UpdateScheduler isPaused])
|
||||
pause.title = NSLocalizedString(@"Resume updates", nil);
|
||||
if (UserPrefsBool(Pref_globalPauseUpdates)) {
|
||||
NSMenuItem *pause = [menu addItemWithTitle:NSLocalizedString(@"Pause updates", nil) action:@selector(pauseUpdates) keyEquivalent:@""];
|
||||
pause.target = self;
|
||||
if ([UpdateScheduler isPaused])
|
||||
pause.title = NSLocalizedString(@"Resume updates", nil);
|
||||
}
|
||||
|
||||
// 'show hidden feeds' item
|
||||
if (UserPrefsBool(Pref_globalToggleHidden)) {
|
||||
@@ -197,8 +199,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Separator between main header and default header
|
||||
[menu addItem:[NSMenuItem separatorItem]];
|
||||
if (menu.numberOfItems > 0) {
|
||||
// Separator between main header and default header
|
||||
[menu addItem:[NSMenuItem separatorItem]];
|
||||
}
|
||||
}
|
||||
|
||||
/// Called when user clicks on 'Pause Updates' (main menu only).
|
||||
|
||||
Reference in New Issue
Block a user