From 295efb1e0767f393ad9f5f2f7a45264c7b2b51b9 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Sun, 14 Oct 2012 07:41:21 +0200 Subject: [PATCH] * Timerlist: Ask if the timer of a running recording to be deleted. --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/timerlist.cpp | 25 ++++++++++++++++++++++--- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index aee35cc1e..1ceef9b91 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1664,6 +1664,7 @@ timerbar.recordevent Aufnehmen timerlist.alarmtime Alarmzeit timerlist.apids Audio PIDs timerlist.apids_dflt Voreingestellte Tonspuren aufn. +timerlist.ask_to_delete Das Löschen des Timers beendet auch die laufende Aufnahme!\n%sTrotzdem fortsetzen? timerlist.bouquetselect Bouquet wählen timerlist.channel Kanal timerlist.channelselect Kanal wählen diff --git a/data/locale/english.locale b/data/locale/english.locale index d6c2b9976..61268eaa1 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1664,6 +1664,7 @@ timerbar.recordevent Record timerlist.alarmtime Alarm time timerlist.apids Audio PIDs timerlist.apids_dflt record default audio streams +timerlist.ask_to_delete Deleting of the timer ends the current recording\n%sTo continue anyway? timerlist.bouquetselect choose bouquet timerlist.channel Channel timerlist.channelselect choose channel diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index f5835073f..99dbd4591 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -571,9 +572,27 @@ int CTimerList::show() } else if ((msg == CRCInput::RC_red) && !(timerlist.empty())) { - Timer->removeTimerEvent(timerlist[selected].eventID); - skipEventID=timerlist[selected].eventID; - update=true; + bool killTimer = true; + if (CRecordManager::getInstance()->RecordingStatus(timerlist[selected].channel_id)) { + std::string title = ""; + char buf1[1024]; + CEPGData epgdata; + CEitManager::getInstance()->getEPGid(timerlist[selected].epgID, timerlist[selected].epg_starttime, &epgdata); + memset(buf1, '\0', sizeof(buf1)); + if (epgdata.title != "") + title = "(" + epgdata.title + ")\n"; + snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_TIMERLIST_ASK_TO_DELETE), title.c_str()); + if(ShowMsgUTF(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, + CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) { + killTimer = false; + update = false; + } + } + if (killTimer) { + Timer->removeTimerEvent(timerlist[selected].eventID); + skipEventID=timerlist[selected].eventID; + update = true; + } } else if (msg==CRCInput::RC_green) { diff --git a/src/system/locals.h b/src/system/locals.h index 857ffefc8..c2abe62f3 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1691,6 +1691,7 @@ typedef enum LOCALE_TIMERLIST_ALARMTIME, LOCALE_TIMERLIST_APIDS, LOCALE_TIMERLIST_APIDS_DFLT, + LOCALE_TIMERLIST_ASK_TO_DELETE, LOCALE_TIMERLIST_BOUQUETSELECT, LOCALE_TIMERLIST_CHANNEL, LOCALE_TIMERLIST_CHANNELSELECT, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 7f13792bb..a3047b3cd 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1691,6 +1691,7 @@ const char * locale_real_names[] = "timerlist.alarmtime", "timerlist.apids", "timerlist.apids_dflt", + "timerlist.ask_to_delete", "timerlist.bouquetselect", "timerlist.channel", "timerlist.channelselect",