diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2008-02-22 00:36:05 +0100 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2008-02-22 00:36:05 +0100 |
commit | 47365a8e84d30c44e12b5e5f6220c691a0bf074d (patch) | |
tree | 9108ccf4a6910dead6f8cdc43ba56c3c1bc3090e | |
parent | 7ce0e43c812f4a25048e47d135cec14307480fef (diff) | |
download | vdr-plugin-live-47365a8e84d30c44e12b5e5f6220c691a0bf074d.tar.gz vdr-plugin-live-47365a8e84d30c44e12b5e5f6220c691a0bf074d.tar.bz2 |
First implementation of a notification about timer conflicts in LIVE.
Based on the work of winni in epgsearch and its service interface.
-rw-r--r-- | css/styles.css | 22 | ||||
-rw-r--r-- | pages/menu.ecpp | 73 | ||||
-rw-r--r-- | po/ca_ES.po | 3 | ||||
-rw-r--r-- | po/cs_CZ.po | 3 | ||||
-rw-r--r-- | po/da_DK.po | 3 | ||||
-rw-r--r-- | po/de_DE.po | 7 | ||||
-rw-r--r-- | po/el_GR.po | 3 | ||||
-rw-r--r-- | po/es_ES.po | 3 | ||||
-rw-r--r-- | po/et_EE.po | 3 | ||||
-rw-r--r-- | po/fi_FI.po | 3 | ||||
-rw-r--r-- | po/fr_FR.po | 3 | ||||
-rw-r--r-- | po/hr_HR.po | 3 | ||||
-rw-r--r-- | po/hu_HU.po | 3 | ||||
-rw-r--r-- | po/it_IT.po | 3 | ||||
-rw-r--r-- | po/nl_NL.po | 3 | ||||
-rw-r--r-- | po/nn_NO.po | 3 | ||||
-rw-r--r-- | po/pl_PL.po | 3 | ||||
-rw-r--r-- | po/pt_PT.po | 3 | ||||
-rw-r--r-- | po/ro_RO.po | 3 | ||||
-rw-r--r-- | po/ru_RU.po | 3 | ||||
-rw-r--r-- | po/sl_SI.po | 3 | ||||
-rw-r--r-- | po/sv_SE.po | 3 | ||||
-rw-r--r-- | po/tr_TR.po | 3 | ||||
-rw-r--r-- | timerconflict.cpp | 40 | ||||
-rw-r--r-- | timerconflict.h | 16 |
25 files changed, 181 insertions, 37 deletions
diff --git a/css/styles.css b/css/styles.css index 95a8ab5..7f0209a 100644 --- a/css/styles.css +++ b/css/styles.css @@ -105,6 +105,9 @@ a:active { margin: 0px; } +.notpresent { + display: none; +} /* ###################### # Tooltip style for hints @@ -417,7 +420,7 @@ div.pagemenu { } div.pagemenu div { - /* padding-bottom: 6px; */ + padding-bottom: 6px; background: #FFFFFF url(img/bg_line_top.png) bottom repeat-x; } @@ -434,6 +437,10 @@ div.pagemenu div div div { margin: 0; } +div.pagemenu form { + display: inline; +} + div.pagemenu a { color: black; font-weight: bold; @@ -444,6 +451,19 @@ div.pagemenu a.active { font-weight: bold; } +div.pagemenu #pmmessage { + border-bottom: 0px; + text-align: center; +} + +div.pagemenu #pmmessage span { + padding: 0em 2em 0em 2em; + background: red; +} + +div.pagemenu #pmcontent { +} + /* ####################### # Info Box (near logo) ####################### diff --git a/pages/menu.ecpp b/pages/menu.ecpp index e9b5faf..c7a9ba2 100644 --- a/pages/menu.ecpp +++ b/pages/menu.ecpp @@ -2,9 +2,11 @@ #include <string> #include <vdr/plugin.h> #include <vdr/config.h> + #include "livefeatures.h" #include "setup.h" #include "i18n.h" +#include "timerconflict.h" using namespace std; using namespace vdrlive; @@ -16,69 +18,82 @@ component; </%args> <%session scope="global"> bool logged_in(false); +TimerConflictNotifier timerNotifier(); </%session> <%request scope="page"> std::string set_active; std::string set_component; </%request> -<{ +<%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); -}> -<{ - using namespace vdrlive; +bool hasComp(!component.empty()); +bool hasMesg(timerNotifier.ShouldNotify()); + +set_active = active; +if (hasComp) { + set_component = component; +} - set_active = active; - if (!component.empty()) - set_component = component; -}> +</%cpp> <div class="menu"> <a href="whats_on.html?type=now" <& menu.setactive current=("whats_on") &>><$ tr("What's on?") $></a> | <a href="schedule.html" <& menu.setactive current=("schedule") &>><$ trVDR("Schedule") $></a> | <a href="timers.html" <& menu.setactive current=("timers") &>><$ trVDR("Timers") $></a> -% if ( LiveFeatures< features::epgsearch >().Recent() ) { +<%cpp> +if ( LiveFeatures< features::epgsearch >().Recent() ) { +</%cpp> | <a href="searchepg.html" <& menu.setactive current=("searchepg") &>><$ tr("Search") $></a> | <a href="searchtimers.html" <& menu.setactive current=("searchtimers") &>><$ tr("Searchtimers") $></a> -% } +<%cpp> +} +</%cpp> | <a href="recordings.html" <& menu.setactive current=("recordings") &>><$ tr("Recordings") $></a> | <a href="remote.html" <& menu.setactive current=("remote") &>><$ tr("Remote Control") $></a> | <a href="setup.html" <& menu.setactive current=("setup") &>><$ trVDR("Setup") $></a> <# --- Used by D.H. to test infobox (not part of the released version) | <a href="ibox_status.html" <& menu.setactive current=("status") &>><$ tr("Status Test") $></a> --- #> -% if (LiveSetup().UseAuth()) { +<%cpp> +if (LiveSetup().UseAuth()) { +</%cpp> | <a id="login" href="login.html?action=logout"><$ tr("Logout") $></a> -% } +<%cpp> +} +</%cpp> | <a <& tooltip.display domId=("aboutBox") &>>?</a> </div> -% if (!component.empty()) { -<div class="pagemenu"> - <div> <!-- outer --> - <div> <!-- inner --> - <& menu.component current=("whats_on") &> - <& menu.component current=("schedule") &> - <& menu.component current=("timers") &> -% if ( LiveFeatures< features::epgsearch >().Recent() ) { - <& menu.component current=("search") &> - <& menu.component current=("searchtimers") &> -% } - <& menu.component current=("recordings") &> - <& menu.component current=("remote") &> +<div class="pagemenu <? (!hasComp && !hasMesg) ? "notpresent" ?>"> + <div> <!-- outer --> + <div id="pmmessage" class="<? (!hasMesg) ? "notpresent" ?>"><span><$ timerNotifier.Message() $></span></div> + <div id="pmcontent" class="<? (!hasComp) ? "notpresent" ?>"> <!-- inner --> + <& menu.component current=("whats_on") &> + <& menu.component current=("schedule") &> + <& menu.component current=("timers") &> +<%cpp> + if ( LiveFeatures< features::epgsearch >().Recent() ) { +</%cpp> + <& menu.component current=("search") &> + <& menu.component current=("searchtimers") &> +<%cpp> + } +</%cpp> + <& menu.component current=("recordings") &> + <& menu.component current=("remote") &> + </div> </div> - </div> </div> -% } <%def setactive> <%args> current; </%args> -<%cpp> if (current== set_active) { </%cpp>class="active"<%cpp> } </%cpp> +<%cpp> if (current == set_active) { </%cpp>class="active"<%cpp> } </%cpp> </%def> <%def component> <%args> current; </%args> -<%cpp> if ((current== set_active) && (!set_component.empty())) { </%cpp><& (set_component) &><%cpp> } </%cpp> +<%cpp> if ((current == set_active) && (!set_component.empty())) { </%cpp><& (set_component) &><%cpp> } </%cpp> </%def> diff --git a/po/ca_ES.po b/po/ca_ES.po index 2d48035..712efd2 100644 --- a/po/ca_ES.po +++ b/po/ca_ES.po @@ -113,6 +113,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/cs_CZ.po b/po/cs_CZ.po index 7cf26a6..0390e14 100644 --- a/po/cs_CZ.po +++ b/po/cs_CZ.po @@ -111,6 +111,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/da_DK.po b/po/da_DK.po index 3e811f9..0a0394e 100644 --- a/po/da_DK.po +++ b/po/da_DK.po @@ -111,6 +111,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/de_DE.po b/po/de_DE.po index 05688dc..88d6f0b 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -113,11 +113,14 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "Timer Konflikte entdeckt! Sie sollten die entsprechenden Timer prüfen." + msgid "Couldn't aquire access to channels, please try again later." -msgstr "" +msgstr "Zugriff auf die Kanäle wurde verweigert. Bitte später versuchen." msgid "Couldn't find searchtimer. Maybe you mistyped your request?" -msgstr "" +msgstr "Keinen Suchtimer gefunden. Möglicherweise ein Tippfehler in der Anfrage?" msgid "mm/dd/yyyy" msgstr "dd.mm.yyyy" diff --git a/po/el_GR.po b/po/el_GR.po index fae5ae0..5c2a2f8 100644 --- a/po/el_GR.po +++ b/po/el_GR.po @@ -111,6 +111,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/es_ES.po b/po/es_ES.po index 013e0aa..cc97418 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -111,6 +111,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/et_EE.po b/po/et_EE.po index ae487d1..8ec561c 100644 --- a/po/et_EE.po +++ b/po/et_EE.po @@ -111,6 +111,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/fi_FI.po b/po/fi_FI.po index a07ad98..bb7f5dd 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -111,6 +111,9 @@ msgstr "Ensisijaisen DVB-sovittimen käyttäminen epäonnistui!" msgid "Couldn't grab image from primary device" msgstr "Kuvan kaappaus ensisijaiselta DVB-sovittimelta epäonnistui!" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "Kanavien käyttäminen epäonnistui! Yritä myöhemmin uudelleen." diff --git a/po/fr_FR.po b/po/fr_FR.po index f5da64c..26f9c8a 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -114,6 +114,9 @@ msgstr "Impossible d'acquérir périphérique primaire" msgid "Couldn't grab image from primary device" msgstr "Impossible de récupérer l'image du périphérique primaire" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "Impossible d'avoir accès à des chaînes, réessayer ultérieurement." diff --git a/po/hr_HR.po b/po/hr_HR.po index e4c9939..f882f26 100644 --- a/po/hr_HR.po +++ b/po/hr_HR.po @@ -112,6 +112,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/hu_HU.po b/po/hu_HU.po index 2927a6a..eae5c10 100644 --- a/po/hu_HU.po +++ b/po/hu_HU.po @@ -112,6 +112,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/it_IT.po b/po/it_IT.po index 7d9039f..414ed95 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -113,6 +113,9 @@ msgstr "Impossibile identificare scheda primaria" msgid "Couldn't grab image from primary device" msgstr "Impossibile ottenere immagine da scheda primaria" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "Impossibile avere accesso ai canali, per favore riprova più tardi." diff --git a/po/nl_NL.po b/po/nl_NL.po index 9214836..52fee4f 100644 --- a/po/nl_NL.po +++ b/po/nl_NL.po @@ -114,6 +114,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/nn_NO.po b/po/nn_NO.po index b6d186b..274e7c5 100644 --- a/po/nn_NO.po +++ b/po/nn_NO.po @@ -112,6 +112,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/pl_PL.po b/po/pl_PL.po index 28e8f76..dfd1360 100644 --- a/po/pl_PL.po +++ b/po/pl_PL.po @@ -111,6 +111,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/pt_PT.po b/po/pt_PT.po index e0f7411..3d5c725 100644 --- a/po/pt_PT.po +++ b/po/pt_PT.po @@ -111,6 +111,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/ro_RO.po b/po/ro_RO.po index bbeffd2..0887d2e 100644 --- a/po/ro_RO.po +++ b/po/ro_RO.po @@ -112,6 +112,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/ru_RU.po b/po/ru_RU.po index af4305e..e13e12b 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -111,6 +111,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/sl_SI.po b/po/sl_SI.po index 9b39fff..eaa37f5 100644 --- a/po/sl_SI.po +++ b/po/sl_SI.po @@ -112,6 +112,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/sv_SE.po b/po/sv_SE.po index 25b3f4b..3cb7520 100644 --- a/po/sv_SE.po +++ b/po/sv_SE.po @@ -112,6 +112,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/po/tr_TR.po b/po/tr_TR.po index 0cd0888..df3cd0d 100644 --- a/po/tr_TR.po +++ b/po/tr_TR.po @@ -112,6 +112,9 @@ msgstr "" msgid "Couldn't grab image from primary device" msgstr "" +msgid "Timer conflicts detected! You should check the conflicting timers." +msgstr "" + msgid "Couldn't aquire access to channels, please try again later." msgstr "" diff --git a/timerconflict.cpp b/timerconflict.cpp index a08a836..6f2c95c 100644 --- a/timerconflict.cpp +++ b/timerconflict.cpp @@ -1,10 +1,15 @@ +#include <time.h> + #include <vector> -#include "timerconflict.h" + +#include <vdr/plugin.h> + #include "tools.h" -#include "epgsearch/services.h" #include "exception.h" #include "epgsearch.h" -#include <vdr/plugin.h> +#include "epgsearch/services.h" + +#include "timerconflict.h" namespace vdrlive { @@ -80,4 +85,33 @@ namespace vdrlive { return service.handler->IsConflictCheckAdvised(); } + TimerConflictNotifier::TimerConflictNotifier() + : lastCheck(0) + , conflicts() + { + } + + TimerConflictNotifier::~TimerConflictNotifier() + { + } + + bool TimerConflictNotifier::ShouldNotify() + { + time_t now = time(0); + bool reCheckAdvised((now - lastCheck) > CHECKINTERVAL); + + if (reCheckAdvised && TimerConflicts::CheckAdvised()) { + lastCheck = now; + conflicts.reset(new TimerConflicts()); + return conflicts->size() > 0; + } + return false; + } + + std::string TimerConflictNotifier::Message() const + { + int count = conflicts ? conflicts->size() : 0; + return count > 0 ? tr("Timer conflicts detected! You should check the conflicting timers.") : ""; + } + } // namespace vdrlive diff --git a/timerconflict.h b/timerconflict.h index 07b82ff..80fba99 100644 --- a/timerconflict.h +++ b/timerconflict.h @@ -3,6 +3,8 @@ #include <list> +#include "stdext.h" + namespace vdrlive { // classes for timer conflict interface @@ -63,11 +65,21 @@ namespace vdrlive { class TimerConflictNotifier { public: - TimerConflictNotifier(time_t lastCheck = 0); + typedef std::tr1::shared_ptr<TimerConflicts> TimerConflictsPtr; + + TimerConflictNotifier(); + virtual ~TimerConflictNotifier(); - bool ShouldNotify() const; + bool ShouldNotify(); std::string Message() const; + TimerConflictsPtr const CurrentConflicts() const { return conflicts; } + + static int const CHECKINTERVAL = 30; // recheck value in seconds. + + private: + time_t lastCheck; + TimerConflictsPtr conflicts; }; // class TimerConflictNotifier } |