From ba8b5a77ae3bd7cacc457c995d9beacbc80a8f75 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sun, 17 Feb 2008 00:28:47 +0100 Subject: first version with timer conflicts --- pages/Makefile | 2 +- pages/menu.ecpp | 1 + pages/timerconflicts.ecpp | 127 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 pages/timerconflicts.ecpp (limited to 'pages') diff --git a/pages/Makefile b/pages/Makefile index 8f718fe..2a8b8be 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -21,7 +21,7 @@ OBJS = menu.o recordings.o schedule.o screenshot.o timers.o \ vlc.o searchtimers.o edit_searchtimer.o searchresults.o \ searchepg.o login.o ibox.o xmlresponse.o play_recording.o \ pause_recording.o stop_recording.o ffw_recording.o \ - rwd_recording.o setup.o content.o epginfo.o + rwd_recording.o setup.o content.o epginfo.o timerconflicts.o ### Default rules: diff --git a/pages/menu.ecpp b/pages/menu.ecpp index e9b5faf..a8eba86 100644 --- a/pages/menu.ecpp +++ b/pages/menu.ecpp @@ -39,6 +39,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); % if ( LiveFeatures< features::epgsearch >().Recent() ) { | ><$ tr("Search") $> | ><$ tr("Searchtimers") $> + | ><$ tr("Timer conflicts") $> % } | ><$ tr("Recordings") $> | ><$ tr("Remote Control") $> diff --git a/pages/timerconflicts.ecpp b/pages/timerconflicts.ecpp new file mode 100644 index 0000000..c69394f --- /dev/null +++ b/pages/timerconflicts.ecpp @@ -0,0 +1,127 @@ +<%pre> +#include +#include +#include "epgsearch.h" +#include "tools.h" +#include "setup.h" +#include "epg_events.h" +#include "timers.h" + +using namespace vdrlive; +using namespace std; + +static const size_t maximumDescriptionLength = 300; + + +<%args> + // input parameters + +<%session scope="global"> +bool logged_in(false); + +<%include>page_init.eh +<%cpp> +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); + +<%cpp> + pageTitle = tr("Timer conflicts"); + TimerConflicts timerConflicts; + cMutexLock timersLock( &LiveTimerManager() ); + SortedTimers& timers = LiveTimerManager().GetTimers(); + +<& pageelems.doc_type &> + + + VDR-Live - <$ pageTitle $> + <& pageelems.stylesheets &> + <& pageelems.ajax_js &> + + + <& pageelems.logo &> + <& menu active=("timersconflicts")> +
+ +<%cpp> + for (TimerConflicts::iterator conflict = timerConflicts.begin(); conflict != timerConflicts.end(); ++conflict) { + const std::list< TimerInConflict >& conflTimers = conflict->ConflictingTimers(); + for (std::list< TimerInConflict >::const_iterator confltimer = conflTimers.begin(); confltimer != conflTimers.end(); ++confltimer) { + + + + + + + + + + + + + + + +<%cpp> + for (std::list::const_iterator timerIndex = confltimer->concurrentTimerIndices.begin(); timerIndex != confltimer->concurrentTimerIndices.end(); ++timerIndex) { + cTimer* timer = Timers.Get(*timerIndex-1); + if (!timer) continue; + + std::list< int >::const_iterator nexttimerIndex = timerIndex; + ++nexttimerIndex; + bool bottom = (nexttimerIndex == confltimer->concurrentTimerIndices.end()); + + std::string timerStateImg = "transparent.png"; + std::string timerStateHint; + if (timer->Index() == confltimer->timerIndex-1) { + timerStateImg = "timerconflict.gif"; + timerStateHint = tr("Timer has a conflict."); + } + else if (timer->Flags() & tfActive) { + timerStateImg = "arrow.png"; + timerStateHint = tr("Timer is active."); + } + + EpgInfoPtr epgEvent; + string longDescription; + string title; + if (!timer->Event()) timer->SetEventFromSchedule(); + if (timer->Event()) { + epgEvent = EpgEvents::CreateEpgInfo(timer->Channel(), timer->Event()); + longDescription = StringEscapeAndBreak(SortedTimers::GetTimerInfo(*timer)) + "
" + + StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength)) + + "

" + tr("Click to view details."); + title = epgEvent->Title(); + } + +
+ + + + + + + + + + +% } + + + +<%cpp> + } + } + +
+
<$ FormatDateTime(tr("%A, %x"), conflict->ConflictTime()) + " " + FormatDateTime(tr("%I:%M %p"), conflict->ConflictTime()) + " - " + lexical_cast(confltimer->percentage) + "%" $>
+
<$ trVDR("Channel") $>
<$ trVDR("Start") $>
<$ trVDR("Stop") $>
<$ trVDR("File") $>
">" alt="" <%cpp> if (!timerStateHint.empty()) { <& tooltip.hint text=(timerStateHint) &><%cpp> } >">">
<$ FormatDateTime(tr("%I:%M %p"), timer->StartTime()) $>
">
<$ FormatDateTime(tr("%I:%M %p"), timer->StopTime()) $>
">">" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>>">Flags() & tfActive) ? "active.png" : "inactive.png") $>" alt="" <& tooltip.hint text=(tr("Toggle timer active/inactive")) &>>">" alt="" <& tooltip.hint text=(tr("Edit timer")) &>>">" alt="" <& tooltip.hint text=(tr("Delete timer")) &>>
+
+
+ + +<%include>page_exit.eh + + -- cgit v1.2.3