summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger (at) gmx (dot) de>2007-05-03 18:17:16 +0000
committerChristian Wieninger <cwieninger (at) gmx (dot) de>2007-05-03 18:17:16 +0000
commit3a0ab012c018c1d5093c8cdc89537a9d4467afb0 (patch)
treed8b999b85e95f725f2dfba00fdf2eae91e9b50d8
parent69d1982a650657a4cd2d17b818c3d7bdc3e969e4 (diff)
downloadvdr-plugin-live-3a0ab012c018c1d5093c8cdc89537a9d4467afb0.tar.gz
vdr-plugin-live-3a0ab012c018c1d5093c8cdc89537a9d4467afb0.tar.bz2
- EPG pages now display record.png or record_timer.png depending on an existing timer
- If record_timer.png is displayed one can now edit the timer for an event
-rw-r--r--epg_events.cpp5
-rw-r--r--epg_events.h2
-rw-r--r--i18n.cpp22
-rw-r--r--pages/pageelems.ecpp12
-rw-r--r--pages/searchresults.ecpp5
-rw-r--r--timers.cpp15
-rw-r--r--timers.h1
7 files changed, 59 insertions, 3 deletions
diff --git a/epg_events.cpp b/epg_events.cpp
index 2619b46..ec95fde 100644
--- a/epg_events.cpp
+++ b/epg_events.cpp
@@ -64,6 +64,11 @@ namespace vdrlive
return -1;
}
+ const cTimer* EpgEvent::GetTimer() const
+ {
+ return NULL;
+ }
+
EpgEvents::EpgEvents() :
std::vector<EpgEventPtr>()
{
diff --git a/epg_events.h b/epg_events.h
index 75bfa98..330f7ba 100644
--- a/epg_events.h
+++ b/epg_events.h
@@ -51,6 +51,8 @@ namespace vdrlive
int Elapsed() const;
+ const cTimer* GetTimer() const;
+
private:
std::string m_eventId;
std::string m_caption;
diff --git a/i18n.cpp b/i18n.cpp
index 7d3e928..07bf47b 100644
--- a/i18n.cpp
+++ b/i18n.cpp
@@ -817,6 +817,28 @@ const tI18nPhrase Phrases[] = {
"", // Dansk
"", // Czech
},
+ { "Edit this", // English
+ "Timer editieren", // Deutsch
+ "", // Slovenski
+ "", // Italiano
+ "", // Nederlands
+ "", // Português
+ "", // Français
+ "", // Norsk
+ "", // Finnish
+ "", // Polski
+ "", // Español
+ "", // Greek
+ "", // Svenska
+ "", // Românã
+ "", // Magyar
+ "", // Català
+ "", // Russian
+ "", // Hrvatski
+ "", // Eesti
+ "", // Dansk
+ "", // Czech
+ },
{ "Click to view details.", // English
"Für Details klicken.", // Deutsch
"", // Slovenski
diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp
index 74af3dd..7acf72a 100644
--- a/pages/pageelems.ecpp
+++ b/pages/pageelems.ecpp
@@ -4,6 +4,7 @@
#include <vdr/epg.h>
#include "tools.h"
#include "i18n.h"
+#include "timers.h"
using namespace std;
using namespace vdrlive;
@@ -88,7 +89,16 @@ using namespace vdrlive;
tChannelID channelid;
tEventID eventid;
</%args>
- <a href="edit_timer.html?channelid=<$ channelid $>&eventid=<$ eventid $>"><img src="record.png" alt="" <& tooltip.hint text=(tr("Record this")) &> /></a>
+<%cpp> const cTimer* timer = LiveTimerManager().GetTimer(eventid, channelid);
+ if (timer) {
+</%cpp>
+ <a href="edit_timer.html?timerid=<$ LiveTimerManager().GetTimers().GetTimerId(*timer) $>">
+ <img src="record_timer.png" alt="" <& tooltip.hint text=(tr("Edit this")) &> />
+<%cpp> } else { </%cpp>
+ <a href="edit_timer.html?channelid=<$ channelid $>&eventid=<$ eventid $>">
+ <img src="record.png" alt="" <& tooltip.hint text=(tr("Record this")) &> />
+<%cpp> } </%cpp>
+ </a>
</%def>
<# ---------------------------------------------------------------------- #>
diff --git a/pages/searchresults.ecpp b/pages/searchresults.ecpp
index 542e0ac..22fbbc2 100644
--- a/pages/searchresults.ecpp
+++ b/pages/searchresults.ecpp
@@ -35,6 +35,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<head>
<title>VDR-Live - <$ pageTitle $></title>
<link rel="stylesheet" type="text/css" href="/styles.css" />
+ <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
</head>
<body onload="<& pageelems.infobox_start_update &>">
@@ -55,7 +56,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
string end(result->StopTime() ? FormatDateTime(tr("%I:%M %p"), result->StopTime()) : "");
string day(result->StartTime() ? FormatDateTime(tr("%A, %b %d %Y"), result->StartTime()) : "");
tEventID event = result->EventId();
- tChannelID channel_id(result->Channel());
+ tChannelID channel_id(result->Channel());
if (current_day != day) {
if (current_day != "") {
}>
@@ -71,7 +72,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
% current_day = day;
% }
<tr class="<? active_line ? "active" ?>">
- <td style="border-left: 1px solid black"><& pageelems.event_timer channelid=(channel_id) eventid=(event) &></td>
+ <td style="border-left: 1px solid black"><& pageelems.event_timer channelid=(channel_id) eventid=(event)&></td>
<td><$ channelname $></td>
<td><$ start $> - <$ end $></td>
<td><strong><$ result->Title() $></strong><br /><$ result->ShortText() $><br /></td>
diff --git a/timers.cpp b/timers.cpp
index 83067d2..a6be49e 100644
--- a/timers.cpp
+++ b/timers.cpp
@@ -204,6 +204,21 @@ string TimerManager::GetError( TimerPair const& timerData )
return "";
}
+const cTimer* TimerManager::GetTimer(tEventID eventid, tChannelID channelid)
+{
+ cMutexLock timersLock( &LiveTimerManager() );
+ SortedTimers& timers = LiveTimerManager().GetTimers();
+
+ for ( SortedTimers::iterator timer = timers.begin(); timer != timers.end(); ++timer )
+ if (timer->Channel() && timer->Channel()->GetChannelID() == channelid)
+ {
+ if (!timer->Event()) timer->SetEventFromSchedule();
+ if (timer->Event() && timer->Event()->EventID() == eventid)
+ return &*timer;
+ }
+ return NULL;
+}
+
TimerManager& LiveTimerManager()
{
static TimerManager instance;
diff --git a/timers.h b/timers.h
index 0135761..4bffbad 100644
--- a/timers.h
+++ b/timers.h
@@ -44,6 +44,7 @@ public:
// may only be called from Plugin::MainThreadHook
void DoPendingWork();
void DoReloadTimers() { m_timers.ReloadTimers(); }
+ const cTimer* GetTimer(tEventID eventid, tChannelID channelid);
private:
typedef std::pair< cTimer*, std::string > TimerPair;