fix convertDVBUTF8 default table (0 is now iso6397 but we want iso8859-1)
[enigma2.git] / lib / service / listboxservice.cpp
index b59b0f32c5844c7226e994a1d89f012689d73f09..a2c6b8fedd3e6a7f100cb5bf61c8611902608edc 100644 (file)
@@ -67,7 +67,7 @@ void eListboxServiceContent::setRoot(const eServiceReference &root, bool justSet
                m_lst=0;
                return;
        }
-       assert(m_service_center);
+       ASSERT(m_service_center);
        
        if (m_service_center->list(m_root, m_lst))
                eDebug("no list available!");
@@ -446,10 +446,17 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
 {
        painter.clip(eRect(offset, m_itemsize));
 
-       bool marked = m_current_marked || (cursorValid() && isMarked(*m_cursor));
+       int marked = 0;
 
-       if (marked)
-               style.setStyle(painter, selected ? eWindowStyle::styleListboxMarkedAndSelected : eWindowStyle::styleListboxMarked);
+       if (m_current_marked && selected)
+               marked = 2;
+       else if (cursorValid() && isMarked(*m_cursor))
+       {
+               if (selected)
+                       marked = 2;
+               else
+                       marked = 1;
+       }
        else
                style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
 
@@ -459,22 +466,21 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
        if (m_listbox)
                local_style = m_listbox->getLocalStyle();
 
-       if (marked)
+       if (marked == 1)  // marked
        {
-               if (selected)
-               {
-                       if (m_color_set[markedForegroundSelected])
-                               painter.setForegroundColor(m_color[markedForegroundSelected]);
-                       if (m_color_set[markedBackgroundSelected])
-                               painter.setBackgroundColor(m_color[markedBackgroundSelected]);
-               }
-               else
-               {
-                       if (m_color_set[markedForeground])
-                               painter.setForegroundColor(m_color[markedForeground]);
-                       if (m_color_set[markedBackground])
-                               painter.setBackgroundColor(m_color[markedBackground]);
-               }
+               style.setStyle(painter, eWindowStyle::styleListboxMarked);
+               if (m_color_set[markedForeground])
+                       painter.setForegroundColor(m_color[markedForeground]);
+               if (m_color_set[markedBackground])
+                       painter.setBackgroundColor(m_color[markedBackground]);
+       }
+       else if (marked == 2) // marked and selected
+       {
+               style.setStyle(painter, eWindowStyle::styleListboxMarkedAndSelected);
+               if (m_color_set[markedForegroundSelected])
+                       painter.setForegroundColor(m_color[markedForegroundSelected]);
+               if (m_color_set[markedBackgroundSelected])
+                       painter.setBackgroundColor(m_color[markedBackgroundSelected]);
        }
        else if (local_style)
        {
@@ -514,8 +520,6 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                        painter.clear();
        }
 
-       painter.clear();
-       
        if (cursorValid())
        {
                        /* get service information */
@@ -580,7 +584,7 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
                                case celServiceInfo:
                                {
                                        ePtr<eServiceEvent> evt;
-                                       if ( service_info && !service_info->getEvent(*m_cursor, evt) )
+                                       if ( isPlayable && service_info && !service_info->getEvent(*m_cursor, evt) )
                                        {
                                                std::string name = evt->getEventName();
                                                if (!name.length())
@@ -686,9 +690,11 @@ void eListboxServiceContent::paint(gPainter &painter, eWindowStyle &style, const
 void eListboxServiceContent::setIgnoreService( const eServiceReference &service )
 {
        m_is_playable_ignore=service;
+       if (m_listbox && m_listbox->isVisible())
+               m_listbox->invalidate();
 }
 
-int eListboxServiceContent::setItemHeight(int height)
+void eListboxServiceContent::setItemHeight(int height)
 {
        m_itemheight = height;
        if (m_listbox)