diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-07-22 02:10:11 +0000 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-07-22 02:10:11 +0000 |
commit | 213b98b4f18076c8b9e42b6868beaa3a640ae4e6 (patch) | |
tree | 1493c13070620fcc2284c28e7b05da9d2d0a8e11 /pages | |
parent | dbd884e1269a33eeda081826125400075ee101b3 (diff) | |
download | vdr-plugin-live-213b98b4f18076c8b9e42b6868beaa3a640ae4e6.tar.gz vdr-plugin-live-213b98b4f18076c8b9e42b6868beaa3a640ae4e6.tar.bz2 |
- Tool icons in epg popup windows.
Diffstat (limited to 'pages')
-rw-r--r-- | pages/epginfo.ecpp | 55 | ||||
-rw-r--r-- | pages/pageelems.ecpp | 50 | ||||
-rw-r--r-- | pages/searchresults.ecpp | 2 | ||||
-rw-r--r-- | pages/whats_on.ecpp | 29 |
4 files changed, 97 insertions, 39 deletions
diff --git a/pages/epginfo.ecpp b/pages/epginfo.ecpp index 9487040..c14d89d 100644 --- a/pages/epginfo.ecpp +++ b/pages/epginfo.ecpp @@ -1,12 +1,31 @@ <%pre> #include <sys/stat.h> #include <vdr/tools.h> + +#include "stdext.h" #include "exception.h" #include "setup.h" #include "tools.h" #include "epg_events.h" #include "recordings.h" +namespace vdrlive { + class SchedulesLock + { + public: + SchedulesLock() : m_schedulesLock() {} + + operator cSchedulesLock& () { return m_schedulesLock; } + + private: + SchedulesLock(SchedulesLock const &schedulesLock) {} + + cSchedulesLock m_schedulesLock; + }; + + typedef std::tr1::shared_ptr<SchedulesLock> SchedulesLockPtr; +} + using namespace vdrlive; using namespace std; @@ -16,24 +35,25 @@ using namespace std; string async; </%args> <%session scope="global"> -bool logged_in(false); + bool logged_in(false); </%session> +<%request scope="page"> + EpgInfoPtr epgEvent; +</%request> <%include>page_init.eh</%include> <%cpp> -if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); -</%cpp> -<%cpp> + if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); + pageTitle = tr("Electronic program guide information"); bool ajaxReq = !async.empty() && (lexical_cast<int>(async) != 0); - EpgInfoPtr epgEvent; - bool aboutBox(false); + bool aboutBox = false; - // These get initialized when needed. When freed by getting out + // One of these get initialized when needed. When freed by getting // out of scope they will release (if initialized) important // Semaphores/Locks. - cSchedulesLock schedulesLock; + SchedulesLockPtr schedulesLockPtr; RecordingsManagerPtr recordings; if (!epgid.empty()) { @@ -53,7 +73,11 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } // check for event: else if (epgid.compare(0, event.length(), event) == 0) { - const cSchedules* schedules = cSchedules::Schedules(schedulesLock); + schedulesLockPtr = SchedulesLockPtr(new SchedulesLock); + if (!schedulesLockPtr) { + throw HtmlError(tr("Error aquiring schedules lock")); + } + const cSchedules* schedules = cSchedules::Schedules(*schedulesLockPtr); if (!schedules) { throw HtmlError(tr("Error aquiring schedules")); } @@ -97,6 +121,9 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); if (recordings) { tools_component = epgEvent->Archived().empty() ? "recordings.rec_tools" : "recordings.archived_disc" ; } + if (schedulesLockPtr) { + tools_component = "epginfo.epgTools"; + } </%cpp> <& pageelems.epg_tt_box boxId=(epgEvent->Id()) caption=(epgEvent->Caption()) tools_comp=(tools_component) time=(start) title=(epgEvent->Title()) short_descr=(epgEvent->ShortDescr()) long_descr=(epgEvent->LongDescr()) archived=(epgEvent->Archived()) elapsed=(epgEvent->Elapsed()) &> <%cpp> @@ -112,3 +139,13 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); </html> <%include>page_exit.eh</%include> + +<# ---------------------------------------------------------------------- #> + +<%def epgTools> +<%args> +string id; +int detail; +</%args> +<& pageelems.epg_tool_box detail=(detail) epgid=(id) title=(epgEvent->Title()) startTime=(epgEvent->GetStartTime()) endTime=(epgEvent->GetEndTime()) &> +</%def> diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index 799412b..2cff427 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -190,6 +190,52 @@ int update_status(1); <# ---------------------------------------------------------------------- #> +<%def epg_tool_box> +<%args> + int detail; + string epgid; + string title; + time_t startTime; + time_t endTime; + int lastCurrentChanel = int(); +</%args> +<%cpp> + int elapsed = EpgEvents::ElapsedTime(startTime, endTime); + tEventID eventId = tEventID(); + tChannelID channelId = tChannelID(); + + EpgEvents::DecodeDomId(epgid, channelId, eventId); + if (detail) { // output for vertical toolbox +</%cpp> + <& pageelems.event_timer channelid=(channelId) eventid=(eventId) &> +<%cpp> + if (elapsed > 0) { +</%cpp> + <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channelId) image="zap.png" alt="" &> +<%cpp> + } + if (LiveFeatures<features::epgsearch>().Recent()) { +</%cpp> + <a href="searchresults.html?searchplain=<$ StringEscapeAndBreak(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a> +<%cpp> + } +</%cpp> + <a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a> +<%cpp> + } + else { // table output +</%cpp> + <td class="action leftcol <? lastCurrentChanel ? "bottomrow"?>"><& pageelems.event_timer channelid=(channelId) eventid=(eventId) &></td> + <td class="action <? lastCurrentChanel ? "bottomrow"?>"><%cpp>if (elapsed > 0) { </%cpp><& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channelId) image="zap.png" alt="" &><%cpp> } </%cpp></td> + <td class="action <? lastCurrentChanel ? "bottomrow"?>"><%cpp>if (LiveFeatures<features::epgsearch>().Recent()) { </%cpp><a href="searchresults.html?searchplain=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a><%cpp> } else { </%cpp><img src="transparent.png" width="16" height="16"><%cpp> } </%cpp></td> + <td class="action <? lastCurrentChanel ? "bottomrow"?>"><a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a></td> +<%cpp> + } +</%cpp> +</%def> + +<# ---------------------------------------------------------------------- #> + <%def epg_tt_box> <%args> string boxId; @@ -208,9 +254,9 @@ int update_status(1); </div> <div class="epg_content"> <div class="epg_tools"> - <& (tools_comp) id=(boxId) archived=(archived) &> + <& (tools_comp) id=(boxId) archived=(archived) detail=(1) &> </div> - <div> + <div class="epg_info"> <div class="info"><%cpp> if (!archived.empty()) { </%cpp><span class="bold"><$ (archived + " ") $></span><%cpp> } </%cpp><$ (time) $></div> <%cpp> if (elapsed >= 0) { diff --git a/pages/searchresults.ecpp b/pages/searchresults.ecpp index 63226d5..dda0d12 100644 --- a/pages/searchresults.ecpp +++ b/pages/searchresults.ecpp @@ -69,7 +69,7 @@ bool logged_in(false); tEventID event = result->EventId(); tChannelID channel_id(result->Channel()); string description = result->Description(); - string epgDomId(EpgEvents::GetDomId(result->Channel(), event)); + string epgDomId(EpgEvents::EncodeDomId(result->Channel(), event)); bool truncated = false; diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index d149e55..dfba641 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -128,21 +128,6 @@ if (type == "now") { continue; } - tChannelID channel_id(Channel->GetChannelID()); - tEventID event = Event->EventID(); - - - // string evntId("event_"); - // - // string schanid(channel_id.ToString()); - // replace(schanid.begin(), schanid.end(), '.', 'p'); - // replace(schanid.begin(), schanid.end(), '-', 'm'); - // evntId += schanid; - // evntId += '_'; - // evntId += lexical_cast<std::string>(event); - // // evntId += lexical_cast<std::string, int>(++evntNr); - // EpgEventPtr epgEvent(new EpgEvent(evntId, Event, Channel->Name())); - // // epgEvents.push_back(epgEvent); EpgInfoPtr epgEvent = EpgEvents::CreateEpgInfo(Channel, Event); bool truncated = false; @@ -159,14 +144,7 @@ if (type == "now") { </div> <div class="content"> <div class="tools"> - <& pageelems.event_timer channelid=(channel_id) eventid=(event) &> -% if (type == "now") { - <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channel_id) image="zap.png" alt="" &> -% } -% if ( LiveFeatures< features::epgsearch >().Recent() ) { - <a href="searchresults.html?searchplain=<$ StringEscapeAndBreak(epgEvent->Title()) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a> -% } - <a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(epgEvent->Title()) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a> + <& pageelems.epg_tool_box detail=(1) epgid=(epgEvent->Id()) title=(epgEvent->Title()) startTime=(epgEvent->GetStartTime()) endTime=(epgEvent->GetEndTime()) &> </div> <div> <div class="info"><$ (epgEvent->StartTime(tr("%I:%M %p"))) $> - <$ (epgEvent->EndTime(tr("%I:%M %p"))) $></div> @@ -189,10 +167,7 @@ if (type == "now") { || (!Channels.Next(Channel))); </%cpp> <tr> - <td class="action leftcol <? lastCurrentChanel ? "bottomrow"?>"><& pageelems.event_timer channelid=(channel_id) eventid=(event) &></td> - <td class="action <? lastCurrentChanel ? "bottomrow"?>"><%cpp>if (type == "now") { </%cpp><& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channel_id) image="zap.png" alt="" &><%cpp> } </%cpp> - <td class="action <? lastCurrentChanel ? "bottomrow"?>"><%cpp>if (LiveFeatures<features::epgsearch>().Recent() ) { </%cpp><a href="searchresults.html?searchplain=<$ StringUrlEncode(epgEvent->Title()) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a><%cpp> } else { </%cpp><img src="transparent.png" width="16" height="16"><%cpp> } </%cpp></td> - <td class="action <? lastCurrentChanel ? "bottomrow"?>"><a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(epgEvent->Title()) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a></td> + <& pageelems.epg_tool_box detail=(0) epgid=(epgEvent->Id()) title=(epgEvent->Title()) startTime=(epgEvent->GetStartTime()) endTime=(epgEvent->GetEndTime()) lastCurrentChanel=(lastCurrentChanel ? 1 : 0) &> <td class="topaligned <? lastCurrentChanel ? "bottomrow"?>"> <div class="withmargin"> <div class="nomargin"><$ (epgEvent->StartTime(tr("%I:%M %p"))) $> - <$ (epgEvent->EndTime(tr("%I:%M %p"))) $></div> |