diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-02-17 00:28:47 +0100 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-02-17 00:28:47 +0100 |
commit | ba8b5a77ae3bd7cacc457c995d9beacbc80a8f75 (patch) | |
tree | 730e45776fa7d3a4bf4bd7ed27018c767548d1d1 /pages | |
parent | 4190290719450e128769d9ab60aa0395a8cffece (diff) | |
download | vdr-plugin-live-ba8b5a77ae3bd7cacc457c995d9beacbc80a8f75.tar.gz vdr-plugin-live-ba8b5a77ae3bd7cacc457c995d9beacbc80a8f75.tar.bz2 |
first version with timer conflicts
Diffstat (limited to 'pages')
-rw-r--r-- | pages/Makefile | 2 | ||||
-rw-r--r-- | pages/menu.ecpp | 1 | ||||
-rw-r--r-- | pages/timerconflicts.ecpp | 127 |
3 files changed, 129 insertions, 1 deletions
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() ) { | <a href="searchepg.html" <& menu.setactive current=("searchepg") &>><$ tr("Search") $></a> | <a href="searchtimers.html" <& menu.setactive current=("searchtimers") &>><$ tr("Searchtimers") $></a> + | <a href="timerconflicts.html" <& menu.setactive current=("timerconflicts") &>><$ tr("Timer conflicts") $></a> % } | <a href="recordings.html" <& menu.setactive current=("recordings") &>><$ tr("Recordings") $></a> | <a href="remote.html" <& menu.setactive current=("remote") &>><$ tr("Remote Control") $></a> 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 <vdr/channels.h> +#include <vdr/i18n.h> +#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; + +</%pre> +<%args> + // input parameters +</%args> +<%session scope="global"> +bool logged_in(false); +</%session> +<%include>page_init.eh</%include> +<%cpp> +if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); +</%cpp> +<%cpp> + pageTitle = tr("Timer conflicts"); + TimerConflicts timerConflicts; + cMutexLock timersLock( &LiveTimerManager() ); + SortedTimers& timers = LiveTimerManager().GetTimers(); +</%cpp> +<& pageelems.doc_type &> +<html> + <head> + <title>VDR-Live - <$ pageTitle $></title> + <& pageelems.stylesheets &> + <& pageelems.ajax_js &> + </head> + <body> + <& pageelems.logo &> + <& menu active=("timersconflicts")> + <div class="inhalt"> + <table class="listing" cellspacing="0" cellpadding="0"> +<%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> + <tr class="head"> + <td colspan="9"> + <div class="boxheader"><div><div><$ FormatDateTime(tr("%A, %x"), conflict->ConflictTime()) + " " + FormatDateTime(tr("%I:%M %p"), conflict->ConflictTime()) + " - " + lexical_cast<string, int>(confltimer->percentage) + "%" $></div></div></div> + </td> + </tr> + <tr class="description"> + <td class="leftcol"><img src="/img/transparent.png" alt="" width="16px" height="16px" /></td> + <td><div class="withmargin"><$ trVDR("Channel") $></div></td> + <td><div class="withmargin"><$ trVDR("Start") $></div></td> + <td><div class="withmargin"><$ trVDR("Stop") $></div></td> + <td><div class="withmargin"><$ trVDR("File") $></div></td> + <td class="action"><img src="/img/transparent.png" alt="" width="16px" height="16px" /></td> + <td class="action"><img src="/img/transparent.png" alt="" width="16px" height="16px" /></td> + <td class="action"><img src="/img/transparent.png" alt="" width="16px" height="16px" /></td> + <td class="action rightcol"><img src="/img/transparent.png" alt="" width="16px" height="16px" /></td> + </tr> +<%cpp> + for (std::list<int>::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)) + "<hr>" + + StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength)) + + "<br/><br/>" + tr("Click to view details."); + title = epgEvent->Title(); + } +</%cpp> + <tr> + <td class="leftcol <? bottom ? "bottomrow" ?>"><img src="<$ LiveSetup().GetThemedLink("img", timerStateImg) $>" alt="" <%cpp> if (!timerStateHint.empty()) { </%cpp><& tooltip.hint text=(timerStateHint) &><%cpp> } </%cpp>></img></td> + <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><a href="schedule.html?channel=<$ timer->Channel()->Number()$>"><$ timer->Channel()->Name() $></a></div></td> + <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><$ FormatDateTime(tr("%I:%M %p"), timer->StartTime()) $></div></td> + <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><$ FormatDateTime(tr("%I:%M %p"), timer->StopTime()) $></div></td> + <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><a +% if (!longDescription.empty()) { + <& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgEvent->Id()) &> +% } + ><$ timer->File() $></a></div></td> + <td class="action <? bottom ? "bottomrow" ?>"><a href="searchresults.html?searchplain=<$ StringEscapeAndBreak(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a></td> + <td class="action <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ timers.GetTimerId(*timer) $>&action=toggle"><img src="<$ LiveSetup().GetThemedLink("img", (timer->Flags() & tfActive) ? "active.png" : "inactive.png") $>" alt="" <& tooltip.hint text=(tr("Toggle timer active/inactive")) &>></img></a></td> + <td class="action <? bottom ? "bottomrow" ?>"><a href="edit_timer.html?timerid=<$ timers.GetTimerId(*timer) $>"><img src="<$ LiveSetup().GetThemedLink("img", "edit.png") $>" alt="" <& tooltip.hint text=(tr("Edit timer")) &>></img></a></td> + <td class="action rightcol <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ timers.GetTimerId(*timer) $>&action=delete"><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="" <& tooltip.hint text=(tr("Delete timer")) &>></img></a></td> + </tr> +% } +</%cpp> + <tr class="spacer"> + <td colspan="9"/> + </tr> +<%cpp> + } + } +</%cpp> + </table> + </div> + </body> +</html> +<%include>page_exit.eh</%include> + + |