From a5c871c47c721e1179bee7c4695169dd3344c0c2 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Wed, 19 Nov 2008 18:53:09 +0100 Subject: new setup option to display channels without EPG --- Makefile | 2 +- doc/ChangeLog | 3 +++ epg_events.cpp | 28 ++++++++++++++++++++++++++-- epg_events.h | 28 ++++++++++++++++++++++++++++ pages/pageelems.ecpp | 17 +++++++++++++---- pages/setup.ecpp | 19 ++++++++++++++----- pages/whats_on.ecpp | 15 +++++++++++---- po/ca_ES.po | 6 ++++++ po/cs_CZ.po | 6 ++++++ po/da_DK.po | 6 ++++++ po/de_DE.po | 19 +++++-------------- po/el_GR.po | 6 ++++++ po/es_ES.po | 6 ++++++ po/et_EE.po | 6 ++++++ po/fi_FI.po | 6 ++++++ po/fr_FR.po | 6 ++++++ po/hr_HR.po | 6 ++++++ po/hu_HU.po | 6 ++++++ po/it_IT.po | 6 ++++++ po/nl_NL.po | 6 ++++++ po/nn_NO.po | 6 ++++++ po/pl_PL.po | 6 ++++++ po/pt_PT.po | 6 ++++++ po/ro_RO.po | 6 ++++++ po/ru_RU.po | 6 ++++++ po/sl_SI.po | 6 ++++++ po/sv_SE.po | 6 ++++++ po/tr_TR.po | 6 ++++++ setup.cpp | 5 ++++- setup.h | 3 +++ thread.cpp | 2 +- 31 files changed, 229 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 1b932e0..c47422f 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ endif msgfmt -c -o $@ $< $(I18Npot): PAGES $(PLUGINOBJS:%.o=%.cpp) - xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --omit-header -o $@ $(PLUGINOBJS:%.o=%.cpp) pages/*.cpp setup.h + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --omit-header -o $@ $(PLUGINOBJS:%.o=%.cpp) pages/*.cpp setup.h epg_events.h $(I18Npo): $(I18Npot) msgmerge -U --no-wrap --no-location --backup=none -q $@ $< diff --git a/doc/ChangeLog b/doc/ChangeLog index 1f9b3f4..e7b207f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,6 @@ +2008-11-19 Christian Wieninger + * new setup option to display channels without EPG + 2008-10-21 Christian Wieninger * edit_timer.ecpp: new menu entry to select a recording directory. requires epgsearch plugin. diff --git a/epg_events.cpp b/epg_events.cpp index 962fcfc..ac6bcaa 100644 --- a/epg_events.cpp +++ b/epg_events.cpp @@ -195,6 +195,22 @@ namespace vdrlive return name; } + /* + * ------------------------------------------------------------------------- + * EmptyEvent + * ------------------------------------------------------------------------- + */ + + EmptyEvent::EmptyEvent(std::string const &id, tChannelID const &channelID, const char* channelName) : + EpgInfo(id, channelName), + m_channelID(channelID) + { + } + + EmptyEvent::~EmptyEvent() + { + } + /* * ------------------------------------------------------------------------- * EpgEvents @@ -267,8 +283,16 @@ namespace vdrlive EpgInfoPtr EpgEvents::CreateEpgInfo(cChannel const *chan, cEvent const *event, char const *idOverride) { - string domId(idOverride ? idOverride : EncodeDomId(chan->GetChannelID(), event->EventID())); - return EpgInfoPtr(new EpgEvent(domId, event, chan->Name())); + if (event) + { + string domId(idOverride ? idOverride : EncodeDomId(chan->GetChannelID(), event->EventID())); + return EpgInfoPtr(new EpgEvent(domId, event, chan->Name())); + } + else if (LiveSetup().GetShowChannelsWithoutEPG()) + { + string domId(idOverride ? idOverride : EncodeDomId(chan->GetChannelID(), 0)); + return EpgInfoPtr(new EmptyEvent(domId, chan->GetChannelID(), chan->Name())); + } } EpgInfoPtr EpgEvents::CreateEpgInfo(string const &recid, cRecording const *recording, char const *caption) diff --git a/epg_events.h b/epg_events.h index 8678eef..6d59f8c 100644 --- a/epg_events.h +++ b/epg_events.h @@ -120,6 +120,34 @@ namespace vdrlive // ------------------------------------------------------------------------- + class EmptyEvent : public EpgInfo + { + friend class EpgEvents; + + protected: + EmptyEvent(std::string const &id, tChannelID const &channelID, const char* channelName); + + public: + virtual ~EmptyEvent(); + + virtual std::string const Title() const { return tr("no EPG available"); } + + virtual std::string const ShortDescr() const { return ""; } + + virtual std::string const LongDescr() const { return ""; } + + virtual time_t GetStartTime() const { return 0; } + + virtual time_t GetEndTime() const { return 0; } + + virtual cChannel const * Channel() const { return Channels.GetByChannelID(m_channelID);} + + private: + tChannelID m_channelID; + }; + + // ------------------------------------------------------------------------- + class EpgRecording : public EpgInfo { friend class EpgEvents; diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index e8dd1fb..9222115 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -266,7 +266,7 @@ int update_status(1); <& pageelems.event_timer epgid=(epgid) &> <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channelId) image="zap.png" alt="" &> <%cpp> - if (LiveFeatures().Recent()) { + if (LiveFeatures().Recent() && eventId != 0) { " alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>> <%cpp> @@ -276,18 +276,27 @@ int update_status(1); <& pageelems.vlc_stream_channel channelId=(channelId) &> <%cpp> } + if (eventId != 0) { - <& pageelems.imdb_info_href title=(title) &> + <& pageelems.imdb_info_href title=(title) &> <%cpp> + } } else { // table output "><& pageelems.event_timer epgid=(epgid) &> "><& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channelId) image="zap.png" alt="" &> - "><%cpp>if (LiveFeatures().Recent()) { " alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>><%cpp> } else { <%cpp> } + "><%cpp>if (LiveFeatures().Recent() && eventId != 0) { " alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>><%cpp> } else { <%cpp> } "><%cpp>if (LiveSetup().GetUseStreamdev() && elapsed > 0 && LiveFeatures().Loaded()) { " alt="" <& tooltip.hint text=(tr("Stream this channel into browser.")) &>><%cpp> } else { <%cpp> } - "><& pageelems.imdb_info_href title=(title) &> + "> +<%cpp> + if (eventId != 0) { + + <& pageelems.imdb_info_href title=(title) &> <%cpp> + } + +<%cpp> } diff --git a/pages/setup.ecpp b/pages/setup.ecpp index d89acf0..cc1db8c 100644 --- a/pages/setup.ecpp +++ b/pages/setup.ecpp @@ -23,6 +23,7 @@ using namespace std; string showInfoBox; string useStreamdev; string showIMDb; + string showChannelsWithoutEPG; string streamdevport; string streamdevtype; int authchanged = 0; @@ -65,6 +66,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); LiveSetup().SetStreamdevPort(streamdevport.empty() ? 3000 : lexical_cast(streamdevport)); LiveSetup().SetStreamdevType(streamdevtype.empty() ? "PES" : streamdevtype); LiveSetup().SetShowIMDb(!showIMDb.empty()); + LiveSetup().SetShowChannelsWithoutEPG(!showChannelsWithoutEPG.empty()); LiveSetup().SaveSetup(); message = tr("Setup saved."); } @@ -89,7 +91,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); streamdevport = lexical_cast(LiveSetup().GetStreamdevPort()); streamdevtype = LiveSetup().GetStreamdevType(); showIMDb = LiveSetup().GetShowIMDb() ? "1" : ""; - + showChannelsWithoutEPG = LiveSetup().GetShowChannelsWithoutEPG() ? "1" : ""; <& pageelems.doc_type &> @@ -135,10 +137,6 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<$ tr("Setup") $>
- -
<$ tr("Last channel to display") $>:
- -
<$ tr("Use authentication") $>:
@@ -211,11 +209,22 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); CHECKIF(!showIMDb.empty()); /> + +
<$ tr("Last channel to display") $>:
+ +
<$ tr("additional fixed times in 'What's on?'") $>:
<& tooltip.help text=(tr("Format is HH:MM. Separate multiple times with a semicolon")) &> + +
<$ tr("Show channels without EPG") $>:
+ + CHECKIF(!showChannelsWithoutEPG.empty()); /> + + +
<$ tr("Start page") $>: