From 4781a18ce05be3fcef111611d07a655acc0cc334 Mon Sep 17 00:00:00 2001 From: Sascha Volkenandt Date: Fri, 1 Jun 2007 20:21:04 +0000 Subject: - moved to uniform features detector --- epgsearch.cpp | 15 +++++++++------ epgsearch.h | 2 -- pages/menu.ecpp | 5 +++-- pages/schedule.ecpp | 3 ++- pages/whats_on.ecpp | 5 +++-- setup.cpp | 5 ----- setup.h | 2 +- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/epgsearch.cpp b/epgsearch.cpp index 468e0a7..cd56605 100644 --- a/epgsearch.cpp +++ b/epgsearch.cpp @@ -6,6 +6,7 @@ #include "epgsearch/services.h" #include "epgsearch.h" #include "exception.h" +#include "livefeatures.h" #include "tools.h" namespace vdrlive { @@ -25,12 +26,14 @@ bool operator<( SearchTimer const& left, SearchTimer const& right ) bool CheckEpgsearchVersion() { - cPlugin* epgsearch = cPluginManager::GetPlugin("epgsearch"); - if (!epgsearch) return false; - char minVersion[] = "0.9.22"; - if (string(epgsearch->Version()) < string(minVersion)) - throw HtmlError( tr("Required minimum version of epgsearch: ") + string(minVersion)); - return true; + /* @winni: Falls Du an der Versionsnummer Anpassungen vornehmen willst, mach das bitte in livefeatures.h ganz unten. Danke */ + Features< features::epgsearch >& f = LiveFeatures< features::epgsearch >(); + if ( f.Loaded() ) { + if ( !f.Recent() ) + throw HtmlError( tr("Required minimum version of epgsearch: ") + string( f.MinVersion() )); + return true; + } + return false; } SearchTimer::SearchTimer() diff --git a/epgsearch.h b/epgsearch.h index 3b23ef3..be8bf0c 100644 --- a/epgsearch.h +++ b/epgsearch.h @@ -14,8 +14,6 @@ class SearchTimer; bool operator<( SearchTimer const& left, SearchTimer const& right ); -bool CheckEpgsearchVersion(); - class SearchTimer { public: diff --git a/pages/menu.ecpp b/pages/menu.ecpp index 2791b2d..e94e885 100644 --- a/pages/menu.ecpp +++ b/pages/menu.ecpp @@ -2,6 +2,7 @@ #include #include #include +#include "livefeatures.h" #include "setup.h" using namespace std; @@ -34,7 +35,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); ><$ tr("What's on?") $> | ><$ tr("Schedule") $> | ><$ tr("Timers") $> | -% if (LiveSetup().HaveEPGSearch()) { +% if ( LiveFeatures< features::epgsearch >().Recent() ) { ><$ tr("Search") $> | ><$ tr("Searchtimers") $> | % } @@ -56,7 +57,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <& menu.component current=("whats_on") &> <& menu.component current=("schedule") &> <& menu.component current=("timers") &> -% if (LiveSetup().HaveEPGSearch()) { +% if ( LiveFeatures< features::epgsearch >().Recent() ) { <& menu.component current=("search") &> <& menu.component current=("searchtimers") &> % } diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp index a02c32c..5357b3d 100644 --- a/pages/schedule.ecpp +++ b/pages/schedule.ecpp @@ -4,6 +4,7 @@ #include #include #include "exception.h" +#include "livefeatures.h" #include "setup.h" #include "tools.h" #include "epg_events.h" @@ -107,7 +108,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); % } "> <& pageelems.event_timer channelid=(channel_id) eventid=(event) &> -% if (LiveSetup().HaveEPGSearch()) { +% if ( LiveFeatures< features::epgsearch >().Recent() ) { > % } > diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index 0b274e1..bbbb73b 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -4,6 +4,7 @@ #include #include #include +#include "livefeatures.h" #include "setup.h" #include "tools.h" #include "epg_events.h" @@ -136,7 +137,7 @@ if (type == "now") { % if (type == "now") { <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channel_id) image="zap.png" alt="" &> % } -% if (LiveSetup().HaveEPGSearch()) { +% if ( LiveFeatures< features::epgsearch >().Recent() ) { > % } > @@ -159,7 +160,7 @@ if (type == "now") { % if (type == "now") { <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channel_id) image="zap.png" alt="" &> % } -% if (LiveSetup().HaveEPGSearch()) { +% if ( LiveFeatures< features::epgsearch >().Recent() ) { > % } > diff --git a/setup.cpp b/setup.cpp index e2cde21..74d853a 100644 --- a/setup.cpp +++ b/setup.cpp @@ -106,11 +106,6 @@ bool Setup::CheckServerIps() return true; } -bool Setup::HaveEPGSearch(void) -{ - return cPluginManager::GetPlugin("epgsearch") != NULL; -} - std::string Setup::GetMD5HashAdminPassword() const { // format is : diff --git a/setup.h b/setup.h index 382106d..8c35c5c 100644 --- a/setup.h +++ b/setup.h @@ -53,7 +53,7 @@ public: char const* CommandLineHelp() const; bool ParseSetupEntry( char const* name, char const* value ); - bool HaveEPGSearch(void); + private: Setup(); Setup( Setup const& ); -- cgit v1.2.3