Merge branch 'vuplus_experimental' of code.vuplus.com:/opt/repository/dvbapp into...
authorhschang <chang@dev3>
Wed, 20 Feb 2013 02:51:22 +0000 (11:51 +0900)
committerhschang <chang@dev3>
Wed, 20 Feb 2013 02:51:22 +0000 (11:51 +0900)
lib/python/Plugins/Extensions/HbbTV/locale/Makefile.am
lib/python/Plugins/Extensions/HbbTV/locale/it.po [new file with mode: 0644]
lib/python/Plugins/Extensions/HbbTV/plugin.py
lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py
lib/python/Plugins/SystemPlugins/Videomode/VideoWizard.py

diff --git a/lib/python/Plugins/Extensions/HbbTV/locale/it.po b/lib/python/Plugins/Extensions/HbbTV/locale/it.po
new file mode 100644 (file)
index 0000000..dcfa9d8
--- /dev/null
@@ -0,0 +1,398 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-02-08 11:00+0100\n"
+"PO-Revision-Date: 2013-02-08 11:42+0100\n"
+"Last-Translator: meo <lupomeo@hotmail.com>\n"
+"Language-Team: Black Hole <www.vuplus-community.net>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
+"X-Poedit-Basepath: .\n"
+"X-Poedit-Language: Italian\n"
+"X-Poedit-SearchPath-0: .\n"
+
+#: plugin.py:864
+msgid "HbbTV Plugin"
+msgstr "Plugin HbbTV"
+
+#: plugin.py:977
+msgid ""
+"HbbTV Browser was not running.\n"
+"Please running browser before start HbbTV Application."
+msgstr ""
+"Il Browser per HbbTV non è attivo.\n"
+"Lancia il browser Opera prima di avviare l'applicazione HbbTV."
+
+#: plugin.py:1049
+msgid "No detected HbbTV applications."
+msgstr "Nessuna applicazione HbbTV trovata."
+
+#: plugin.py:1050
+msgid "Please choose an HbbTV application."
+msgstr "Seleziona un'applicazione HbbTV."
+
+#: plugin.py:1061
+msgid "Stop"
+msgstr "Chiudi"
+
+#: plugin.py:1062
+msgid "Start"
+msgstr "Avvia"
+
+#: plugin.py:1063
+msgid "Please choose one."
+msgstr "Seleziona"
+
+#: plugin.py:1179
+#: plugin.py:1317
+msgid "Cancel"
+msgstr "Annulla"
+
+#: plugin.py:1180
+#: plugin.py:1318
+msgid "Save"
+msgstr "Salva"
+
+#: plugin.py:1192
+#: plugin.py:1730
+#: plugin.py:1968
+msgid "Preference"
+msgstr "Preferenze"
+
+#: plugin.py:1205
+msgid ""
+"Invalid URL!!(Empty)\n"
+"Please, Input to the URL."
+msgstr ""
+"Indirizzo non valido!!\n"
+"Devi inserire un indirizzo (URL)."
+
+#: plugin.py:1225
+#: plugin.py:1916
+msgid "Please enter URL here"
+msgstr "Inserisci indirizzo (url)."
+
+#: plugin.py:1247
+msgid "Start Page"
+msgstr "Pagina iniziale"
+
+#: plugin.py:1249
+msgid "Current Page"
+msgstr "Pagina corrente"
+
+#: plugin.py:1250
+msgid "Direct Input"
+msgstr "Input diretto"
+
+#: plugin.py:1252
+msgid "Startpage"
+msgstr "Pagina iniziale"
+
+#: plugin.py:1267
+msgid "Keyboard Layout"
+msgstr "Layout tastiera."
+
+#: plugin.py:1332
+#: plugin.py:1483
+#: plugin.py:1730
+#: plugin.py:1967
+msgid "Bookmark"
+msgstr "Preferiti"
+
+#: plugin.py:1337
+#: plugin.py:1419
+msgid "Name"
+msgstr "Nome"
+
+#: plugin.py:1340
+#: plugin.py:1426
+msgid "Title"
+msgstr "Titolo"
+
+#: plugin.py:1342
+#: plugin.py:1427
+msgid "Url"
+msgstr "Url"
+
+#: plugin.py:1346
+msgid "Invalid "
+msgstr "Non valido"
+
+#: plugin.py:1346
+msgid ""
+"!!(Empty)\n"
+"Please, Input to the "
+msgstr ""
+"!!(Vuoto)\n"
+"Inserisici in "
+
+#: plugin.py:1370
+#: plugin.py:1381
+#: plugin.py:1472
+#: plugin.py:1553
+#: plugin.py:1556
+msgid "Add"
+msgstr "Aggiungi"
+
+#: plugin.py:1373
+#: plugin.py:1377
+msgid "Category Name"
+msgstr "Nome Categoria"
+
+#: plugin.py:1386
+#: plugin.py:1394
+msgid "Bookmark Title"
+msgstr "Titolo bookmark"
+
+#: plugin.py:1389
+#: plugin.py:1397
+msgid "Bookmark URL"
+msgstr "Indirizzo Bookmark"
+
+#: plugin.py:1471
+#: plugin.py:1618
+#: plugin.py:1729
+#: plugin.py:1962
+msgid "Exit"
+msgstr "Esci"
+
+#: plugin.py:1473
+#: plugin.py:1564
+#: plugin.py:1565
+msgid "Edit"
+msgstr "Modifica"
+
+#: plugin.py:1474
+msgid "Delete"
+msgstr "Cancella"
+
+#: plugin.py:1475
+msgid "Set as Startpage"
+msgstr "Configura come Home page"
+
+#: plugin.py:1522
+msgid "Invalid URL. Please check again!!"
+msgstr "Indirizzo non valido, riprova."
+
+#: plugin.py:1530
+msgid "Do you want to set selected url to the Startpage?"
+msgstr "Vuoi Configurare l'indirizzo selezionato come pagina iniziale?"
+
+#: plugin.py:1545
+msgid "Current page is already exist."
+msgstr "La pagina corrente è già esistente."
+
+#: plugin.py:1558
+#: plugin.py:1559
+msgid "Direct Input(Bookmark)"
+msgstr "Inserimento diretto(Bookmark)"
+
+#: plugin.py:1558
+#: plugin.py:1559
+msgid "Direct Input(Category)"
+msgstr "Inserimento diretto(Categoria)"
+
+#: plugin.py:1559
+msgid "Currentpage(Bookmark)"
+msgstr "Pagina corrente(Bookmark)"
+
+#: plugin.py:1560
+msgid "Please choose."
+msgstr "Scegli."
+
+#: plugin.py:1575
+msgid "Do you want to delete the category and the bookmarks?"
+msgstr "Vuoi davvero cancellare la categoria e i suoi preferiti ?"
+
+#: plugin.py:1576
+msgid "Do you want to delete the bookmark?"
+msgstr "Vuoi davvero cancellare il Bookmark ?"
+
+#: plugin.py:1584
+msgid ""
+"Can't open selected bookmark.\n"
+"   - URL data is empty!!"
+msgstr ""
+"Impossibile apreire il Bookmark selezionato.\n"
+"   - l'indirizzo URL è mancante!!"
+
+#: plugin.py:1619
+msgid "Global"
+msgstr "Globale"
+
+#: plugin.py:1620
+msgid "Mouse"
+msgstr "Mouse"
+
+#: plugin.py:1621
+msgid "Keyboard"
+msgstr "Tastiera"
+
+#: plugin.py:1639
+msgid "Browser Help"
+msgstr "Aiuto Browser"
+
+#: plugin.py:1649
+msgid "Exit the Opera browser."
+msgstr "Esci da Opera."
+
+#: plugin.py:1652
+msgid "Show the Menu window."
+msgstr "Mostra i Menu."
+
+#: plugin.py:1655
+#: plugin.py:1686
+msgid "Enter Key"
+msgstr "Tasto Invio"
+
+#: plugin.py:1656
+msgid "Show the Virtual keyboard window."
+msgstr "Mostra la tastiera virtuale."
+
+#: plugin.py:1657
+msgid "Backspace Key"
+msgstr "Tasto Backsapce"
+
+#: plugin.py:1660
+msgid "Switch to keyboard/mouse mode."
+msgstr "Usa modalità tastiera/mouse."
+
+#: plugin.py:1665
+msgid "It will move the mouse pointer up."
+msgstr "Muove il puntatore del mouse verso l'alto."
+
+#: plugin.py:1666
+msgid "It will move the mouse pointer down."
+msgstr "Muove il puntatore del mouse verso il basso."
+
+#: plugin.py:1667
+msgid "It will move the mouse pointer left."
+msgstr "Muove il puntatore del mouse a sinistra."
+
+#: plugin.py:1668
+msgid "It will move the mouse pointer right."
+msgstr "Muove il puntatore del mouse a destra."
+
+#: plugin.py:1671
+msgid "Left Mouse Button"
+msgstr "Bottone sinistro mouse"
+
+#: plugin.py:1674
+msgid "Right Mouse Button"
+msgstr "Bottone destro mouse"
+
+#: plugin.py:1675
+#: plugin.py:1682
+msgid "Left Key"
+msgstr "Tasto freccia sinistra"
+
+#: plugin.py:1676
+#: plugin.py:1683
+msgid "Right Key"
+msgstr "Tasto freccia destra"
+
+#: plugin.py:1680
+msgid "Up Key"
+msgstr "Tasto freccia alto"
+
+#: plugin.py:1681
+msgid "Down Key"
+msgstr "Tasto freccia basso"
+
+#: plugin.py:1689
+msgid "PageUp Key"
+msgstr "Tasto pagina precedente"
+
+#: plugin.py:1690
+msgid "PageDown Key"
+msgstr "Tasto pagina successiva"
+
+#: plugin.py:1691
+msgid "Go to previous page."
+msgstr "Vai alla pagina precedente."
+
+#: plugin.py:1692
+msgid "Go to next page."
+msgstr "Vai alla pagina successiva."
+
+#: plugin.py:1729
+#: plugin.py:1970
+msgid "Open Startpage"
+msgstr "Apri pagina iniziale"
+
+#: plugin.py:1729
+#: plugin.py:1965
+msgid "Open URL"
+msgstr "Apri Url"
+
+#: plugin.py:1729
+#: plugin.py:1966
+msgid "Start/Stop"
+msgstr "Avvia/Chiudi"
+
+#: plugin.py:1731
+#: plugin.py:1964
+msgid "About"
+msgstr "Informazioni"
+
+#: plugin.py:1731
+#: plugin.py:1782
+#: plugin.py:1963
+msgid "Help"
+msgstr "Aiuto"
+
+#: plugin.py:1780
+msgid "File"
+msgstr "File"
+
+#: plugin.py:1781
+msgid "Tools"
+msgstr "Strumenti"
+
+#: plugin.py:1787
+#: plugin.py:1918
+msgid "Opera Web Browser Plugin v1.0"
+msgstr "Plugin Opera Web Browser v1.0"
+
+#: plugin.py:1788
+msgid "BrowserMain"
+msgstr "Browser"
+
+#: plugin.py:1811
+#: plugin.py:1969
+msgid "Return"
+msgstr "Indietro"
+
+#: plugin.py:1860
+msgid "Opera Browser"
+msgstr "Browser Opera"
+
+#: plugin.py:1913
+#: plugin.py:1942
+msgid ""
+"Opera Browser was not running.\n"
+"Please running browser using [File]>[Start/Stop] menu."
+msgstr ""
+"Il Browser non è attivo.\n"
+"Lancia il browser dal menu  [File]>[Avvia/Chiudi]."
+
+#: plugin.py:2161
+msgid "HbbTV Applications"
+msgstr "Applicazioni HbbTV"
+
+#: plugin.py:2162
+msgid "Browser Start/Stop"
+msgstr "Avvia/Chiudi browser"
+
+#: plugin.py:2163
+msgid "Opera Web Browser"
+msgstr "Web Browser Opera"
+
+#: plugin.py:2163
+msgid "start opera web browser"
+msgstr "avvia il browser Opera"
+
index 13d686b..868f86a 100644 (file)
@@ -57,8 +57,43 @@ class GlobalValues:
 
        need_restart = False
        plugin_browser = None
