Fixed keeping the cursor position in the Recordings menu in case a timer starts recording while the menu is open

This commit is contained in:
Klaus Schmidinger 2018-02-10 12:34:10 +01:00
parent 30650b9c13
commit 902c83ece3
2 changed files with 9 additions and 7 deletions

View File

@ -9264,3 +9264,5 @@ Video Disk Recorder Revision History
- Added a note about the fixed UDP port for SVDRP discovery to vdr.1. - Added a note about the fixed UDP port for SVDRP discovery to vdr.1.
- Fixed updating the Timers menu after turning a local timer on/off with the Red - Fixed updating the Timers menu after turning a local timer on/off with the Red
button. button.
- Fixed keeping the cursor position in the Recordings menu in case a timer starts
recording while the menu is open.

14
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: menu.c 4.58 2018/02/10 10:51:49 kls Exp $ * $Id: menu.c 4.59 2018/02/10 12:32:52 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -2989,17 +2989,17 @@ void cMenuRecordings::Set(bool Refresh)
{ {
if (cRecordings::GetRecordingsRead(recordingsStateKey)) { if (cRecordings::GetRecordingsRead(recordingsStateKey)) {
recordingsStateKey.Remove(); recordingsStateKey.Remove();
const char *CurrentRecording = *fileName ? *fileName : cReplayControl::LastReplayed();
cRecordings *Recordings = cRecordings::GetRecordingsWrite(recordingsStateKey); // write access is necessary for sorting! cRecordings *Recordings = cRecordings::GetRecordingsWrite(recordingsStateKey); // write access is necessary for sorting!
cMenuRecordingItem *LastItem = NULL; const char *CurrentRecording = NULL;
if (!CurrentRecording) { if (cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current()))
if (cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current())) CurrentRecording = ri->Recording()->FileName();
CurrentRecording = ri->Recording()->FileName(); if (!CurrentRecording)
} CurrentRecording = *fileName ? *fileName : cReplayControl::LastReplayed();
int current = Current(); int current = Current();
Clear(); Clear();
GetRecordingsSortMode(DirectoryName()); GetRecordingsSortMode(DirectoryName());
Recordings->Sort(); Recordings->Sort();
cMenuRecordingItem *LastItem = NULL;
for (const cRecording *Recording = Recordings->First(); Recording; Recording = Recordings->Next(Recording)) { for (const cRecording *Recording = Recordings->First(); Recording; Recording = Recordings->Next(Recording)) {
if ((!filter || filter->Filter(Recording)) && (!base || (strstr(Recording->Name(), base) == Recording->Name() && Recording->Name()[strlen(base)] == FOLDERDELIMCHAR))) { if ((!filter || filter->Filter(Recording)) && (!base || (strstr(Recording->Name(), base) == Recording->Name() && Recording->Name()[strlen(base)] == FOLDERDELIMCHAR))) {
cMenuRecordingItem *Item = new cMenuRecordingItem(Recording, level); cMenuRecordingItem *Item = new cMenuRecordingItem(Recording, level);