timer edit menu with ok in timeline

This commit is contained in:
louis 2014-01-03 11:56:45 +01:00
parent 5bd0ad2603
commit da40191cfc
7 changed files with 51 additions and 19 deletions

View File

@ -79,7 +79,7 @@ msgid "No Timers active"
msgstr "Keine Timer aktiv"
msgid "Instant Record"
msgstr "Sofortaufnahme"
msgstr "Aufnahme"
msgid "Delete Timer"
msgstr "Timer löschen"

View File

@ -463,6 +463,15 @@ const cEvent *cRecMenu::GetEventValue(int itemNumber) {
return NULL;
}
cTimer *cRecMenu::GetTimerValue(int itemNumber) {
cRecMenuItem *item = NULL;
item = menuItems.Get(itemNumber);
if (item) {
return item->GetTimerValue();
}
return NULL;
}
eRecMenuState cRecMenu::ProcessKey(eKeys Key) {
cRecMenuItem *activeItem = GetActiveMenuItem();
eRecMenuState state = rmsContinue;

View File

@ -58,6 +58,7 @@ public:
bool GetBoolValue(int itemNumber);
cString GetStringValue(int itemNumber);
const cEvent *GetEventValue(int itemNumber);
cTimer *GetTimerValue(int itemNumber);
virtual eRecMenuState ProcessKey(eKeys Key);
};
#endif //__TVGUIDE_RECMENU_H

View File

@ -2401,14 +2401,14 @@ void cRecMenuItemTimelineTimer::Show(void) {
pixmapTimerConflicts->SetLayer(6);
}
const cEvent *cRecMenuItemTimelineTimer::GetEventValue(void) {
return timer->Event();
cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) {
return timer;
}
eRecMenuState cRecMenuItemTimelineTimer::ProcessKey(eKeys Key) {
switch (Key & ~k_Repeat) {
case kOk:
return rmsTimelineInfo;
return rmsTimelineTimerEdit;
default:
break;
}

View File

@ -56,7 +56,9 @@ enum eRecMenuState {
rmsTimerConflictIgnoreReruns,
rmsTimerConflictRecordRerun,
rmsTimeline,
rmsTimelineInfo,
rmsTimelineTimerEdit,
rmsTimelineTimerSave,
rmsTimelineTimerDelete,
rmsDisabled,
};
@ -99,6 +101,7 @@ public:
virtual bool GetBoolValue(void) { return false; };
virtual cString GetStringValue(void) { return cString(""); };
virtual const cEvent *GetEventValue(void) { return NULL; };
virtual cTimer *GetTimerValue(void) { return NULL; };
virtual eRecMenuState ProcessKey(eKeys Key) { return rmsNotConsumed; };
};
@ -534,7 +537,7 @@ public:
void Hide(void);
void Show(void);
void Draw(void);
const cEvent *GetEventValue(void);
cTimer *GetTimerValue(void);
eRecMenuState ProcessKey(eKeys Key);
};

View File

@ -536,20 +536,34 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
activeMenu = new cRecMenuTimeline(timerConflicts);
activeMenu->Display();
break; }
case rmsTimelineInfo: {
const cEvent *ev = activeMenu->GetEventValue(activeMenu->GetActive(true));
if (ev) {
activeMenu->Hide();
detailView = new cDetailView(ev);
detailView->setContent();
detailView->drawHeader();
detailView->drawContent();
detailView->drawScrollbar();
detailView->Start();
detailViewActive = true;
case rmsTimelineTimerEdit: {
timer = activeMenu->GetTimerValue(activeMenu->GetActive(true));
if (timer) {
delete activeMenu;
activeMenu = new cRecMenuEditTimer(timer, rmsTimelineTimerSave);
activeMenu->Display();
}
break;}
case rmsTimelineTimerSave: {
recManager->SaveTimer(timer, activeMenu);
delete activeMenu;
if (timerConflicts) {
delete timerConflicts;
}
timerConflicts = recManager->CheckTimerConflict();
activeMenu = new cRecMenuTimeline(timerConflicts);
activeMenu->Display();
break; }
case rmsTimelineTimerDelete: {
recManager->DeleteTimer(timer->Event());
delete activeMenu;
if (timerConflicts) {
delete timerConflicts;
}
timerConflicts = recManager->CheckTimerConflict();
activeMenu = new cRecMenuTimeline(timerConflicts);
activeMenu->Display();
break; }
/*
* --------- COMMON ---------------------------------
*/

View File

@ -403,7 +403,12 @@ cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextStat
AddMenuItem(new cRecMenuItemDay(tr("Day"), day, false));
AddMenuItem(new cRecMenuItemTime(tr("Timer start time"), start, false));
AddMenuItem(new cRecMenuItemTime(tr("Timer stop time"), stop, false));
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Save"), tr("Cancel"), nextState, rmsClose, false));
if (nextState == rmsTimelineTimerSave) {
AddMenuItem(new cRecMenuItemButton(tr("Delete Timer"), rmsTimelineTimerDelete, false, false));
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Save"), tr("Cancel"), nextState, rmsTimeline, false));
} else {
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Save"), tr("Cancel"), nextState, rmsClose, false));
}
CalculateHeight();
CreatePixmap();
Arrange();