+
+       resX = 0
+       resY = 0
+       def UpdateInfoBar(self):
+               if self.resX == 1024 and self.resY == 720:
+                       return
+               try:
+                       infobar = InfoBar.instance
+                       if infobar._InfoBarShowHide__state != 3:
+                               return
+                       infobar.doTimerHide()
+                       infobar.serviceStarted()
+               except: pass
+       
 __gval__ = GlobalValues()
 
+def setDefaultResolution(x, y):
+       global __gval__
+       __gval__.resX = x
+       __gval__.resY = y
+
+def setResolution(xres, yres):
+       global __gval__
+       if __gval__.resX == 1280 and __gval__.resY == 720:
+               return
+       from enigma import gMainDC
+       gMainDC.getInstance().setResolution(xres, yres)
+
+def restoreResolution():
+       global __gval__
+       setResolution(1280, 720)
+       setResolution(__gval__.resX, __gval__.resY)
+
+       if __gval__.resX == 1280 and __gval__.resY == 720:
+               return
+       __gval__.UpdateInfoBar()
+
 def setPluginBrowser(browser=None):
        global __gval__
        __gval__.plugin_browser = browser
@@ -532,6 +567,7 @@ class HandlerHbbTV(Handler):
 
        def _cb_handleBrowserMenuReq(self, opcode, data):
                self._handle_dump(self._cb_handleBrowserMenuReq, opcode, data)
