Merge branch 'master' of git.opendreambox.org:/git/enigma2
authorghost <andreas.monzner@multimedia-labs.de>
Tue, 16 Jun 2009 16:30:27 +0000 (18:30 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Tue, 16 Jun 2009 16:30:27 +0000 (18:30 +0200)
lib/base/filepush.cpp
lib/gui/ewidget.cpp
lib/gui/ewidget.h
lib/python/Components/Converter/MovieInfo.py
lib/python/Components/GUISkin.py
lib/python/Plugins/SystemPlugins/Videomode/plugin.py
lib/service/servicedvb.cpp
skin.py

index d43b6e1..605ec8a 100644 (file)
@@ -192,7 +192,7 @@ void eFilePushThread::thread()
                                
                                struct pollfd pfd;
                                pfd.fd = m_fd_dest;
-                               pfd.events = POLLHUP;
+                               pfd.events = POLLPRI;
                                poll(&pfd, 1, 10000);
                                sleep(5); /* HACK to allow ES buffer to drain */
                                already_empty = 1;
index 2320cd4..fea3524 100644 (file)
@@ -54,6 +54,7 @@ void eWidget::resize(eSize size)
                   only once. */
        eSize old_size = m_size;
        eSize old_offset = m_client_offset;
+       m_client_size = size;
        m_client_offset = eSize(0, 0);
        event(evtWillChangeSize, &size, &m_client_offset);
        if (old_size == m_size)
index 7ddbbc5..8af66b0 100644 (file)
@@ -22,6 +22,7 @@ public:
        
        ePoint position() const { return m_position; }
        eSize size() const { return m_size; }
+       eSize csize() const { return m_client_size; }
 
        void invalidate(const gRegion &region = gRegion::invalidRegion());
        
@@ -68,7 +69,7 @@ private:
 
        ePtrList<eWidget> m_childs;
        ePoint m_position;
-       eSize m_size;
+       eSize m_size, m_client_size;
                /* will be accounted when there's a client offset */
        eSize m_client_offset;
        eWidget *m_parent;
index 635cedc..d5995fe 100644 (file)
@@ -41,7 +41,7 @@ class MovieInfo(Converter, object):
                                rec_ref_str = info.getInfoString(service, iServiceInformation.sServiceref)
                                return ServiceReference(rec_ref_str).getServiceName()
                        elif self.type == self.MOVIE_REC_FILESIZE:
-                               return "%d MB" % (info.getInfo(service, iServiceInformation.sFileSize) / (1024*1024))
+                               return "%d MB" % (info.getInfoObject(service, iServiceInformation.sFileSize) / (1024*1024))
                return ""
 
        text = property(getText)
index 9eb4a80..1bd2729 100644 (file)
@@ -85,6 +85,9 @@ class GUISkin:
                if not self.instance:
                        from enigma import eWindow
                        self.instance = eWindow(self.desktop, z)
+
+               # we need to make sure that certain attributes come last
+               self.skinAttributes.sort(key=lambda a: {"position": 1}.get(a[0], 0))
                self.title = title
                applyAllAttributes(self.instance, self.desktop, self.skinAttributes, self.scale)
                self.createGUIScreen(self.instance, self.desktop)
index 6b6d504..7a2127a 100644 (file)
@@ -139,7 +139,7 @@ class VideoSetup(Screen, ConfigListScreen):
                if (port, mode, rate) != self.last_good:
                        self.hw.setMode(port, mode, rate)
                        from Screens.MessageBox import MessageBox
-                       self.session.openWithCallback(self.confirm, MessageBox, "Is this videomode ok?", MessageBox.TYPE_YESNO, timeout = 20, default = False)
+                       self.session.openWithCallback(self.confirm, MessageBox, _("Is this videomode ok?"), MessageBox.TYPE_YESNO, timeout = 20, default = False)
                else:
                        self.keySave()
 
index c256213..70675fd 100644 (file)
@@ -336,6 +336,7 @@ public:
        int isPlayable(const eServiceReference &ref, const eServiceReference &ignore) { return 1; }
        int getInfo(const eServiceReference &ref, int w);
        std::string getInfoString(const eServiceReference &ref,int w);
+       PyObject *getInfoObject(const eServiceReference &r, int what);
 };
 
 DEFINE_REF(eStaticServiceDVBPVRInformation);
@@ -427,6 +428,17 @@ std::string eStaticServiceDVBPVRInformation::getInfoString(const eServiceReferen
        }
 }
 
+PyObject *eStaticServiceDVBPVRInformation::getInfoObject(const eServiceReference &r, int what)
+{
+       switch (what)
+       {
+       case iServiceInformation::sFileSize:
+               return PyLong_FromLongLong(m_parser.m_filesize);
+       default:
+               Py_RETURN_NONE;
+       }
+}
+
 RESULT eStaticServiceDVBPVRInformation::getEvent(const eServiceReference &ref, ePtr<eServiceEvent> &evt, time_t start_time)
 {
        if (!ref.path.empty())
diff --git a/skin.py b/skin.py
index a76f794..5fcaa11 100644 (file)
--- a/skin.py
+++ b/skin.py
@@ -70,9 +70,27 @@ profile("LoadSkinDefault")
 loadSkin('skin_default.xml')
 profile("LoadSkinDefaultDone")
 
-def parsePosition(str, scale):
+def evalPos(pos, wsize, ssize, scale):
+       if pos == "center":
+               pos = (ssize - wsize) / 2
+       else:
+               pos = int(pos) * scale[0] / scale[1]
+       return int(pos)
+
+def parsePosition(str, scale, desktop = None, size = None):
        x, y = str.split(',')
-       return ePoint(int(x) * scale[0][0] / scale[0][1], int(y) * scale[1][0] / scale[1][1])
+       
+       wsize = 1, 1
+       ssize = 1, 1
+       if desktop is not None:
+               ssize = desktop.size().width(), desktop.size().height()
+       if size is not None:
+               wsize = size.width(), size.height()
+
+       x = evalPos(x, wsize[0], ssize[0], scale[0])
+       y = evalPos(y, wsize[1], ssize[1], scale[1])
+
+       return ePoint(x, y)
 
 def parseSize(str, scale):
        x, y = str.split(',')
@@ -119,7 +137,7 @@ def applySingleAttribute(guiObject, desktop, attrib, value, scale = ((1,1),(1,1)
        # and set attributes
        try:
                if attrib == 'position':
-                       guiObject.move(parsePosition(value, scale))
+                       guiObject.move(parsePosition(value, scale, desktop, guiObject.csize()))
                elif attrib == 'size':
                        guiObject.resize(parseSize(value, scale))
                elif attrib == 'title':