add support for read signal quality, power and biterror rate from python
[enigma2.git] / lib / service / listboxservice.cpp
index 9d68a5e835aecb42301d88b3cde352750bd143c9..035658ee1a6d5f3c9543106375b9a5e760a2e471 100644 (file)
@@ -166,12 +166,10 @@ void eListboxServiceContent::sort()
 DEFINE_REF(eListboxServiceContent);
 
 eListboxServiceContent::eListboxServiceContent()
-       :m_epgcache(eEPGCache::getInstance()), m_visual_mode(visModeSimple), m_size(0), m_current_marked(false), m_numberoffset(0)
+       :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()
@@ -337,30 +335,12 @@ 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())
@@ -368,7 +348,10 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                        /* get service information */
                ePtr<iStaticServiceInformation> service_info;
                m_service_center->info(*m_cursor, service_info);
-               
+
+               if (m_is_playable_ignore.valid() && !service_info->isPlayable(*m_cursor, m_is_playable_ignore))
+                       painter.setForegroundColor(gRGB(0xbbbbbb));
+
                for (int e = 0; e < celElements; ++e)
                {
                        if (!m_element_font[e])
@@ -401,8 +384,7 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                        case celServiceInfo:
                        {
                                ePtr<eServiceEvent> evt;
-                               time_t t=-1;
-                               if ( !m_epgcache->lookupEventTime(*m_cursor, t, evt) )
+                               if ( !service_info->getEvent(*m_cursor, evt) )
                                        text = '(' + evt->getEventName() + ')';
                                else
                                        continue;
@@ -452,3 +434,7 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
        painter.clippop();
 }
 
+void eListboxServiceContent::setIgnoreService( const eServiceReference &service )
+{
+       m_is_playable_ignore=service;
+}