+               restoreResolution()
                fbClass.getInstance().unlock()
                eRCInput.getInstance().unlock()
                browser = getPluginBrowser()
@@ -575,10 +611,12 @@ class HandlerHbbTV(Handler):
        def _cb_virtualKeyboardClosed(self, data=None):
                fbClass.getInstance().lock()
                eRCInput.getInstance().lock()
+               setResolution(1280, 720)
                command_util = getCommandUtil()
                command_util.sendCommand('OP_BROWSER_VKBD_RES', data)
        def _cb_handleShowVirtualKeyboard(self, opcode, data):
                self._handle_dump(self._cb_handleShowVirtualKeyboard, opcode, data)
+               restoreResolution()
                fbClass.getInstance().unlock()
                eRCInput.getInstance().unlock()
                if data == 0 or strIsEmpty(data):
@@ -675,7 +713,7 @@ class HandlerHbbTV(Handler):
                return (channel_list_size, struct.pack('!IIII', sid, onid, tsid, namelen) + name)
 
        def _cb_handleSetPageTitle(self, opcode, data):
-               self._handle_dump(self._cb_handleCloseHbbTVBrowser, opcode, data)
+               self._handle_dump(self._cb_handleSetPageTitle, opcode, data)
                if data.startswith('file://') or data.startswith('http://'):
                        return "OK"
                if self._on_set_title_cb is not None:
@@ -710,6 +748,8 @@ class HandlerHbbTV(Handler):
                if before_service is not None:
                        self._session.nav.playService(before_service)
                        self._vod_uri = None
+
+               restoreResolution()
                return (0, "OK")
 
        def _cb_handleVODPlayerURI(self, opcode, data):
@@ -785,6 +825,7 @@ class HbbTVWindow(Screen, InfoBarNotifications):
                """
        def __init__(self, session, url=None, cbf=None, useAIT=False, profile=0):
                self._session = session
+               setResolution(1280, 720)
                fbClass.getInstance().lock()
                eRCInput.getInstance().lock()
 
@@ -893,6 +934,7 @@ class HbbTVWindow(Screen, InfoBarNotifications):
                        if self._cb_closed_func is not None:
                                self._cb_closed_func()
                except: pass
+               restoreResolution()
                fbClass.getInstance().unlock()
                eRCInput.getInstance().unlock()
                self.close()
@@ -919,12 +961,12 @@ class HbbTVHelper(Screen):
                __gval__.command_server = ServerFactory().doListenUnixTCP('/tmp/.sock.hbbtv.url', __gval__.hbbtv_handelr)
 
                self._urls = None
-               #self._stop_opera()
-               #self._start_opera()
-               self._restart_opera()
 
                Screen.__init__(self, session)
                self._session = session
+
+               self._restart_opera()
+
                self._timer_infobar = eTimer()
                self._timer_infobar.callback.append(self._cb_registrate_infobar)
                self._timer_infobar.start(1000)
@@ -939,6 +981,8 @@ class HbbTVHelper(Screen):
                        _g_ssm_ = SimpleSharedMemory()
                        _g_ssm_.doConnect()
 
+               self._callbackStartStop = None
+
        def _cb_registrate_infobar(self):
                if InfoBar.instance:
                        self._timer_infobar.stop()
@@ -975,7 +1019,7 @@ class HbbTVHelper(Screen):
        def _cb_hbbtv_activated(self, title=None, url=None):
                if not self._is_browser_running():
                        message = _("HbbTV Browser was not running.\nPlease running browser before start HbbTV Application.")
-                       self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+                       self._session.open(MessageBox, message, MessageBox.TYPE_INFO)
                        return
                service = self._session.nav.getCurrentlyPlayingServiceReference()
                setBeforeService(service)
@@ -1015,6 +1059,7 @@ class HbbTVHelper(Screen):
                        global HBBTVAPP_PATH
                        start_command = '%s/launcher start'%(HBBTVAPP_PATH)
                        os.system(start_command)
+               return True
 
        def _stop_opera(self):
                global HBBTVAPP_PATH
@@ -1025,6 +1070,7 @@ class HbbTVHelper(Screen):
                global HBBTVAPP_PATH
                try:    os.system('%s/launcher restart'%(HBBTVAPP_PATH))
                except: pass
+               return True
 
        def getStartHbbTVUrl(self):
                url, self._urls, self._profile = None, None, 0
@@ -1055,8 +1101,9 @@ class HbbTVHelper(Screen):
                        self._cb_hbbtv_activated(selected[1][1], selected[1][2])
                except Exception, ErrMsg: print ErrMsg
 
-       def showBrowserConfigBox(self):
+       def showBrowserConfigBox(self, callback=None):
                start_stop_mode = []
+               self._callbackStartStop = callback
                if self._is_browser_running():
                        start_stop_mode.append((_('Stop'),'Stop'))
                else:   start_stop_mode.append((_('Start'),'Start'))
@@ -1065,6 +1112,8 @@ class HbbTVHelper(Screen):
        def _browser_config_selected(self, selected):
                if selected is None:
                        return
+               if self._callbackStartStop is not None:
+                       self._callbackStartStop()
                try:
                        mode = selected[1]
                        if mode == 'Start':
@@ -1152,7 +1201,7 @@ class OperaBrowserSetting:
 
 class OperaBrowserPreferenceWindow(ConfigListScreen, Screen):
        skin=   """
