Add "Timer On/Off" to recmenu

This commit is contained in:
kamel5 2020-08-04 15:08:37 +02:00
parent bf3a8a430b
commit 69356e9c43
10 changed files with 77 additions and 30 deletions

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
"PO-Revision-Date: 2013-09-21 17:49+0200\n"
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
"Language-Team: \n"
@ -105,12 +105,15 @@ msgstr ""
msgid "Instant Record"
msgstr "Enregistra a l'instant"
msgid "Delete Timer"
msgstr "Esborra temporitzador"
msgid "Timer On/Off"
msgstr "Temporitzador On/Off"
msgid "Edit Timer"
msgstr "Edita temporitzador"
msgid "Delete Timer"
msgstr "Esborra temporitzador"
msgid "Timer Timeline"
msgstr ""

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n"
"Language-Team: \n"
@ -102,12 +102,15 @@ msgstr "erledigte Aufnahmen"
msgid "Instant Record"
msgstr "Aufnahme"
msgid "Delete Timer"
msgstr "Timer löschen"
msgid "Timer On/Off"
msgstr "Timer Ein/Aus"
msgid "Edit Timer"
msgstr "Timer bearbeiten"
msgid "Delete Timer"
msgstr "Timer löschen"
msgid "Timer Timeline"
msgstr "Timer Tagesübersicht"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: fiveten_59\n"
"Language-Team: \n"
@ -102,12 +102,15 @@ msgstr "registrazione eseguita"
msgid "Instant Record"
msgstr "Registrazione immediata"
msgid "Delete Timer"
msgstr "Cancella il Timer"
msgid "Timer On/Off"
msgstr "Timer On/Off"
msgid "Edit Timer"
msgstr "Edita il Timer"
msgid "Delete Timer"
msgstr "Cancella il Timer"
msgid "Timer Timeline"
msgstr "Scadenza del Timer"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.0.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
"PO-Revision-Date: 2013-09-25 17:49+0400\n"
"Last-Translator: AmiD, ilya\n"
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
@ -102,12 +102,15 @@ msgstr ""
msgid "Instant Record"
msgstr "Записать"
msgid "Delete Timer"
msgstr "Удалить таймер"
msgid "Timer On/Off"
msgstr "таймер Вкл/Выкл"
msgid "Edit Timer"
msgstr "Редактировать таймер"
msgid "Delete Timer"
msgstr "Удалить таймер"
msgid "Timer Timeline"
msgstr ""

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.1.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2020-02-17 14:30+0100\n"
"POT-Creation-Date: 2020-08-04 14:15+0200\n"
"PO-Revision-Date: 2013-09-15 00:12+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@ -102,12 +102,15 @@ msgstr ""
msgid "Instant Record"
msgstr "Okam¾ite nahra»"
msgid "Delete Timer"
msgstr "Vymaza» plán nahrávania"
msgid "Timer On/Off"
msgstr "Zap./Vyp. plán nahrávania"
msgid "Edit Timer"
msgstr "Upravi» plán nahrávania"
msgid "Delete Timer"
msgstr "Vymaza» plán nahrávania"
msgid "Timer Timeline"
msgstr ""

View File

@ -267,6 +267,21 @@ void cRecManager::DeleteRemoteTimer(const cEvent *event) {
}
}
void cRecManager::OnOffTimer(const cEvent *event) {
const cTimer *t;
#if VDRVERSNUM >= 20301
{
LOCK_TIMERS_READ;
t = Timers->GetMatch(event);
}
#else
t = Timers.GetMatch(event);
#endif
if (!t)
return;
SaveTimer(t);
}
void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
if (!t)
return;
@ -288,7 +303,9 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
if (!timer) {
return;
}
bool active = newTimerSettings->HasFlags(tfActive);
bool active = true;
if (newTimerSettings) {
int prio = newTimerSettings->Priority();
int lifetime = newTimerSettings->Lifetime();
time_t day = newTimerSettings->Day();
@ -303,6 +320,10 @@ void cRecManager::SaveTimer(const cTimer *t, cTimer *newTimerSettings) {
timer->SetLifetime(lifetime);
timer->SetFile(fileName.c_str());
active = newTimerSettings->HasFlags(tfActive);
} else
active = !timer->HasFlags(tfActive);
if (active)
timer->SetFlags(tfActive);
else

View File

@ -33,11 +33,12 @@ public:
cTimer *createLocalTimer(const cEvent *event, std::string path);
cTimer *createRemoteTimer(const cEvent *event, std::string path);
void SetTimerPath(cTimer *timer, const cEvent *event, std::string path);
void OnOffTimer(const cEvent *event);
void DeleteTimer(const cTimer *timer);
void DeleteTimer(const cEvent *event);
void DeleteLocalTimer(const cEvent *event);
void DeleteRemoteTimer(const cEvent *event);
void SaveTimer(const cTimer *timer, cTimer *newTimerSettings);
void SaveTimer(const cTimer *timer, cTimer *newTimerSettings = NULL);
bool IsRecorded(const cEvent *event);
cTVGuideTimerConflicts *CheckTimerConflict(void);
void CreateSeriesTimer(cTimer *seriesTimer);

View File

@ -25,6 +25,7 @@ enum eRecMenuState {
rmsSearchRerunsTimerConflictMenu,
rmsSaveTimerConflictMenu,
rmsTimerConflictShowInfo,
rmsOnOffTimer,
rmsDeleteTimer,
rmsDeleteTimerConfirmation,
rmsEditTimer,

View File

@ -11,8 +11,9 @@ cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switc
action = rmsInstantRecordFolder;
AddMenuItem(new cRecMenuItemButton(tr("Instant Record"), action, true, false, false, true));
} else {
AddMenuItem(new cRecMenuItemButton(tr("Delete Timer"), rmsDeleteTimer, true, false, false, true));
AddMenuItem(new cRecMenuItemButton(tr("Timer On/Off"), rmsOnOffTimer, true, false, false, true));
AddMenuItem(new cRecMenuItemButton(tr("Edit Timer"), rmsEditTimer, false, false, false, true));
AddMenuItem(new cRecMenuItemButton(tr("Delete Timer"), rmsDeleteTimer, false, false, false, true));
}
AddMenuItem(new cRecMenuItemButton(tr("Timer Timeline"), rmsTimeline, false, false, false, true));

View File

@ -177,6 +177,14 @@ eOSState cRecMenuView::StateMachine(eRecMenuState nextState) {
activeMenu = new cRecMenuAskFolder(event, rmsInstantRecord);
activeMenu->Display();
break;
case rmsOnOffTimer: {
//caller: main menu
//De/Activate timer for active event
recManager->OnOffTimer(event);
delete activeMenu;
activeMenu = new cRecMenuConfirmTimer(event, true);
activeMenu->Display();
break; }
case rmsDeleteTimer: {
//caller: main menu
//delete timer for active event