now its possible to call ePixmap.setPixmap from python without use of
[enigma2.git] / lib / gui / epixmap.cpp
index 31998c1efa61325c0ca60320e04ea36807bb95b4..3e396c98f069c09c2715a396b15ce559934f99cb 100644 (file)
@@ -19,12 +19,24 @@ void ePixmap::setPixmap(gPixmap *pixmap)
        event(evtChangedPixmap);
 }
 
        event(evtChangedPixmap);
 }
 
+void ePixmap::setPixmap(ePtr<gPixmap> &pixmap)
+{
+       m_pixmap = pixmap;
+       event(evtChangedPixmap);
+}
+
 void ePixmap::setPixmapFromFile(const char *filename)
 {
        loadPNG(m_pixmap, filename);
 void ePixmap::setPixmapFromFile(const char *filename)
 {
        loadPNG(m_pixmap, filename);
-               
-               // TODO
-       getDesktop()->makeCompatiblePixmap(*m_pixmap);
+       
+       if (!m_pixmap)
+       {
+               eDebug("ePixmap::setPixmapFromFile: loadPNG failed");
+               return;
+       }
+       
+               // TODO: This only works for desktop 0
+       getDesktop(0)->makeCompatiblePixmap(*m_pixmap);
        event(evtChangedPixmap);
 }
 
        event(evtChangedPixmap);
 }