-               <screen position="center,center" size="600,350" title="Preference">
+               <screen position="center,120" size="600,350" title="Preference">
                        <widget name="url" position="5,0" size="590,100" valign="center" font="Regular;20" />
                        <widget name="config" position="0,100" size="600,200" scrollbarMode="showOnDemand" />
 
@@ -1434,7 +1483,7 @@ class BookmarkEditWindow(ConfigListScreen, Screen):
 
 class OperaBrowserBookmarkWindow(Screen):
        skin =  """
-               <screen name="HbbTVBrowserBookmarkWindow" position="center,center" size="600,400" title="Bookmark" >
+               <screen name="HbbTVBrowserBookmarkWindow" position="center,120" size="600,400" title="Bookmark" >
                        <widget name="bookmarklist" position="0,0" size="600,200" zPosition="10" scrollbarMode="showOnDemand" />
 
                        <ePixmap pixmap="skin_default/buttons/key_0.png" position="556,330" size="35,30" alphatest="on" />
@@ -1714,21 +1763,25 @@ class OperaBrowser(Screen):
        SUBMENULIST_HEIGHT  = 25
        SUBMENULIST_NEXT    = 2
 
+       # menulist->position->y : MENUBAR_ITEM_HEIGHT+30
+       # menulist->size->x     : SUBMENULIST_WIDTH
+       # submenulist->position->x : SUBMENULIST_WIDTH+50+SUBMENULIST_NEXT
+       # submenulist->position->y : MENUBAR_ITEM_HEIGHT+30
+       # submenulist->size->x  : SUBMENULIST_WIDTH
        skin =  """
