dont ask for scanning second nim in automatic scan, when it is not meaningful
[enigma2.git] / lib / python / Screens / InfoBarGenerics.py
index 0531de95a1865c23bc0f1b746b231144bcedb7fc..037fe18e4542472ef1bf9aafad242219c4e149f9 100644 (file)
@@ -1,32 +1,33 @@
-from Screen import Screen
-from Components.ActionMap import ActionMap, HelpableActionMap
-from Components.ActionMap import NumberActionMap
-from Components.Label import *
-from Components.ProgressBar import *
-from Components.config import configfile, configsequencearg
-from Components.config import config, configElement, ConfigSubsection, configSequence
 from ChannelSelection import ChannelSelection, BouquetSelector
 
-from Components.Pixmap import Pixmap, PixmapConditional
+from Components.ActionMap import ActionMap, HelpableActionMap
+from Components.ActionMap import NumberActionMap
 from Components.BlinkingPixmap import BlinkingPixmapConditional
-from Components.ServiceName import ServiceName
-from Components.EventInfo import EventInfo, EventInfoProgress
 from Components.Clock import Clock
+from Components.EventInfo import EventInfo, EventInfoProgress
+from Components.Harddisk import harddiskmanager
 from Components.Input import Input
+from Components.Label import *
+from Components.Pixmap import Pixmap, PixmapConditional
+from Components.PluginComponent import plugins
+from Components.ProgressBar import *
+from Components.ServiceEventTracker import ServiceEventTracker
+from Components.ServiceName import ServiceName
+from Components.config import config, configElement, ConfigSubsection, configSequence, configElementBoolean
+from Components.config import configfile, configsequencearg
 
-from ServiceReference import ServiceReference
 from EpgSelection import EPGSelection
+from Plugins.Plugin import PluginDescriptor
 
-from Screens.MessageBox import MessageBox
+from Screen import Screen
 from Screens.ChoiceBox import ChoiceBox
-from Screens.InputBox import InputBox
 from Screens.Dish import Dish
-from Screens.Standby import Standby
 from Screens.EventView import EventViewEPGSelect, EventViewSimple
+from Screens.InputBox import InputBox
+from Screens.MessageBox import MessageBox
 from Screens.MinuteInput import MinuteInput
-from Components.Harddisk import harddiskmanager
-
-from Components.ServiceEventTracker import ServiceEventTracker
+from Screens.Standby import Standby
+from ServiceReference import ServiceReference
 
 from Tools import Notifications
 from Tools.Directories import *
@@ -269,12 +270,17 @@ class InfoBarNumberZap:
                        self.servicelist.setCurrentSelection(service) #select the service in servicelist
                        self.servicelist.zap()
 
+config.misc.initialchannelselection = configElementBoolean("config.misc.initialchannelselection", 1);
+
 class InfoBarChannelSelection:
        """ ChannelSelection - handles the channelSelection dialog and the initial 
        channelChange actions which open the channelSelection dialog """
        def __init__(self):
                #instantiate forever
                self.servicelist = self.session.instantiateDialog(ChannelSelection)
+               
+               if config.misc.initialchannelselection.value == 1:
+                       self.onShown.append(self.firstRun)
 
                self["ChannelSelectActions"] = HelpableActionMap(self, "InfobarChannelSelection",
                        {
@@ -286,6 +292,12 @@ class InfoBarChannelSelection:
                                "historyNext": (self.historyNext, _("next channel in history"))
                        })
 
+       def firstRun(self):
+               self.onShown.remove(self.firstRun)
+               config.misc.initialchannelselection.value = 0
+               config.misc.initialchannelselection.save()
+               self.switchChannelDown()
+               
        def historyBack(self):
                self.servicelist.historyBack()
 
@@ -1403,3 +1415,21 @@ class InfoBarSummarySupport:
        
        def createSummary(self):
                return InfoBarSummary
+
+class InfoBarTeletextPlugin:
+       def __init__(self):
+               self.teletext_plugin = None
+               
+               for p in plugins.getPlugins(PluginDescriptor.WHERE_TELETEXT):
+                       self.teletext_plugin = p
+               
+               if self.teletext_plugin is not None:
+                       self["TeletextActions"] = HelpableActionMap(self, "InfobarTeletextActions",
+                               {
+                                       "startTeletext": (self.startTeletext, "View teletext...")
+                               })
+               else:
+                       print "no teletext plugin found!"
+
+       def startTeletext(self):
+               self.teletext_plugin(session=self.session, service=self.session.nav.getCurrentService())