X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/20fdb2a2af40da98427a702a03a79b1fbec3d7af..4d1d2ce204939729857de900e39ef0fc2379213f:/lib/service/listboxservice.cpp diff --git a/lib/service/listboxservice.cpp b/lib/service/listboxservice.cpp index 4e20fcb7..cd48c62e 100644 --- a/lib/service/listboxservice.cpp +++ b/lib/service/listboxservice.cpp @@ -3,12 +3,29 @@ #include #include #include +#include -void eListboxServiceContent::setRoot(const eServiceReference &root) +void eListboxServiceContent::addService(const eServiceReference &service) +{ + m_list.push_back(service); +} + +void eListboxServiceContent::FillFinished() +{ + m_size = m_list.size(); + cursorHome(); + + if (m_listbox) + m_listbox->entryReset(); +} + +void eListboxServiceContent::setRoot(const eServiceReference &root, bool justSet) { m_list.clear(); m_root = root; - + + if (justSet) + return; assert(m_service_center); ePtr lst; @@ -18,11 +35,7 @@ void eListboxServiceContent::setRoot(const eServiceReference &root) if (lst->getContent(m_list)) eDebug("getContent failed"); - m_size = m_list.size(); - cursorHome(); - - if (m_listbox) - m_listbox->entryReset(); + FillFinished(); } void eListboxServiceContent::setCurrent(const eServiceReference &ref) @@ -335,28 +348,12 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const { painter.clip(eRect(offset, m_itemsize)); - bool tuneable=true; - -#if 0 - if (m_res_mgr && cursorValid() && !((m_cursor->flags & eServiceReference::flagDirectory) == eServiceReference::flagDirectory)) - { - eServiceReferenceDVB &ref = (eServiceReferenceDVB&) *m_cursor; - eDVBChannelID chid; - ref.getChannelID(chid); - tuneable = m_res_mgr->canAllocateChannel(chid); - } -#endif - 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()) @@ -364,7 +361,10 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const /* get service information */ ePtr 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]) @@ -447,3 +447,7 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const painter.clippop(); } +void eListboxServiceContent::setIgnoreService( const eServiceReference &service ) +{ + m_is_playable_ignore=service; +}