-               <screen name="Opera Browser" position="0,0" size="1280,720" backgroundColor="transparent" flags="wfNoBorder" title="Opera Browser">
+               <screen name="OperaBrowser" position="0,0" size="1280,720" backgroundColor="transparent" flags="wfNoBorder" title="Opera Browser">
                        <widget name="topArea" zPosition="-1" position="0,0" size="1280,60" font="Regular;20" valign="center" halign="center" backgroundColor="#000000" />
                        <widget name="menuitemFile" position="30,20" size="150,30" font="Regular;20" valign="center" halign="center" backgroundColor="#000000" foregroundColors="#9f1313,#a08500" />
                        <widget name="menuitemTool" position="180,20" size="150,30" font="Regular;20" valign="center" halign="center" backgroundColor="#000000" foregroundColors="#9f1313,#a08500" />
                        <widget name="menuitemHelp" position="330,20" size="150,30" font="Regular;20" valign="center" halign="center" backgroundColor="#000000" foregroundColors="#9f1313,#a08500" />
-                       <widget name="menulist" position="50,%d" size="%d,150" backgroundColor="#000000" zPosition="10" scrollbarMode="showOnDemand" />
-                       <widget name="submenulist" position="%d,%d" size="%d,150" backgroundColor="#000000" zPosition="10" scrollbarMode="showOnDemand" />
+                       <widget name="menulist" position="50,60" size="200,150" backgroundColor="#000000" zPosition="10" scrollbarMode="showOnDemand" />
+                       <widget name="submenulist" position="252,60" size="200,150" backgroundColor="#000000" zPosition="10" scrollbarMode="showOnDemand" />
                        <widget name="bottomArea" position="0,640" size="1280,80" font="Regular;20" valign="center" halign="center" backgroundColor="#000000" />
-               </screen>
-               """ % (MENUBAR_ITEM_HEIGHT+30, SUBMENULIST_WIDTH, SUBMENULIST_WIDTH+50+SUBMENULIST_NEXT, MENUBAR_ITEM_HEIGHT+30, SUBMENULIST_WIDTH)# modify menu
+               </screen>
+               """
 
-       MENUITEMS_LIST =[[(_('Open Startpage'), None), (_('Open URL'), None), (_('Start/Stop'),None), (_('Exit'), None)],
-                        [(_('Bookmark'), None), (_('Preference'), None)],
-                        [(_('About'), None), (_('Help'), None)]]
+       COMMAND_MAP = {}
+       MENUITEMS_LIST =[]
        def __init__(self, session, url=None):
                Screen.__init__(self, session)
                self["actions"] = ActionMap(["DirectionActions", "MenuActions", "OkCancelActions"], {
@@ -1741,6 +1794,8 @@ class OperaBrowser(Screen):
                        ,"menu"        : self.keyMenu
                }, -2)
 
+               self.UpdateLanguageCB()
+
                self._terminatedBrowser = True
                self._enableKeyEvent = True
                self._currentPageUrl = None
@@ -1770,6 +1825,24 @@ class OperaBrowser(Screen):
                self._onCloseTimer.callback.append(self._cb_onClose)
 
                self.paramUrl = url
+               language.addCallback(self.UpdateLanguageCB)
+
+       def UpdateLanguageCB(self):
+               # modify menu
+               self.MENUITEMS_LIST = [
+                       [(_('Open Startpage'), None), (_('Open URL'), None), (_('Start/Stop'),None), (_('Exit'), None)],
+                       [(_('Bookmark'), None), (_('Preference'), None)],
+                       [(_('About'), None), (_('Help'), None)]]
+               self.COMMAND_MAP = {}
+               self.COMMAND_MAP[_('Exit')] = self._cmd_on_Exit
+               self.COMMAND_MAP[_('Help')] = self._cmd_on_Help
+               self.COMMAND_MAP[_('About')] = self._cmd_on_About
+               self.COMMAND_MAP[_('Open URL')] = self._cmd_on_OpenUrl
+               self.COMMAND_MAP[_('Start/Stop')] = self._cmd_on_StartStop
+               self.COMMAND_MAP[_('Bookmark')] = self._cmd_on_Bookmark
+               self.COMMAND_MAP[_('Preference')] = self._cmd_on_Preference
+               self.COMMAND_MAP[_('Return')] = self._cmd_on_ReturnToBrowser
+               self.COMMAND_MAP[_('Open Startpage')] = self._cmd_on_OpenStartpage
 
        def enableRCMouse(self, mode): #mode=[0|1]|[False|True]
                rcmouse_path = "/proc/stb/fp/mouse"
@@ -1860,12 +1933,14 @@ class OperaBrowser(Screen):
                self._on_setPageTitle(_('Opera Browser'))
                self.enableRCMouse(False)
                self.toggleMainScreen()
+               restoreResolution()
                fbClass.getInstance().unlock()
                eRCInput.getInstance().unlock()
                self._terminatedBrowser = True
                self._enableKeyEvent = True
                #if not self.toggleListViewFlag:
                #       self.keyDown()
+
                self._currentPageUrl = ''
                if self.paramUrl is not None:
                        self.keyCancel()
@@ -1880,6 +1955,9 @@ class OperaBrowser(Screen):
                self.setTitle(title)
 
        def cbUrlText(self, data=None, mode=0):
+               global _g_helper
+               if not _g_helper._is_browser_running():
+                       return
                print "Inputed Url :", data, mode
                if strIsEmpty(data):
                        return
@@ -1891,8 +1969,12 @@ class OperaBrowser(Screen):
                        command_server.onHbbTVCloseCB.append(self._on_close_window)
                self.toggleMainScreen()
                self.enableRCMouse(True)
+
                fbClass.getInstance().lock()
                eRCInput.getInstance().lock()
+
+               setResolution(1280, 720)
+
                command_util = getCommandUtil()
                command_util.sendCommand('OP_BROWSER_OPEN_URL', data, mode)
                self._terminatedBrowser = False
@@ -1905,6 +1987,11 @@ class OperaBrowser(Screen):
                if data is None:
                        return
                (url, mode) = data
+               global _g_helper
+               if not _g_helper._is_browser_running():
+                       message = _("Opera Browser was not running.\nPlease running browser using [File]>[Start/Stop] menu.")
+                       self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+                       return
                self.cbUrlText(url, mode)
 
        def _cmd_on_OpenUrl(self):
@@ -1918,11 +2005,14 @@ class OperaBrowser(Screen):
                self.session.open(MessageBox, _('Opera Web Browser Plugin v1.0'), type = MessageBox.TYPE_INFO)
        def _cmd_on_Exit(self):
                self.close()
+       def _cb_cmdOnStartSTop(self):
+               self.keyMenu()
        def _cmd_on_StartStop(self):
                global _g_helper
                if _g_helper is None: 
                        return
-               _g_helper.showBrowserConfigBox()
+               _g_helper.showBrowserConfigBox(self._cb_cmdOnStartSTop)
+
        def _cmd_on_Bookmark(self):
                url = self._currentPageUrl
                if url is None:
@@ -1957,22 +2047,14 @@ class OperaBrowser(Screen):
                self.session.open(BrowserHelpWindow)
 
        def doCommand(self, command):
-               # modify menu
-               cmd_map = {}
-               cmd_map[_('Exit')] = self._cmd_on_Exit
-               cmd_map[_('Help')] = self._cmd_on_Help
-               cmd_map[_('About')] = self._cmd_on_About
-               cmd_map[_('Open URL')] = self._cmd_on_OpenUrl
-               cmd_map[_('Start/Stop')] = self._cmd_on_StartStop
-               cmd_map[_('Bookmark')] = self._cmd_on_Bookmark
-               cmd_map[_('Preference')] = self._cmd_on_Preference
-               cmd_map[_('Return')] = self._cmd_on_ReturnToBrowser
-               cmd_map[_('Open Startpage')] = self._cmd_on_OpenStartpage
                try:
-                       cmd_map[command]()
+                       self.COMMAND_MAP[command]()
                except Exception, ErrMsg: print ErrMsg
 
        def keyOK(self):
+               if not self.toggleMainScreenFlag:
+                       self.keyMenu()
+                       return
                if not self.toggleListViewFlag:
                        self.keyDown()
                        return
