From c86481f74ab397d0c60ce56b689f08f0a9af6f09 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 27 Jun 2025 09:05:20 +0200 Subject: [PATCH] In the "Timers" menu the '0' key now toggles between showing all timers and only the active ones --- CONTRIBUTORS | 2 ++ HISTORY | 2 ++ MANUAL | 2 ++ menu.c | 18 ++++++++++++++---- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 2e9ac3dc..bff40c9a 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3464,6 +3464,8 @@ Matthias Senzel for reporting a bug in handling cSkinDisplayMenu::GetTextAreaFont() for reporting characters being cut off while editing in the LCARS skin for fixing updating the index when cutting a recording again + for making the '0' key in the "Timers" menu toggle between showing all timers and only + the active ones Marek Nazarko for translating OSD texts to the Polish language diff --git a/HISTORY b/HISTORY index ca132870..e91f52a5 100644 --- a/HISTORY +++ b/HISTORY @@ -10143,3 +10143,5 @@ Video Disk Recorder Revision History - Fixed cPoller::Poll() to allow negative timeout values again. - When regenerating the index of a recording, PID changes are now taken into account (reported by Christoph Haubrich). +- In the "Timers" menu the '0' key now toggles between showing all timers and only + the active ones (thanks to Matthias Senzel). diff --git a/MANUAL b/MANUAL index b03a4dee..852ec3ae 100644 --- a/MANUAL +++ b/MANUAL @@ -93,6 +93,8 @@ Version 2.7 (3) In the "Edit timer" menu, when on the "Day" item, the '0' key toggles between a single shot and a repeating timer. If "Day" indicates a repeating timer, the keys '1'...'7' can be used to toggle the individual days ('1' is Monday). + In the "Timers" menu the '0' key toggles between showing all timers and only + the active ones. * Navigating through the On Screen Menus diff --git a/menu.c b/menu.c index 5a9f7fbc..dca61aa9 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 5.29 2025/06/20 14:02:57 kls Exp $ + * $Id: menu.c 5.30 2025/06/27 09:05:20 kls Exp $ */ #include "menu.h" @@ -1305,6 +1305,7 @@ class cMenuTimers : public cOsdMenu { private: cStateKey timersStateKey; int helpKeys; + bool showAllTimers; void Set(void); eOSState Edit(void); eOSState New(void); @@ -1324,6 +1325,7 @@ cMenuTimers::cMenuTimers(void) { SetMenuCategory(mcTimer); helpKeys = -1; + showAllTimers = true; cMenuEditTimer::AddedTimer(); // to clear any leftovers Set(); } @@ -1342,9 +1344,11 @@ void cMenuTimers::Set(void) LOCK_SCHEDULES_READ; for (const cTimer *Timer = Timers->First(); Timer; Timer = Timers->Next(Timer)) { cMenuTimerItem *Item = new cMenuTimerItem(Timer); - Add(Item); - if (CurrentTimer && Timer->Id() == CurrentTimer->Id() && (!Timer->Remote() && !CurrentTimer->Remote() || Timer->Remote() && CurrentTimer->Remote() && strcmp(Timer->Remote(), CurrentTimer->Remote()) == 0)) - CurrentItem = Item; + if (showAllTimers || Timer->HasFlags(tfActive)) { + Add(Item); + if (CurrentTimer && Timer->Id() == CurrentTimer->Id() && (!Timer->Remote() && !CurrentTimer->Remote() || Timer->Remote() && CurrentTimer->Remote() && strcmp(Timer->Remote(), CurrentTimer->Remote()) == 0)) + CurrentItem = Item; + } } } Sort(); @@ -1473,8 +1477,10 @@ eOSState cMenuTimers::ProcessKey(eKeys Key) if (!HasSubMenu()) Set(); eOSState state = cOsdMenu::ProcessKey(Key); + bool oldShowAllTimers = showAllTimers; if (state == osUnknown) { switch (Key) { + case k0: showAllTimers = !showAllTimers; break; case kOk: return Edit(); case kRed: state = OnOff(); break; // must go through SetHelpKeys()! case kGreen: return New(); @@ -1495,6 +1501,10 @@ eOSState cMenuTimers::ProcessKey(eKeys Key) SetHelpKeys(); Display(); } + if (showAllTimers != oldShowAllTimers) { + timersStateKey.Reset(); + Set(); + } if (Key != kNone) SetHelpKeys(); return state;