aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-03-10 21:08:12 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-03-10 21:08:12 +0000
commit9f9398866adac30930d3d485e03d7810309461a9 (patch)
tree426fc3182040f40e43df658598fc6923a1c9694e /lib
parentb44140e41f6ddaa1094e181c3de6aca183f0a48b (diff)
downloadenigma2-9f9398866adac30930d3d485e03d7810309461a9.tar.gz
enigma2-9f9398866adac30930d3d485e03d7810309461a9.zip
dont show pip options in extension menu when no pip is available
Diffstat (limited to 'lib')
-rw-r--r--lib/python/Components/SystemInfo.py11
-rw-r--r--lib/python/Screens/InfoBarGenerics.py11
-rw-r--r--lib/python/Tools/Directories.py4
3 files changed, 18 insertions, 8 deletions
diff --git a/lib/python/Components/SystemInfo.py b/lib/python/Components/SystemInfo.py
index a3b83fd9..f33a8552 100644
--- a/lib/python/Components/SystemInfo.py
+++ b/lib/python/Components/SystemInfo.py
@@ -1 +1,10 @@
-SystemInfo = { } \ No newline at end of file
+SystemInfo = { }
+
+#FIXMEE...
+def getNumVideoDecoders():
+ from Tools.Directories import fileExists
+ idx = 0
+ while fileExists("/dev/dvb/adapter0/video%d"%(idx), 'w'):
+ idx += 1
+
+SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 3bc8a419..66af3574 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -12,6 +12,7 @@ from Components.ServiceEventTracker import ServiceEventTracker
from Components.Sources.Source import ObsoleteSource
from Components.Sources.Boolean import Boolean
from Components.config import config, ConfigBoolean, ConfigClock
+from Components.SystemInfo import SystemInfo
from EpgSelection import EPGSelection
from Plugins.Plugin import PluginDescriptor
@@ -1309,13 +1310,13 @@ class InfoBarSleepTimer:
class InfoBarPiP:
def __init__(self):
self.session.pipshown = False
-
- self.addExtension((self.getShowHideName, self.showPiP, self.available), "blue")
- self.addExtension((self.getMoveName, self.movePiP, self.pipShown), "green")
- self.addExtension((self.getSwapName, self.swapPiP, self.pipShown), "yellow")
+ if SystemInfo.get("NumVideoDecoders", 1) > 1:
+ self.addExtension((self.getShowHideName, self.showPiP, self.available), "blue")
+ self.addExtension((self.getMoveName, self.movePiP, self.pipShown), "green")
+ self.addExtension((self.getSwapName, self.swapPiP, self.pipShown), "yellow")
def available(self):
- return True
+ return SystemInfo.get("NumVideoDecoders", 1) > 1
def pipShown(self):
return self.session.pipshown
diff --git a/lib/python/Tools/Directories.py b/lib/python/Tools/Directories.py
index 0096f3f4..4cdb1d42 100644
--- a/lib/python/Tools/Directories.py
+++ b/lib/python/Tools/Directories.py
@@ -105,9 +105,9 @@ def createDir(path):
ret = 1
return ret
-def fileExists(f):
+def fileExists(f, mode='r'):
try:
- file = open(f)
+ file = open(f, mode)
except IOError:
exists = 0
else: