summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasmin Jessich <jasmin@anw.at>2017-06-17 01:07:52 (GMT)
committerJasmin Jessich <jasmin@anw.at>2017-06-17 20:35:15 (GMT)
commit9bebbad537dfedc7d143b35d1d01dc9cc7b68b5f (patch)
treec7322b06367fd9e0c05117896376b97fc212098d
parent6bd777bdb4b9967e441301e109bfd42e114d7957 (diff)
downloadvdr-plugin-live-9bebbad537dfedc7d143b35d1d01dc9cc7b68b5f.tar.gz
vdr-plugin-live-9bebbad537dfedc7d143b35d1d01dc9cc7b68b5f.tar.bz2
Added column 'Searchtimer' to the timer views
- This implements the change request from ludi: http://www.vdr-portal.de/board16-video-disk-recorder/board55-vdr-plugins/p1293486-vdr-plugin-live-f%C3%BCr-vdr-2-3-x/#post1293486 He requested to see the name of the serach timer, which has created a timer.
-rw-r--r--pages/timerconflicts.ecpp6
-rw-r--r--pages/timers.ecpp8
-rw-r--r--timers.cpp16
-rw-r--r--timers.h1
4 files changed, 28 insertions, 3 deletions
diff --git a/pages/timerconflicts.ecpp b/pages/timerconflicts.ecpp
index bbc35b6..514a9c7 100644
--- a/pages/timerconflicts.ecpp
+++ b/pages/timerconflicts.ecpp
@@ -49,7 +49,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
for (std::list< TimerInConflict >::const_iterator confltimer = conflTimers.begin(); confltimer != conflTimers.end(); ++confltimer) {
</%cpp>
<tr class="head">
- <td colspan="10">
+ <td colspan="11">
<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>
@@ -60,6 +60,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<td><div class="withmargin"><$ trVDR("Stop") $></div></td>
<td><div class="withmargin"><$ trVDR("Priority") $></div></td>
<td><div class="withmargin"><$ trVDR("File") $></div></td>
+ <td><div class="withmargin"><$ tr("Searchtimer") $></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>
@@ -92,6 +93,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
EpgInfoPtr epgEvent;
string longDescription;
+ string searchTimName;
string title;
#if VDRVERSNUM >= 20301
if (!timer->Event()) {
@@ -106,6 +108,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
longDescription = StringEscapeAndBreak(SortedTimers::GetTimerInfo(*timer)) + "<hr>"
+ StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength))
+ "<br/><br/>" + tr("Click to view details.");
+ searchTimName = SortedTimers::SearchTimerName(*timer);
title = epgEvent->Title();
}
</%cpp>
@@ -120,6 +123,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgEvent->Id()) &>
% }
><$ timer->File() $></a></div></td>
+ <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin nowrap"><$ searchTimName $></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=<$ SortedTimers::EncodeDomId(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" ?>"><& pageelems.edit_timer timerId=(timers.GetTimerId(*timer)) &></td>
diff --git a/pages/timers.ecpp b/pages/timers.ecpp
index ff3fd40..91986dd 100644
--- a/pages/timers.ecpp
+++ b/pages/timers.ecpp
@@ -78,6 +78,7 @@ static const size_t maximumDescriptionLength = 300;
for (SortedTimers::iterator timer = timers.begin(); timer != timers.end(); ++timer) {
EpgInfoPtr epgEvent;
string longDescription;
+ string searchTimName;
#if VDRVERSNUM >= 20301
if (!timer->Event()) {
LOCK_SCHEDULES_READ;
@@ -92,6 +93,7 @@ static const size_t maximumDescriptionLength = 300;
longDescription = StringEscapeAndBreak(SortedTimers::GetTimerInfo(*timer)) + "<hr>"
+ StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength))
+ "<br/><br/>" + tr("Click to view details.");
+ searchTimName = SortedTimers::SearchTimerName(*timer);
}
string currentDay = SortedTimers::GetTimerDays(*timer);
SortedTimers::iterator nextTimer = timer; ++nextTimer;
@@ -113,7 +115,7 @@ static const size_t maximumDescriptionLength = 300;
previousDay = currentDay;
</%cpp>
<tr class="head">
- <td colspan="8">
+ <td colspan="9">
<div class="boxheader"><div><div>
<$ currentDay $>
</div></div></div>
@@ -125,6 +127,7 @@ static const size_t maximumDescriptionLength = 300;
<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><div class="withmargin"><$ tr("Searchtimer") $></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 rightcol"><img src="img/transparent.png" alt="" width="16px" height="16px" /></td>
@@ -149,11 +152,12 @@ static const size_t maximumDescriptionLength = 300;
<td class="<? bottom ? "bottomrow" ?>"><div class="withmargin nowrap"><$ FormatDateTime(tr("%I:%M %p"), timer->StartTime()) $></div></td>
<td class="<? bottom ? "bottomrow" ?>"><div class="withmargin nowrap"><$ FormatDateTime(tr("%I:%M %p"), timer->StopTime()) $></div></td>
<td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><a
-% if (!longDescription.empty()) {
+% if (!longDescription.empty()) {
<& tooltip.hint text=(longDescription) &><& tooltip.display domId=(epgEvent->Id()) &>
% }
><$ timer->File() $></a></div>
</td>
+ <td class="<? bottom ? "bottomrow" ?>"><div class="withmargin nowrap"><$ searchTimName $></div></td>
<td class="action <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ SortedTimers::EncodeDomId(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" ?>"><& pageelems.edit_timer timerId=(timers.GetTimerId(*timer)) &></td>
<td class="action rightcol <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ SortedTimers::EncodeDomId(timers.GetTimerId(*timer)) $>&action=delete"><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="" <& tooltip.hint text=(tr("Delete timer")) &>></img></a></td>
diff --git a/timers.cpp b/timers.cpp
index 5335381..7f46cab 100644
--- a/timers.cpp
+++ b/timers.cpp
@@ -140,6 +140,22 @@ namespace vdrlive {
return info.str();
}
+ string SortedTimers::SearchTimerName(cTimer const& timer)
+ {
+ ostringstream info;
+ if (timer.Aux())
+ {
+ string epgsearchinfo = GetXMLValue(timer.Aux(), "epgsearch");
+ if (!epgsearchinfo.empty())
+ {
+ string searchtimer = GetXMLValue(epgsearchinfo, "searchtimer");
+ if (!searchtimer.empty())
+ info << searchtimer;
+ }
+ }
+ return info.str();
+ }
+
#if VDRVERSNUM >= 20301
bool SortedTimers::Modified()
{
diff --git a/timers.h b/timers.h
index 968cd8a..5f62f76 100644
--- a/timers.h
+++ b/timers.h
@@ -29,6 +29,7 @@ namespace vdrlive {
static std::string GetTimerDays(cTimer const& timer);
static std::string GetTimerInfo(cTimer const& timer);
+ static std::string SearchTimerName(cTimer const& timer);
private:
SortedTimers();