From 8b78162072c8c0af8da6fc53af8f4ebe65c410fd Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Mon, 15 Jun 2009 00:51:49 +0200 Subject: make msg translatable --- lib/python/Plugins/SystemPlugins/Videomode/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/python') diff --git a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py index 6b6d5045..7a2127ac 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py @@ -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() -- cgit v1.2.3 From c68943c97eeb0107f724ec96aae311e319c750a9 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Mon, 15 Jun 2009 01:38:16 +0200 Subject: allow position="center,center" to center screen client area on screen --- lib/python/Components/GUISkin.py | 3 +++ skin.py | 24 +++++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'lib/python') diff --git a/lib/python/Components/GUISkin.py b/lib/python/Components/GUISkin.py index 9eb4a80b..1bd27297 100644 --- a/lib/python/Components/GUISkin.py +++ b/lib/python/Components/GUISkin.py @@ -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) diff --git a/skin.py b/skin.py index a76f7942..5fcaa110 100644 --- 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': -- cgit v1.2.3 From 17d12fc3339d68b023ab6f388a3576af2bcb4949 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Mon, 15 Jun 2009 02:05:00 +0200 Subject: use ::getInfoObject for filesize (allows >4G) --- lib/python/Components/Converter/MovieInfo.py | 2 +- lib/service/servicedvb.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/python') diff --git a/lib/python/Components/Converter/MovieInfo.py b/lib/python/Components/Converter/MovieInfo.py index 635cedc4..d5995fe8 100644 --- a/lib/python/Components/Converter/MovieInfo.py +++ b/lib/python/Components/Converter/MovieInfo.py @@ -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) diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index c256213d..70675fd7 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -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 &evt, time_t start_time) { if (!ref.path.empty()) -- cgit v1.2.3