@@ -2056,6 +2138,7 @@ class OperaBrowser(Screen):
                        #self._session.openWithCallback(self._cb_virtualKeyboardClosed, VirtualKeyBoard, title=("Please enter URL here"), text="")
                        fbClass.getInstance().lock()
                        eRCInput.getInstance().lock()
+                       setResolution(1280, 720)
                        if self.toggleListViewFlag:
                                self.toggleMainScreen()
                        self._currentPageUrl   = None
@@ -2093,6 +2176,11 @@ from  Screens.HelpMenu import HelpableScreen
 def session_start_main(session, reason, **kwargs):
        fbClass.getInstance().unlock()
        eRCInput.getInstance().unlock()
+
+       from enigma import getDesktop
+       desktopSize = getDesktop(0).size()
+       setDefaultResolution(desktopSize.width(), desktopSize.height())
+
        global _g_helper
        _g_helper = session.open(HbbTVHelper)
 
index c192395..7ae6216 100644 (file)
@@ -131,7 +131,7 @@ class VideoHardware:
                for port in self.getPortList():
                        config.av.videomode[port].addNotifier(self.changedVideomode)
                        for mode in self.getModeList(port):
-                               config.av.videorate[mode].addNotifier(self.changedVideomode)
+                               config.av.videorate[mode[0]].addNotifier(self.changedVideomode)
 
                self.is_init = False
        
@@ -180,7 +180,7 @@ class VideoHardware:
        # check isModeAvailable in this port
        def isPortAvailable(self, port):
                for mode in self.getModeList(port):
-                       if len(self.getRateList(port, mode)):
+                       if len(self.getRateList(port, mode[0])):
                                return True
 
                return False
@@ -196,7 +196,7 @@ class VideoHardware:
                        rates = self.getRateList(port, mode)
 
                        if len(rates):
-                               modelist.append(mode)
+                               modelist.append( (mode, rates))
 
                return modelist
 
@@ -229,16 +229,16 @@ class VideoHardware:
                        mode_choices = self.getModeList(port)
 
                        for mode in mode_choices:
-                               modelist.append( (mode, mode))
+                               modelist.append( (mode[0], mode[0]))
 
                                # create list of available rates
                                ratelist = [ ]
-                               rate_choices = self.getRateList(port, mode)
+                               rate_choices = self.getRateList(port, mode[0])
 
                                for rate in rate_choices:
                                        ratelist.append( (rate, rate))
 
-                               config.av.videorate[mode] = ConfigSelection(choices = ratelist)
+                               config.av.videorate[mode[0]] = ConfigSelection(choices = ratelist)
                        config.av.videomode[port] = ConfigSelection(choices = modelist)
                config.av.videoport = ConfigSelection(choices = portlist)
        
@@ -266,7 +266,7 @@ class VideoHardware:
 
                if mode is None:
                        modelist = self.getModeList(port)
-                       mode = modelist[0]
+                       mode = modelist[0][0]
 
                        ratelist = self.getRateList(port, mode)
                        rate = ratelist[0]
@@ -306,10 +306,6 @@ class VideoHardware:
                
                self.changedAspect(None)
        
-       # autoresolution depend on this.
-       def setMode(self, port, mode, rate):
-               self.setVideomode(port, mode, rate)
-       
        def changedAspect(self, configElement):
                if self.is_init:
                        return
@@ -389,6 +385,16 @@ class VideoHardware:
                        config.av.videorate[mode].value = rate
                        config.av.videorate[mode].save()
 
+       # for dependency
+       def setMode(self, port, mode, rate):
+               self.setVideomode(port, mode, rate)
+
+       def saveMode(self, port, mode, rate):
+               self.saveVideomode(port, mode, rate)
+       
+       def updateAspect(self, configElement):
+               self.changedAspect(configElement)
+       
 video_hw = VideoHardware()
 video_hw.setConfiguredMode()
 
index 97038e9..d8334dc 100644 (file)
@@ -77,7 +77,7 @@ class VideoWizard(WizardLanguage, Rc):
        def modeList(self):
                list = [ ]
                for mode in self.video_cfg.getModeList(self.port):
-                       list.append( (mode, mode))
+                       list.append( (mode[0], mode[0]))
                
                return list