1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

The 'new' indicator in the Recordings menu is now kept up-to-date

This commit is contained in:
Klaus Schmidinger 2005-09-25 11:35:56 +02:00
parent 9e8aac3882
commit da501a4b82
5 changed files with 32 additions and 3 deletions

View File

@ -1465,6 +1465,7 @@ Thomas G
for suggesting to move cMenuEditTimer and cMenuEvent to menu.h so that plugins for suggesting to move cMenuEditTimer and cMenuEvent to menu.h so that plugins
can use it can use it
for fixing converting arbitrarily formatted summary.vdr files for fixing converting arbitrarily formatted summary.vdr files
for making the 'new' indicator in the Recordings menu kept up-to-date
David Woodhouse <dwmw2@infradead.org> David Woodhouse <dwmw2@infradead.org>
for his help in replacing the get/put_unaligned() macros from asm/unaligned.h with for his help in replacing the get/put_unaligned() macros from asm/unaligned.h with

View File

@ -3841,3 +3841,5 @@ Video Disk Recorder Revision History
into the respective code block. Thanks to Carsten Koch for his help in testing into the respective code block. Thanks to Carsten Koch for his help in testing
and debugging this. and debugging this.
- The 'new' indicator in the Recordings menu is now kept up-to-date (thanks to
Thomas Günther).

11
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 1.360 2005/09/25 09:45:01 kls Exp $ * $Id: menu.c 1.361 2005/09/25 11:30:55 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -2221,6 +2221,8 @@ cMenuSetupRecord::cMenuSetupRecord(void)
// --- cMenuSetupReplay ------------------------------------------------------ // --- cMenuSetupReplay ------------------------------------------------------
class cMenuSetupReplay : public cMenuSetupBase { class cMenuSetupReplay : public cMenuSetupBase {
protected:
virtual void Store(void);
public: public:
cMenuSetupReplay(void); cMenuSetupReplay(void);
}; };
@ -2233,6 +2235,13 @@ cMenuSetupReplay::cMenuSetupReplay(void)
Add(new cMenuEditIntItem(tr("Setup.Replay$Resume ID"), &data.ResumeID, 0, 99)); Add(new cMenuEditIntItem(tr("Setup.Replay$Resume ID"), &data.ResumeID, 0, 99));
} }
void cMenuSetupReplay::Store(void)
{
if (Setup.ResumeID != data.ResumeID)
Recordings.ResetResume();
cMenuSetupBase::Store();
}
// --- cMenuSetupMisc -------------------------------------------------------- // --- cMenuSetupMisc --------------------------------------------------------
class cMenuSetupMisc : public cMenuSetupBase { class cMenuSetupMisc : public cMenuSetupBase {

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: recording.c 1.115 2005/09/25 10:40:31 kls Exp $ * $Id: recording.c 1.116 2005/09/25 11:31:52 kls Exp $
*/ */
#include "recording.h" #include "recording.h"
@ -215,6 +215,7 @@ bool cResumeFile::Save(int Index)
if (safe_write(f, &Index, sizeof(Index)) < 0) if (safe_write(f, &Index, sizeof(Index)) < 0)
LOG_ERROR_STR(fileName); LOG_ERROR_STR(fileName);
close(f); close(f);
Recordings.ResetResume(fileName);
return true; return true;
} }
} }
@ -226,6 +227,7 @@ void cResumeFile::Delete(void)
if (fileName) { if (fileName) {
if (remove(fileName) < 0 && errno != ENOENT) if (remove(fileName) < 0 && errno != ENOENT)
LOG_ERROR_STR(fileName); LOG_ERROR_STR(fileName);
Recordings.ResetResume(fileName);
} }
} }
@ -732,6 +734,11 @@ bool cRecording::Remove(void)
return RemoveVideoFile(FileName()); return RemoveVideoFile(FileName());
} }
void cRecording::ResetResume(void) const
{
resume = RESUME_NOT_INITIALIZED;
}
// --- cRecordings ----------------------------------------------------------- // --- cRecordings -----------------------------------------------------------
cRecordings Recordings; cRecordings Recordings;
@ -860,6 +867,14 @@ void cRecordings::DelByName(const char *FileName)
} }
} }
void cRecordings::ResetResume(const char *ResumeFileName)
{
for (cRecording *recording = First(); recording; recording = Next(recording)) {
if (!ResumeFileName || strncmp(ResumeFileName, recording->FileName(), strlen(recording->FileName())) == 0)
recording->ResetResume();
}
}
// --- cMark ----------------------------------------------------------------- // --- cMark -----------------------------------------------------------------
cMark::cMark(int Position, const char *Comment) cMark::cMark(int Position, const char *Comment)

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: recording.h 1.41 2005/09/25 10:07:40 kls Exp $ * $Id: recording.h 1.42 2005/09/25 11:31:28 kls Exp $
*/ */
#ifndef __RECORDING_H #ifndef __RECORDING_H
@ -79,6 +79,7 @@ public:
const cRecordingInfo *Info(void) const { return info; } const cRecordingInfo *Info(void) const { return info; }
const char *PrefixFileName(char Prefix); const char *PrefixFileName(char Prefix);
int HierarchyLevels(void) const; int HierarchyLevels(void) const;
void ResetResume(void) const;
bool IsNew(void) const { return GetResume() <= 0; } bool IsNew(void) const { return GetResume() <= 0; }
bool IsEdited(void) const; bool IsEdited(void) const;
bool WriteInfo(void); bool WriteInfo(void);
@ -116,6 +117,7 @@ public:
bool NeedsUpdate(void); bool NeedsUpdate(void);
void ChangeState(void) { state++; } void ChangeState(void) { state++; }
bool StateChanged(int &State); bool StateChanged(int &State);
void ResetResume(const char *ResumeFileName = NULL);
cRecording *GetByName(const char *FileName); cRecording *GetByName(const char *FileName);
void AddByName(const char *FileName); void AddByName(const char *FileName);
void DelByName(const char *FileName); void DelByName(const char *FileName);