sleeptimer: add possibilty to preset with a fixed value

Origin commit data
------------------
Commit: 25e550e9e3
Author: vanhofen <vanhofen@gmx.de>
Date: 2013-10-16 (Wed, 16 Oct 2013)

Origin message was:
------------------
- sleeptimer: add possibilty to preset with a fixed value
This commit is contained in:
vanhofen
2013-10-16 10:37:23 +02:00
parent 52e2d90147
commit 4cc026cd05
8 changed files with 42 additions and 12 deletions

View File

@@ -70,16 +70,20 @@ int CSleepTimerWidget::exec(CMenuTarget* parent, const std::string &actionKey)
if(permanent) {
inbox = new CStringInput(LOCALE_SLEEPTIMERBOX_TITLE2, value, 3, LOCALE_SLEEPTIMERBOX_HINT1, LOCALE_SLEEPTIMERBOX_HINT3, "0123456789 ");
} else {
CSectionsdClient::CurrentNextInfo info_CurrentNext;
g_InfoViewer->getEPG(g_RemoteControl->current_channel_id, info_CurrentNext);
if ( info_CurrentNext.flags & CSectionsdClient::epgflags::has_current) {
time_t jetzt=time(NULL);
int current_epg_zeit_dauer_rest = (info_CurrentNext.current_zeit.dauer+150 - (jetzt - info_CurrentNext.current_zeit.startzeit ))/60 ;
if(shutdown_min == 0 && current_epg_zeit_dauer_rest > 0 && current_epg_zeit_dauer_rest < 1000)
{
sprintf(value,"%03d",current_epg_zeit_dauer_rest);
if (g_settings.sleeptimer_min == 0) {
CSectionsdClient::CurrentNextInfo info_CurrentNext;
g_InfoViewer->getEPG(g_RemoteControl->current_channel_id, info_CurrentNext);
if ( info_CurrentNext.flags & CSectionsdClient::epgflags::has_current) {
time_t jetzt=time(NULL);
int current_epg_zeit_dauer_rest = (info_CurrentNext.current_zeit.dauer+150 - (jetzt - info_CurrentNext.current_zeit.startzeit ))/60 ;
if(shutdown_min == 0 && current_epg_zeit_dauer_rest > 0 && current_epg_zeit_dauer_rest < 1000)
{
sprintf(value,"%03d", current_epg_zeit_dauer_rest);
}
}
}
else
sprintf(value,"%03d", g_settings.sleeptimer_min);
inbox = new CStringInput(LOCALE_SLEEPTIMERBOX_TITLE, value, 3, LOCALE_SLEEPTIMERBOX_HINT1, LOCALE_SLEEPTIMERBOX_HINT2, "0123456789 ");
}