diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2005-12-02 14:30:21 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2005-12-02 14:30:21 +0000 |
| commit | 2c1f4947646d051133197a23a73ee985b56e1713 (patch) | |
| tree | b1b9c723d0338f5c550989765c501f5a98bc4fac /lib/service | |
| parent | f15ee3f6cd34e4552f50dcc92a994198ed3b2dfe (diff) | |
| download | enigma2-2c1f4947646d051133197a23a73ee985b56e1713.tar.gz enigma2-2c1f4947646d051133197a23a73ee985b56e1713.zip | |
set foregroundcolor of non tuneable services in servicelist to gray (for linked tuner mode)
Diffstat (limited to 'lib/service')
| -rw-r--r-- | lib/service/listboxservice.cpp | 25 | ||||
| -rw-r--r-- | lib/service/listboxservice.h | 4 |
2 files changed, 26 insertions, 3 deletions
diff --git a/lib/service/listboxservice.cpp b/lib/service/listboxservice.cpp index 0b2e621c..9d68a5e8 100644 --- a/lib/service/listboxservice.cpp +++ b/lib/service/listboxservice.cpp @@ -2,6 +2,7 @@ #include <lib/service/service.h> #include <lib/gdi/font.h> #include <lib/dvb/epgcache.h> +#include <lib/dvb/pmt.h> void eListboxServiceContent::setRoot(const eServiceReference &root) { @@ -165,10 +166,12 @@ void eListboxServiceContent::sort() DEFINE_REF(eListboxServiceContent); eListboxServiceContent::eListboxServiceContent() - :epgcache(eEPGCache::getInstance()), m_visual_mode(visModeSimple), m_size(0), m_current_marked(false), m_numberoffset(0) + :m_epgcache(eEPGCache::getInstance()), m_visual_mode(visModeSimple), m_size(0), m_current_marked(false), m_numberoffset(0) { cursorHome(); eServiceCenter::getInstance(m_service_center); + if (eDVBResourceManager::getInstance(m_res_mgr)) + eDebug("no resource manager"); } void eListboxServiceContent::cursorHome() @@ -334,12 +337,30 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const { painter.clip(eRect(offset, m_itemsize)); + bool tuneable=true; + + if (m_res_mgr && cursorValid() && !((m_cursor->flags & eServiceReference::flagDirectory) == eServiceReference::flagDirectory)) + { + if ( eDVBServicePMTHandler::getCount() > 1 ) + { + eServiceReferenceDVB &ref = (eServiceReferenceDVB&) *m_cursor; + eUsePtr<iDVBChannel> channel; + eDVBChannelID chid; + ref.getChannelID(chid); + tuneable = !m_res_mgr->allocateChannel(chid, channel, true); // no real allocate channel..just fake + } + } + if (m_current_marked && selected) style.setStyle(painter, eWindowStyle::styleListboxMarked); else if (cursorValid() && isMarked(*m_cursor)) style.setStyle(painter, eWindowStyle::styleListboxMarked); else + { style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal); + if (!tuneable) + painter.setForegroundColor(gRGB(0xbbbbbb)); + } painter.clear(); if (cursorValid()) @@ -381,7 +402,7 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const { ePtr<eServiceEvent> evt; time_t t=-1; - if ( !epgcache->lookupEventTime(*m_cursor, t, evt) ) + if ( !m_epgcache->lookupEventTime(*m_cursor, t, evt) ) text = '(' + evt->getEventName() + ')'; else continue; diff --git a/lib/service/listboxservice.h b/lib/service/listboxservice.h index ae0ec5a6..6e8d5017 100644 --- a/lib/service/listboxservice.h +++ b/lib/service/listboxservice.h @@ -1,6 +1,7 @@ #ifndef __lib_service_listboxservice_h #define __lib_service_listboxservice_h +#include <lib/dvb/dvb.h> #include <lib/gui/elistbox.h> #include <lib/service/iservice.h> #include <set> @@ -10,7 +11,8 @@ class eEPGCache; class eListboxServiceContent: public virtual iListboxContent { DECLARE_REF(eListboxServiceContent); - eEPGCache *epgcache; + eEPGCache *m_epgcache; + ePtr<eDVBResourceManager> m_res_mgr; public: eListboxServiceContent(); void setRoot(const eServiceReference &ref); |
