New fix for reload picons after tuxtxt now also mute is coming back
authorLittlesat <Littlesat99@yahoo.com>
Sat, 25 Jun 2011 19:40:43 +0000 (21:40 +0200)
committerLittlesat <Littlesat99@yahoo.com>
Sat, 25 Jun 2011 19:40:43 +0000 (21:40 +0200)
As I got segmentation faults while using PSignal and calling python
functions from cpp I used a polling mechanism

lib/components/tuxtxtapp.cpp
lib/components/tuxtxtapp.h
lib/python/Components/Renderer/Picon.py
lib/python/Screens/InfoBarGenerics.py

index 10fe384..64c1493 100644 (file)
@@ -6,6 +6,7 @@
 #include <lib/gdi/fb.h>
 #include <lib/gui/ewidget.h>
 #include <lib/gui/ewidgetdesktop.h>
+#include <lib/python/python.h>
 
 extern "C" int tuxtxt_run_ui(int pid, int demux);
 extern "C" int tuxtxt_init();
@@ -62,6 +63,16 @@ void eTuxtxtApp::thread_finished()
        getDesktop(0)->resize(getDesktop(0)->size());
 }
 
+PyObject *eTuxtxtApp::getTuxtxtUIRunning()
+{
+       ePyObject tuple = PyTuple_New(1);
+       if (uiRunning)
+               PyTuple_SET_ITEM(tuple, 0, PyInt_FromLong(1));
+       else
+               PyTuple_SET_ITEM(tuple, 0, PyInt_FromLong(0));
+       return tuple;
+}
+
 void eTuxtxtApp::initCache()
 {
        if (enableTtCaching)
index 9cd8f0c..3a40610 100644 (file)
@@ -4,6 +4,7 @@
 #include <string>
 #include <lib/base/ebase.h>
 #include <lib/base/thread.h>
+#include <lib/python/python.h>
 
 class eTuxtxtApp: private eThread, public Object
 {
@@ -22,6 +23,7 @@ public:
        ~eTuxtxtApp();
        static eTuxtxtApp *getInstance() { return instance; }
        int startUi();
+       PyObject *getTuxtxtUIRunning();
        void initCache();
        void freeCache();
        void startCaching( int tpid, int tdemux );
index 1caa730..1c78b41 100644 (file)
@@ -6,7 +6,6 @@ from Components.Harddisk import harddiskmanager
 
 searchPaths = []
 picons = []
-piconsInvalidated = False
 
 def initPiconPaths():
        global searchPaths
@@ -45,17 +44,10 @@ def onPartitionChange(why, part):
                onMountpointRemoved(part.mountpoint)
 
 def reloadPicons():
-       global piconsInvalidated
-       if piconsInvalidated and picons:
-               for s in picons:
-                       if s.instance and s.pngname:
-                                s.instance.setPixmapFromFile(s.pngname)
-       piconsInvalidated = False
+       for s in picons:
+               if s.instance and s.pngname:
+                       s.instance.setPixmapFromFile(s.pngname)
 
-def invalidatePicons():
-       global piconsInvalidated
-       piconsInvalidated = True        
-                                               
 class Picon(Renderer):
        def __init__(self):
                picons.append(self)
index 095e33c..0777233 100644 (file)
@@ -11,7 +11,6 @@ from Components.Sources.Boolean import Boolean
 from Components.config import config, ConfigBoolean, ConfigClock
 from Components.SystemInfo import SystemInfo
 from Components.UsageConfig import preferredInstantRecordPath, defaultMoviePath
-from Components.Renderer.Picon import reloadPicons, invalidatePicons
 from EpgSelection import EPGSelection
 from Plugins.Plugin import PluginDescriptor
 
@@ -164,7 +163,6 @@ class InfoBarShowHide:
                                self.doShow()
 
        def __onShow(self):
-               reloadPicons()
                self.__state = self.STATE_SHOWN
                self.startHideTimer()
 
@@ -2211,7 +2209,6 @@ class InfoBarTeletextPlugin:
 
        def startTeletext(self):
                self.teletext_plugin(session=self.session, service=self.session.nav.getCurrentService())
-               invalidatePicons()
 
 class InfoBarSubtitleSupport(object):
        def __init__(self):