summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-02-17 14:29:13 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-02-17 14:29:13 +0100
commite18b303818ee1ac918176ce07eb64d3d02ae122a (patch)
tree2b909d7e684acced6883166f9fcdbf2bacdaa3dd
parenta87e7625ddf38cd2e653a256899e9119505e92ac (diff)
downloadvdr-e18b303818ee1ac918176ce07eb64d3d02ae122a.tar.gz
vdr-e18b303818ee1ac918176ce07eb64d3d02ae122a.tar.bz2
Terminating timer when deleting recording
-rw-r--r--HISTORY3
-rw-r--r--i18n.c12
-rw-r--r--menu.c52
-rw-r--r--menu.h5
4 files changed, 52 insertions, 20 deletions
diff --git a/HISTORY b/HISTORY
index f2ac0d44..50f3ad98 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1009,3 +1009,6 @@ Video Disk Recorder Revision History
information about the enhanced 'timers.conf' file format, and MANUAL for
a description of the new item in the "Edit Timer" menu and the enhanced
functionality of the "Blue" button in the "Timers" menu.
+- When deleting a recording that is currently still being recorded, the related
+ timer will now automatically be terminated. If this is a repeating timer, it
+ will receive a "First day" setting that skips the timer for this day.
diff --git a/i18n.c b/i18n.c
index 487ece85..c3c5221b 100644
--- a/i18n.c
+++ b/i18n.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: i18n.c 1.54 2002/02/17 12:36:19 kls Exp $
+ * $Id: i18n.c 1.55 2002/02/17 14:29:13 kls Exp $
*
* Slovenian translations provided by Miha Setina <mihasetina@softhome.net>
* Italian translations provided by Alberto Carraro <bertocar@tin.it>
@@ -422,6 +422,16 @@ const tPhrase Phrases[] = {
"Slette opptak?",
"Poistetaanko nauhoitus?",
},
+ { "Timer still recording - really delete?",
+ "Timer zeichnet auf - trotzdem löschen?",
+ "", // TODO
+ "", // TODO
+ "", // TODO
+ "", // TODO
+ "", // TODO
+ "", // TODO
+ "", // TODO
+ },
{ "Stop recording?",
"Aufzeichnung beenden?",
"Koncaj snemanje?",
diff --git a/menu.c b/menu.c
index a48a1968..e12e0157 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 1.153 2002/02/17 13:00:13 kls Exp $
+ * $Id: menu.c 1.154 2002/02/17 14:00:54 kls Exp $
*/
#include "menu.h"
@@ -1749,26 +1749,33 @@ eOSState cMenuRecordings::Del(void)
{
cMenuRecordingItem *ri = (cMenuRecordingItem *)Get(Current());
if (ri && !ri->IsDirectory()) {
-//XXX what if this recording's file is currently in use???
-//XXX if (!ti->recording) {
- if (Interface->Confirm(tr("Delete recording?"))) {
- cRecording *recording = GetRecording(ri);
- if (recording) {
- if (recording->Delete()) {
- cReplayControl::ClearLastReplayed(ri->FileName());
- cOsdMenu::Del(Current());
- Recordings.Del(recording);
- Display();
- if (!Count())
- return osBack;
+ if (Interface->Confirm(tr("Delete recording?"))) {
+ cRecordControl *rc = cRecordControls::GetRecordControl(ri->FileName());
+ if (rc) {
+ if (Interface->Confirm(tr("Timer still recording - really delete?"))) {
+ cTimer *timer = rc->Timer();
+ if (timer) {
+ timer->SkipToday();
+ cRecordControls::Process(time(NULL));
}
- else
- Interface->Error(tr("Error while deleting recording!"));
}
+ else
+ return osContinue;
}
-//XXX }
-//XXX else
-//XXX Interface->Error(tr("Timer is recording!"));
+ cRecording *recording = GetRecording(ri);
+ if (recording) {
+ if (recording->Delete()) {
+ cReplayControl::ClearLastReplayed(ri->FileName());
+ cOsdMenu::Del(Current());
+ Recordings.Del(recording);
+ Display();
+ if (!Count())
+ return osBack;
+ }
+ else
+ Interface->Error(tr("Error while deleting recording!"));
+ }
+ }
}
return osContinue;
}
@@ -2560,6 +2567,15 @@ const char *cRecordControls::GetInstantId(const char *LastInstantId)
return NULL;
}
+cRecordControl *cRecordControls::GetRecordControl(const char *FileName)
+{
+ for (int i = 0; i < MAXDVBAPI; i++) {
+ if (RecordControls[i] && strcmp(RecordControls[i]->FileName(), FileName) == 0)
+ return RecordControls[i];
+ }
+ return NULL;
+}
+
void cRecordControls::Process(time_t t)
{
for (int i = 0; i < MAXDVBAPI; i++) {
diff --git a/menu.h b/menu.h
index 82fd6403..4a55df56 100644
--- a/menu.h
+++ b/menu.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.h 1.35 2002/01/20 13:38:34 kls Exp $
+ * $Id: menu.h 1.36 2002/02/17 13:40:41 kls Exp $
*/
#ifndef _MENU_H
@@ -92,6 +92,8 @@ public:
void Stop(bool KeepInstant = false);
bool IsInstant(void) { return instantId; }
const char *InstantId(void) { return instantId; }
+ const char *FileName(void) { return fileName; }
+ cTimer *Timer(void) { return timer; }
};
class cRecordControls {
@@ -103,6 +105,7 @@ public:
static void Stop(cDvbApi *DvbApi);
static bool StopPrimary(bool DoIt = false);
static const char *GetInstantId(const char *LastInstantId);
+ static cRecordControl *GetRecordControl(const char *FileName);
static void Process(time_t t);
static bool Active(void);
};