[Vbrowser] imported.
authorsmlee <smlee@dev3>
Thu, 26 Jun 2014 04:45:33 +0000 (13:45 +0900)
committersmlee <smlee@dev3>
Wed, 9 Jul 2014 10:09:15 +0000 (19:09 +0900)
20 files changed:
configure.ac
lib/python/Plugins/Extensions/Makefile.am
lib/python/Plugins/Extensions/Vbrowser/Makefile.am [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/__init__.py [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/aitreader.py [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/bookmark.py [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/browser.py [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/hbbtv.py [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/keymap.xml [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/locale/Makefile.am [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/locale/Vbrowser.pot [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/locale/de.po [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/locale/en.po [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/locale/it.po [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/meta/Makefile.am [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/meta/plugin_vbrowser.xml [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/plugin.py [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/vbcfg.py [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/vbipc.py [new file with mode: 0644]
lib/python/Plugins/Extensions/Vbrowser/youtube.py [new file with mode: 0644]

index 332fc7a..dbee484 100644 (file)
@@ -201,6 +201,9 @@ lib/python/Plugins/Extensions/BackupSuiteHDD/meta/Makefile
 lib/python/Plugins/Extensions/BackupSuiteHDD/locale/Makefile
 lib/python/Plugins/Extensions/BackupSuiteUSB/Makefile
 lib/python/Plugins/Extensions/BackupSuiteUSB/meta/Makefile
+lib/python/Plugins/Extensions/Vbrowser/Makefile
+lib/python/Plugins/Extensions/Vbrowser/meta/Makefile
+lib/python/Plugins/Extensions/Vbrowser/locale/Makefile
 lib/python/Plugins/SystemPlugins/CleanupWizard/Makefile
 lib/python/Plugins/SystemPlugins/CleanupWizard/meta/Makefile
 lib/python/Plugins/SystemPlugins/CommonInterfaceAssignment/Makefile
index bb13519..f84f32e 100755 (executable)
@@ -1,7 +1,7 @@
 installdir = $(pkglibdir)/python/Plugins/Extensions
 
 SUBDIRS = TuxboxPlugins CutListEditor PicturePlayer MediaScanner MediaPlayer GraphMultiEPG SocketMMI DVDBurn Modem WebBrowser \
-       VuplusEvent StreamTV DLNABrowser DLNAServer HbbTV BackupSuiteUSB BackupSuiteHDD
+       VuplusEvent StreamTV DLNABrowser DLNAServer HbbTV BackupSuiteUSB BackupSuiteHDD Vbrowser
 
 if HAVE_LIBDDVD
 SUBDIRS += DVDPlayer
diff --git a/lib/python/Plugins/Extensions/Vbrowser/Makefile.am b/lib/python/Plugins/Extensions/Vbrowser/Makefile.am
new file mode 100644 (file)
index 0000000..7bd2146
--- /dev/null
@@ -0,0 +1,15 @@
+installdir = $(pkglibdir)/python/Plugins/Extensions/Vbrowser
+
+SUBDIRS = meta locale
+
+install_PYTHON = \
+       keymap.xml \
+       __init__.py \
+       aitreader.py \
+       bookmark.py \
+       browser.py \
+       hbbtv.py \
+       plugin.py \
+       vbcfg.py \
+       vbipc.py \
+       youtube.py
diff --git a/lib/python/Plugins/Extensions/Vbrowser/__init__.py b/lib/python/Plugins/Extensions/Vbrowser/__init__.py
new file mode 100644 (file)
index 0000000..93e8f7f
--- /dev/null
@@ -0,0 +1,22 @@
+from Components.Language import language
+from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE
+import os,gettext
+
+PluginLanguageDomain = "Vbrowser"
+PluginLanguagePath = "Extensions/Vbrowser/locale"
+
+def localeInit():
+       lang = language.getLanguage()[:2]
+       os.environ["LANGUAGE"] = lang
+       gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE))
+       gettext.textdomain("enigma2")
+       gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))
+
+def _(txt):
+       t = gettext.dgettext(PluginLanguageDomain, txt)
+       if t == txt:
+               t = gettext.gettext(txt)
+       return t
+
+localeInit()
+language.addCallback(localeInit)
diff --git a/lib/python/Plugins/Extensions/Vbrowser/aitreader.py b/lib/python/Plugins/Extensions/Vbrowser/aitreader.py
new file mode 100644 (file)
index 0000000..757b0f3
--- /dev/null
@@ -0,0 +1,102 @@
+import os, xml.dom.minidom
+from enigma import iServiceInformation
+
+import vbcfg
+
+DUMPBIN = vbcfg.PLUGINROOT + "/dumpait"
+class eAITSectionReader:
+       def __init__(self, demux, pmtid, sid):
+               self.mVuplusBox = False
+               self.mInfo = None
+               self.mAppList  = []
+               self.mDocument = None
+               self.mCommand  = "%s --demux=%s --pmtid=%x --serviceid=%x"%(DUMPBIN, demux, pmtid, sid)
+
+       def __text(self, nodelist):
+               rc = []
+               for node in nodelist:
+                       if node.nodeType == node.TEXT_NODE:
+                               rc.append(node.data)
+               return ''.join(rc)
+
+       def __item(self, application, name):
+               for item in application.getElementsByTagName(name):
+                       return self.__text(item.childNodes)
+               return None
+
+       def __application(self, application):
+               item = {}
+
+               if self.mVuplusBox:
+                       item["name"]    = str(application[1])
+                       item["url"]     = str(application[2])
+                       item["control"] = int(application[0])
+                       item["orgid"]   = int(application[3])
+                       item["appid"]   = int(application[4])
+                       item["profile"] = int(application[5])
+               else:
+                       item["name"]    = str(self.__item(application, "name"))
+                       item["url"]     = str(self.__item(application, "url"))
+                       item["control"] = int(self.__item(application, "control"))
+                       item["orgid"]   = int(self.__item(application, "orgid"))
+                       item["appid"]   = int(self.__item(application, "appid"))
+                       item["profile"] = int(self.__item(application, "profile"))
+               return item
+
+       def doParseApplications(self):
+               l = []
+
+               if self.mVuplusBox:
+                       for application in self.mInfo.getInfoObject(iServiceInformation.sHBBTVUrl):
+                               item = self.__application(application)
+                               l.append(item)
+               else:
+                       for application in self.mDocument.getElementsByTagName("application"):
+                               item = self.__application(application)
+                               l.append(item)
+               self.mAppList = l
+
+       def getApplicationList(self):
+               return self.mAppList
+
+       def doOpen(self, info, is_vuplusbox):
+               if is_vuplusbox:
+                       self.mVuplusBox = is_vuplusbox
+                       self.mInfo = info
+                       return True
+
+               document = ""
+               try:    document = os.popen(self.mCommand).read()
+               except Exception, ErrMsg:
+                       vbcfg.ERR(ErrMsg)
+                       return False
+               if len(document) == 0:
+                       return False
+               document = document.decode("cp1252").encode("utf-8")
+               try:
+                       self.mDocument = xml.dom.minidom.parseString(document)
+               except Exception, ErrMsg:
+                       vbcfg.ERR("XML parse: %s" % ErrMsg)
+                       return False
+               return True
+
+       def doDump(self):
+               for x in self.getApplicationList():
+                       print "Name  :", x["name"]
+                       print "URL   :", x["url"]
+                       print "OrgID :", x["orgid"]
+                       print "AppID :", x["appid"]
+                       print "Control Code :", x["control"]
+                       print "Profile Code :", x["profile"]
+                       print ""
+
+def unit_test(demux, pmtid, sid):
+       reader = eAITSectionReader(demux, pmtid, sid)
+       if reader.doOpen():
+               reader.doParseApplications()
+               reader.doDump()
+       else:
+               vbcfg.ERR("no data!!")
+
+#unit_test('0', 0x17d4, 0x2b66)
+
diff --git a/lib/python/Plugins/Extensions/Vbrowser/bookmark.py b/lib/python/Plugins/Extensions/Vbrowser/bookmark.py
new file mode 100644 (file)
index 0000000..5048564
--- /dev/null
@@ -0,0 +1,293 @@
+import vbcfg
+
+class BookmarkData:
+       def __init__(self, _id, _title, _url, _parent, _type):
+               self.mId        = _id
+               self.mTitle     = _title
+               self.mUrl       = _url
+               self.mParent    = _parent
+               self.mType      = _type
+       def dump(self, _intent='  '):
+               print "%s-> %d, %s, %s, %d, %d" % (_intent, self.mId, self.mTitle, self.mUrl, self.mParent, self.mType)
+
+class CategoryData:
+       def __init__(self, _id, _name):
+               self.mId        = _id
+               self.mName      = _name
+               self.mBookmarks = {}
+
+       def setBookmarks(self, _bookmarks):
+               self.mBookmarks = _bookmarks
+
+       def appendBookmark(self, _bookmark):
+               self.mBookmarks[_bookmark.mId] = _bookmark
+
+       def dump(self):
+               print "  -> %d, %s" % (self.mId, self.mName)
+               for key in self.mBookmarks.iterkeys():
+                       self.mBookmarks[key].dump('      ')
+
+import ConfigParser
+class SimpleConfigParser:
+       def __init__(self):
+               self.mFileName = None
+               self.mConfig = None
+               self.mCategoryCurrentIdx = 0
+               self.mBookmarkCurrentIdx = 0
+               self.mDataValid = False
+               self.mPopulateValid = False
+
+       def _read(self):
+               if self.mDataValid:
+                       return
+               self.mConfig.read(self.mFileName)
+
+               self.mCategoryCurrentIdx = self.getNumber('__SYS__', 'category_current_idx')
+               self.mBookmarkCurrentIdx = self.getNumber('__SYS__', 'bookmark_current_idx')
+               self.mDataValid = True
+
+       def _save(self):
+               with open(self.mFileName, 'wb') as bookmarkFile:
+                       self.mConfig.write(bookmarkFile)
+               self.mDataValid = False
+               self.mPopulateValid = False
+
+       def _del(self, _section, _option=None):
+               if _option is None:
+                       if not self.exist(_section):
+                               return
+                       self.mConfig.remove_section(_section)
+                       return
+               if not self.exist(_section, _option):
+                       return
+               self.mConfig.remove_option(_section, _option)
+
+       def _get(self, _section, _option, _default):
+               try:
+                       data = self.mConfig.get(_section, _option)
+               except Exception, e:
+                       vbcfg.ERR(e)
+                       return _default
+               else :  return data
+
+       def _set(self, _section, _option, _value):
+               self.mConfig.set(_section, _option, _value)
+
+       def exist(self, _section, _option=None):
+               if _option is None:
+                       return self.mConfig.has_section(_section)
+               return self.mConfig.has_option(_section, _option)
+
+       def setNumber(self, _section, _option, _value):
+               self._set(_section, _option, str(_value))
+
+       def setString(self, _section, _option, _value):
+               self._set(_section, _option, _value)
+
+       def getNumber(self, _section, _option, _default=0):
+               return int(self._get(_section, _option, _default))
+
+       def getString(self, _section, _option, _default=''):
+               return self._get(_section, _option, _default)
+
+       def delOption(self, _section, _option):
+               self._del(_section, _option)
+
+       def addSection(self, _section):
+               self.mConfig.add_section(_section)
+
+       def delSection(self, _section):
+               self._del(_section)
+
+       def init(self, _fileName):
+               self.mFileName = _fileName
+               self.mConfig = ConfigParser.RawConfigParser()
+               if self.mConfig is None:
+                       return False
+               self._read()
+               return True
+
+class BookmarkManager(SimpleConfigParser):
+       _instance = None
+       def __new__(cls, *args, **kwargs):
+               if not cls._instance:
+                       cls._instance = super(Singleton, cls).__new__(cls, *args, **kwargs)
+               return cls._instance
+
+       def __init__(self, _dbFileName):
+               SimpleConfigParser.__init__(self)
+               self.mBookmarkRoot = None
+               self.mDebugEnable = True
+
+               import os
+               if not os.path.exists(_dbFileName):
+                       f = file('/proc/stb/info/vumodel')
+                       model = f.read().strip()
+                       f.close()
+                       manualmode = (model == "solo2" or model == "duo2" or model == "solose")
+
+                       os.system('echo "[__SYS__]" > %s'%(_dbFileName))
+                       os.system('echo "category_current_idx = 1" >> %s'%(_dbFileName))
+                       if manualmode :
+                               os.system('echo "bookmark_current_idx = 2" >> %s'%(_dbFileName))
+                       else:   os.system('echo "bookmark_current_idx = 1" >> %s'%(_dbFileName))
+                       os.system('echo "[c-1]" >> %s'%(_dbFileName))
+                       os.system('echo "id = 1" >> %s'%(_dbFileName))
+                       os.system('echo "name = My favorite" >> %s'%(_dbFileName))
+                       os.system('echo "[b-1]" >> %s'%(_dbFileName))
+                       os.system('echo "url = http://www.vuplus.com/" >> %s'%(_dbFileName))
+                       os.system('echo "id = 1" >> %s'%(_dbFileName))
+                       os.system('echo "parent = 1" >> %s'%(_dbFileName))
+                       os.system('echo "title = Vuplus Home" >> %s'%(_dbFileName))
+                       os.system('echo "type = 0" >> %s'%(_dbFileName))
+                       if manualmode :
+                               os.system('echo "[b-2]" >> %s'%(_dbFileName))
+                               os.system('echo "url = file:///usr/local/manual/main.html" >> %s'%(_dbFileName))
+                               os.system('echo "id = 2" >> %s'%(_dbFileName))
+                               os.system('echo "parent = 1" >> %s'%(_dbFileName))
+                               os.system('echo "title = User Manual" >> %s'%(_dbFileName))
+                               os.system('echo "type = 1" >> %s'%(_dbFileName))
+               self.init(_dbFileName)
+
+       def message(self, format, params=None):
+               if not self.mDebugEnable:
+                       return
+               if params is None:
+                       vbcfg.DEBUG(format)
+               else:
+                       vbcfg.DEBUG(format % (params))
+
+       def getBookmark(self, _title):
+               self.populate()
+               for key in self.mBookmarkRoot.iterkeys():
+                       for key2 in self.mBookmarkRoot[key].mBookmarks.iterkeys():
+                               if self.mBookmarkRoot[key].mBookmarks[key2].mTitle == _title:
+                                       return 'b-%d' % (self.mBookmarkRoot[key].mBookmarks[key2].mId)
+               return None
+
+       def addBookmark(self, _title, _url, _parent, _type):
+               if self.getBookmark(_title) is not None:
+                       return False
+               i = self.mBookmarkCurrentIdx + 1
+               s = "b-%d" % (i,)
+               self.message("add bookmark : %s, %s, %d, %d", (_title, _url, _parent, _type,))
+
+               self.mConfig.add_section(s)
+               self.setNumber(s, 'id', i)
+               self.setString(s, 'title', _title)
+               self.setString(s, 'url', _url)
+               self.setNumber(s, 'parent', _parent)
+               self.setNumber(s, 'type', _type)
+               self.setNumber('__SYS__', 'bookmark_current_idx', i)
+               self._save()
+
+               return True
+
+       def deleteBookmark(self, _id):
+               self.populate()
+               self.message("delete bookmark : %d", (_id,))
+               self.delSection('b-%d' % (_id,))
+               self._save()
+
+       def updateBookmark(self, _bookmark):
+               self.populate()
+               s = "b-%d" % (_bookmark.mId)
+               self.message("update bookmark : %s, %s, %d, %d", (_bookmark.mTitle, _bookmark.mUrl, _bookmark.mParent, _bookmark.mType,))
+               self.setString(s, 'title', _bookmark.mTitle)
+               self.setString(s, 'url', _bookmark.mUrl)
+               self.setNumber(s, 'parent', _bookmark.mParent)
+               self.setNumber(s, 'type', _bookmark.mType)
+               self._save()
+
+       def getCategory(self, _name):
+               self.populate()
+               for key in self.mBookmarkRoot.iterkeys():
+                       if self.mBookmarkRoot[key].mName == _name:
+                               return 'c-%d' % (self.mBookmarkRoot[key].mId)
+               return None
+
+       def addCategory(self, _name):
+               if self.getCategory(_name) is not None:
+                       return False
+               self.message("add category : %s", (_name,))
+               i = self.mCategoryCurrentIdx + 1
+               s = "c-%d" % (i)
+
+               self.mConfig.add_section(s)
+               self.setNumber(s, 'id', i)
+               self.setNumber(s, 'name', _name)
+               self.setNumber('__SYS__', 'category_current_idx', i)
+               self._save()
+
+               return True
+
+       def deleteCategory(self, _id):
+               self.populate()
+               self.message("delete category : %d", (_id,))
+               try:
+                       for key in self.mBookmarkRoot[_id].mBookmarks.iterkeys():
+                               self.delSection('b-%d' % (key,))
+               except: pass
+               self.delSection('c-%d' % (_id,))
+               self._save()
+
+       def updateCategory(self, _category):
+               self.populate()
+               self.message("update category : %s", (_category.mName,))
+               s = "c-%d" % (_category.mId)
+               self.setNumber(s, 'name', _category.mName)
+               self._save()
+
+       def populate(self):
+               cx, bx = 0, 0
+               categoryList = {}
+               self.message("populate : %d, %d", (self.mPopulateValid, self.mDataValid))
+
+               self._read()
+               if self.mPopulateValid:
+                       return
+
+               while cx <= self.mCategoryCurrentIdx:
+                       s = 'c-%d' % (cx,)
+                       i = self.getNumber(s, 'id', -1)
+                       if i != -1:
+                               n = self.getString(s, 'name')
+                               categoryList[i] = CategoryData(i, n)
+                       cx += 1
+               sorted(categoryList)
+               while bx <= self.mBookmarkCurrentIdx:
+                       s = 'b-%d' % (bx,)
+                       i = self.getNumber(s, 'id', -1)
+                       if i != -1:
+                               t = self.getString(s, 'title')
+                               u = self.getString(s, 'url')
+                               p = self.getNumber(s, 'parent')
+                               e = self.getNumber(s, 'type')
+                               try:
+                                       categoryList[p].appendBookmark(BookmarkData(i, t, u, p, e))
+                               except Exception, e: self._del(s)
+                       bx += 1
+               for key in categoryList.iterkeys():
+                       sorted(categoryList[key].mBookmarks)
+               self.mBookmarkRoot = categoryList
+               self.mPopulateValid = True
+               self.dump()
+
+       def getBookmarkRoot(self):
+               self.populate()
+               return self.mBookmarkRoot
+
+       def dump(self):
+               if not self.mDebugEnable:
+                       return
+               self.populate()
+               print "-- snapshot --"
+               for key in self.mBookmarkRoot.iterkeys():
+                       self.mBookmarkRoot[key].dump()
+               print "--------------"
+
+       @staticmethod
+       def getInstance():
+               return BookmarkManager(vbcfg.PLUGINROOT + "/bookmark.ini")
+
+
diff --git a/lib/python/Plugins/Extensions/Vbrowser/browser.py b/lib/python/Plugins/Extensions/Vbrowser/browser.py
new file mode 100644 (file)
index 0000000..405692f
--- /dev/null
@@ -0,0 +1,1183 @@
+from Screens.Screen import Screen
+from Screens.HelpMenu import HelpableScreen
+from Screens.ChoiceBox import ChoiceBox
+from Screens.MessageBox import MessageBox
+from Screens.VirtualKeyBoard import VirtualKeyBoard
+from Components.ActionMap import ActionMap, HelpableActionMap
+from Components.ConfigList import ConfigListScreen
+from Components.Label import Label, MultiColorLabel
+from Components.Language import language
+from Components.MenuList import MenuList
+from Components.Pixmap import Pixmap
+from Components.Sources.StaticText import StaticText
+from Components.config import ConfigText, ConfigSelection, ConfigSlider, getConfigListEntry
+
+import os, vbcfg
+
+from enigma import fbClass, eRCInput, eTimer, getDesktop
+
+from __init__ import _
+from bookmark import BookmarkManager, BookmarkData, CategoryData
+from vbipc import VBController
+
+strIsEmpty = lambda x: x is None or len(x) == 0
+
+class BrowserSetting:
+       def __init__(self):
+               self._settingFileName = '%s/home/setting.ini' % vbcfg.APPROOT
+               self._start = None
+               self._type = None
+               self._keymap = None
+               self._read()
+
+       def _read(self):
+               if not os.path.exists(self._settingFileName):
+                       self.getDefault()
+                       return
+
+               f = open(self._settingFileName)
+               for line in f.readlines():
+                       if line.startswith('start='):
+                               tmp = line[6:len(line)-1].split()
+                               self._start = tmp[0]
+                               if len(tmp) > 1:
+                                       self._type = int(tmp[1])
+                               else:   self._type = 0
+                       elif line.startswith('keymap='):
+                               self._keymap = line[7:len(line)-1]
+               f.close()
+
+       def _write(self):
+               tmpstr = []
+               tmpstr.append('start=%s %d\n' % (self._start, self._type))
+               tmpstr.append('keymap=%s\n' % (self._keymap))
+               f = open(self._settingFileName, 'w')
+               f.writelines(tmpstr)
+               f.close()
+
+       def getDefault(self):
+               self._start = 'http://vuplus.com'
+               self._type = 0
+               self._keymap = 'us-rc'
+
+       def setData(self, start, types=0, keymap="us-rc"):
+               self._start = start
+               self._type = types
+               self._keymap = keymap
+               self._write()
+
+       def getData(self):
+               return {
+                       'start':self._start,
+                       'type':self._type,
+                       'keymap':self._keymap,
+               }
+
+class BrowserPositionSetting:
+       def __init__(self):
+               self._positionFileName = '%s/home/position.cfg' % vbcfg.APPROOT
+               self._left = 0
+               self._width = 0
+               self._top = 0
+               self._height = 0
+               self._read()
+
+       def _read(self):
+               if not os.path.exists(self._positionFileName):
+                       self.getDefault()
+                       return
+
+               f = open(self._positionFileName)
+               str = f.read()
+               f.close()
+
+               pos = str.split();
+               self._left = int(pos[0])
+               self._width = int(pos[1])
+               self._top = int(pos[2])
+               self._height = int(pos[3])
+
+       def _write(self):
+               tmpstr = "%d %d %d %d\n" % (self._left, self._width, self._top, self._height)
+               f = open(self._positionFileName, 'w')
+               f.write(tmpstr)
+               f.close()
+
+       def getDefault(self):
+               self._left = 0
+               self._top = 0
+               self._width = 720
+               self._height = 576
+
+       def setPosition(self, params):
+               self._left = params[0]
+               self._width = params[1]
+               self._top = params[2]
+               self._height = params[3]
+               self._write()
+
+       def getPosition(self):
+               return (self._left, self._width, self._top, self._height)
+
+class BrowserPositionWindow(Screen, ConfigListScreen):
+       skin =  """
+               <screen position="0,0" size="%d,%d" title="Browser Position Setup" backgroundColor="#27d8dee2" >
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="%d,%d" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/green.png" position="%d,%d" size="140,40" alphatest="on" />"
+
+                       <widget source="key_red" render="Label" position="%d,%d" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_green" render="Label" position="%d,%d" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" foregroundColor="#ffffff" transparent="1" />
+
+                       <widget name="config" zPosition="2" position="%d,%d" size="500,200" scrollbarMode="showOnDemand" foregroundColor="#1c1c1c" transparent="1" />
+               </screen>
+               """
+       def __init__(self, session):
+               w,h   = session.desktop.size().width(), session.desktop.size().height()
+               cw,ch = w/2, h/2
+               #                             btn_red        btn_green     lb_red         lb_green      config
+               self.skin = self.skin % (w,h, cw-190,ch-110, cw+50,ch-110, cw-190,ch-110, cw+50,ch-110, cw-250,ch-50)
+
+               Screen.__init__(self,session)
+               self.session = session
+               self["shortcuts"] = ActionMap(["ShortcutActions", "SetupActions" ],
+               {
+                       "ok": self.keyOk,
+                       "cancel": self.keyCancel,
+                       "red": self.keyCancel,
+                       "green": self.keyOk,
+               }, -2)
+               self.list = []
+               ConfigListScreen.__init__(self, self.list, session = self.session)
+
+               self["key_red"] = StaticText(_("Cancel"))
+               self["key_green"] = StaticText(_("Save"))
+               self["current"] = StaticText(_(" "))
+               vbcfg.g_position = vbcfg.getPosition()
+               self.createSetup()
+
+       def createSetup(self):
+               self.list = []
+
+               params = BrowserPositionSetting().getPosition()
+               vbcfg.setPosition(params)
+
+               left   = params[0]
+               width  = params[1]
+               top    = params[2]
+               height = params[3]
+
+               self.dst_left   = ConfigSlider(default = left, increment = 5, limits = (0, 720))
+               self.dst_width  = ConfigSlider(default = width, increment = 5, limits = (0, 720))
+               self.dst_top    = ConfigSlider(default = top, increment = 5, limits = (0, 576))
+               self.dst_height = ConfigSlider(default = height, increment = 5, limits = (0, 576))
+
+               self.dst_left_entry   = getConfigListEntry(_("left"), self.dst_left)
+               self.dst_width_entry  = getConfigListEntry(_("width"), self.dst_width)
+               self.dst_top_entry    = getConfigListEntry(_("top"), self.dst_top)
+               self.dst_height_entry = getConfigListEntry(_("height"), self.dst_height)
+
+               self.list.append(self.dst_left_entry)
+               self.list.append(self.dst_width_entry)
+               self.list.append(self.dst_top_entry)
+               self.list.append(self.dst_height_entry)
+
+               self["config"].list = self.list
+               self["config"].l.setList(self.list)
+
+       def resetDisplay(self):
+               for entry in self["config"].getList():
+                       self["config"].l.invalidateEntry(self["config"].getList().index(entry))
+
+       def adjustBorder(self):
+               if self["config"].getCurrent() == self.dst_left_entry:
+                       if self.dst_left.value + self.dst_width.value >720:
+                               self.dst_width.setValue(720-self.dst_left.value)
+                               self.resetDisplay()
+               elif self["config"].getCurrent() == self.dst_width_entry:
+                       if self.dst_left.value + self.dst_width.value >720:
+                               self.dst_left.setValue(720-self.dst_width.value)
+                               self.resetDisplay()
+               elif self["config"].getCurrent() == self.dst_top_entry:
+                       if self.dst_top.value + self.dst_height.value >576:
+                               self.dst_height.setValue(576-self.dst_top.value)
+                               self.resetDisplay()
+               elif self["config"].getCurrent() == self.dst_height_entry:
+                       if self.dst_top.value + self.dst_height.value >576:
+                               self.dst_top.setValue(576-self.dst_height.value)
+                               self.resetDisplay()
+
+       def keyLeft(self):
+               ConfigListScreen.keyLeft(self)
+               self.adjustBorder()
+               params = (int(self.dst_left.value), int(self.dst_width.value), int(self.dst_top.value), int(self.dst_height.value))
+               vbcfg.setPosition(params)
+
+       def keyRight(self):
+               ConfigListScreen.keyRight(self)
+               self.adjustBorder()
+               params = (int(self.dst_left.value), int(self.dst_width.value), int(self.dst_top.value), int(self.dst_height.value))
+               vbcfg.setPosition(params)
+
+       def keyOk(self):
+               params = (int(self.dst_left.value), int(self.dst_width.value), int(self.dst_top.value), int(self.dst_height.value))
+               BrowserPositionSetting().setPosition(params)
+               vbcfg.setPosition(vbcfg.g_position)
+               self.close()
+
+       def keyCancel(self):
+               if self["config"].isChanged():
+                       self.session.openWithCallback(self.cancelConfirm, MessageBox, _("Really close without saving settings?"))
+               else:
+                       vbcfg.setPosition(vbcfg.g_position)
+                       self.close()
+
+       def cancelConfirm(self,ret):
+               if ret:
+                       vbcfg.setPosition(vbcfg.g_position)
+                       self.close()
+
+
+class BrowserPreferenceWindow(ConfigListScreen, Screen):
+       skin = """
+               <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" />
+
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="310,310" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/green.png" position="150,310" size="140,40" alphatest="on" />
+
+                       <widget source="key_red" render="Label" position="310,310" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_green" render="Label" position="150,310" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" foregroundColor="#ffffff" transparent="1" />
+               </screen>
+               """
+       def __init__(self, session, currentUrl):
+               self.session = session
+               Screen.__init__(self, session)
+
+               self.menulist = []
+               ConfigListScreen.__init__(self, self.menulist)
+
+               self["actions"] = ActionMap(["OkCancelActions", "ShortcutActions", "WizardActions", "ColorActions", "SetupActions", ], {
+                       "red"    : self.keyRed,
+                       "green"  : self.keyGreen,
+                       "ok"     : self.keyOK,
+                       "cancel" : self.keyRed
+               }, -2)
+               self["key_red"] = StaticText(_("Cancel"))
+               self["key_green"] = StaticText(_("Save"))
+               self["url"] = Label()
+
+               self._currentPageUrl = currentUrl
+               if self._currentPageUrl is None:
+                       self._currentPageUrl = ''
+               self._startPageUrl = None
+               self._keymapType = None
+               self.makeMenuEntry()
+               self.onLayoutFinish.append(self.layoutFinished)
+
+       def layoutFinished(self):
+               self.setTitle(_('Preference'))
+
+       def updateStartPageUrl(self):
+               if self.menuItemStartpage.value == "startpage":
+                       self["url"].setText(self._startPageUrl)
+               elif self.menuItemStartpage.value == "current":
+                       self["url"].setText(self._currentPageUrl)
+               elif self.menuItemStartpage.value == "direct":
+                       self["url"].setText('')
+
+       def keyGreen(self):
+               url = self["url"].getText()
+               if strIsEmpty(url):
+                       self.session.open(MessageBox, _('Invalid URL!!(Empty)\nPlease, Input to the URL.'), type = MessageBox.TYPE_INFO)
+                       return
+               mode = 0
+               if url.find('/usr/local/manual') > 0:
+                       mode = 1
+               self._keymapType = self.menuItemKeyboardLayout.value
+               BrowserSetting().setData(url, mode, self._keymapType)
+               # send contorller
+               #command_util = getCommandUtil()
+               #command_util.sendCommand('OP_BROWSER_NEED_RELOAD_KEYMAP')
+               self.close()
+
+       def keyRed(self):
+               self.close()
+
+       def keyOK(self):
+               def _cb_directInputUrl(data):
+                       if strIsEmpty(data):
+                               return
+                       self["url"].setText(data)
+               if self["config"].l.getCurrentSelectionIndex() == 0 and self.menuItemStartpage.value == "direct":
+                       self.session.openWithCallback(_cb_directInputUrl, VirtualKeyBoard, title=(_("Please enter URL here")), text='http://')
+
+       def keyLeft(self):
+               ConfigListScreen.keyLeft(self)
+               self.updateStartPageUrl()
+
+       def keyRight(self):
+               ConfigListScreen.keyRight(self)
+               self.updateStartPageUrl()
+
+       def getKeymapTypeList(self):
+               types = []
+               for f in os.listdir("%s/keymap" % vbcfg.APPROOT):
+                       filesplit = f.split('.')
+                       if len(filesplit) < 2:
+                               continue
+                       types.append((filesplit[1], filesplit[1]))
+               types.sort()
+               return types
+
+       def makeMenuEntry(self):
+               l = []
+               l.append(("startpage", _("Start Page")))
+               if not strIsEmpty(self._currentPageUrl):
+                       l.append(("current", _("Current Page")))
+               l.append(("direct", _("Direct Input")))
+               self.menuItemStartpage = ConfigSelection(default="startpage", choices = l)
+               self.menuEntryStartpage = getConfigListEntry(_("Startpage"), self.menuItemStartpage)
+
+               kl = self.getKeymapTypeList()
+
+               try:
+                       d = BrowserSetting().getData()
+                       self._startPageUrl = d['start']
+                       self._keymapType = d['keymap']
+                       #d['type']
+               except: self._startPageUrl = 'http://vuplus.com'
+               self.updateStartPageUrl()
+
+               if self._keymapType is None or len(self._keymapType) == 0:
+                       self._keymapType = "us-rc"
+               self.menuItemKeyboardLayout = ConfigSelection(default=self._keymapType, choices = kl)
+               self.menuEntryKeyboardLayout = getConfigListEntry(_("Keyboard Layout"), self.menuItemKeyboardLayout)
+               self.resetMenuList()
+
+       def resetMenuList(self):
+               self.menulist = []
+               self.menulist.append(self.menuEntryStartpage)
+               self.menulist.append(self.menuEntryKeyboardLayout)
+
+               self["config"].list = self.menulist
+               self["config"].l.setList(self.menulist)
+
+class BookmarkEditWindow(ConfigListScreen, Screen):
+       CATEGORY,BOOKMARK = 0,1
+       skin = """
+               <screen position="center,center" size="600,140" title="Bookmark Edit">
+                       <widget name="config" position="0,0" size="600,100" scrollbarMode="showOnDemand" />
+
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="310,100" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/green.png" position="150,100" size="140,40" alphatest="on" />
+
+                       <widget source="key_red" render="Label" position="310,100" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_green" render="Label" position="150,100" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" foregroundColor="#ffffff" transparent="1" />
+
+                       <widget name="VKeyIcon" pixmap="skin_default/buttons/key_text.png" position="0,100" zPosition="10" size="35,25" transparent="1" alphatest="on" />
+
+               </screen>
+               """
+       def __init__(self, session, _mode, _type, _data, _bm):
+               self.mMode = _mode
+               self.mType = _type
+               self.mData = _data
+               self.mSession = session
+               self.mBookmarkManager = _bm
+
+               if _data is not None:
+                       vbcfg.DEBUG("0x%x" % _data.mId)
+
+               Screen.__init__(self, session)
+
+               self.menulist = []
+               ConfigListScreen.__init__(self, self.menulist)
+
+               self["actions"] = ActionMap(["OkCancelActions", "ColorActions",], {
+                       "ok"     : self.keyGreen,
+                       "green"  : self.keyGreen,
+                       "red"    : self.keyRed,
+                       "cancel" : self.keyRed,
+               }, -2)
+
+               self["VKeyIcon"] = Pixmap()
+               self["key_red"] = StaticText(_("Cancel"))
+               self["key_green"] = StaticText(_("Save"))
+
+               self.menuItemTitle = None
+               self.menuItemUrl   = None
+               self.menuItemName  = None
+
+               self.menuEntryName = None
+               self.menuEntryTitle = None
+               self.menuEntryUrl = None
+
+               self.makeConfigList()
+               self.onLayoutFinish.append(self.layoutFinished)
+
+       def layoutFinished(self):
+               self.setTitle(_('Bookmark') + ' ' + self.mMode)
+
+       def selectedItem(self):
+               currentPosition = self["config"].getCurrent()
+               if self.mType == BookmarkEditWindow.CATEGORY:
+                       return (_("Name"), self.menuItemName)
+               else:
+                       if currentPosition == self.menuEntryTitle:
+                               return (_("Title"), self.menuItemTitle)
+                       elif currentPosition == self.menuEntryUrl:
+                               return (_("Url"), self.menuItemUrl)
+               return None
+
+       def showMessageBox(self, text):
+               msg = _("Invalid ") + text + _("!!(Empty)\nPlease, Input to the") + " " + text + "."
+               self.mSession.openWithCallback(self.showVKeyWindow, MessageBox, msg, MessageBox.TYPE_INFO)
+               return False
+
+       def showVKeyWindow(self, data=None):
+               itemTitle = ""
+               itemValue = ""
+               selected = self.selectedItem()
+               if selected is not None:
+                       itemValue = selected[1].value
+                       if strIsEmpty(itemValue):
+                               itemValue = ""
+                       itemTitle = selected[0]
+
+               self.session.openWithCallback(self.cbVKeyWindow, VirtualKeyBoard, title=itemTitle, text=itemValue)
+
+       def cbVKeyWindow(self, data=None):
+               if data is not None:
+                       selected = self.selectedItem()
+                       if selected is not None:
+                               selected[1].setValue(data)
+
+       def saveData(self):
+               if self.mType == BookmarkEditWindow.CATEGORY:
+                       if self.mMode == _('Add'):
+                               categoryName = self.menuItemName.value
+                               if strIsEmpty(categoryName):
+                                       return self.showMessageBox(_("Category Name"))
+                               self.mBookmarkManager.addCategory(categoryName)
+                       else:
+                               if strIsEmpty(self.menuItemName.value):
+                                       return self.showMessageBox(_("Category Name"))
+                               self.mData.mName = self.menuItemName.value
+                               self.mBookmarkManager.updateCategory(self.mData)
+               else:
+                       if self.mMode == _('Add'):
+                               bookmarkTitle = self.menuItemTitle.value
+                               bookmarkUrl = self.menuItemUrl.value
+                               if strIsEmpty(bookmarkTitle):
+                                       self["config"].setCurrentIndex(0)
+                                       return self.showMessageBox(_("Bookmark Title"))
+                               if strIsEmpty(bookmarkUrl):
+                                       self["config"].setCurrentIndex(1)
+                                       return self.showMessageBox(_("Bookmark URL"))
+                               self.mBookmarkManager.addBookmark(bookmarkTitle, bookmarkUrl, self.mData.mParent, 0)
+                       else:
+                               if strIsEmpty(self.menuItemTitle.value):
+                                       self["config"].setCurrentIndex(0)
+                                       return self.showMessageBox(_("Bookmark Title"))
+                               if strIsEmpty(self.menuItemUrl.value):
+                                       self["config"].setCurrentIndex(1)
+                                       return self.showMessageBox(_("Bookmark URL"))
+                               self.mData.mTitle = self.menuItemTitle.value
+                               self.mData.mUrl = self.menuItemUrl.value
+                               self.mBookmarkManager.updateBookmark(self.mData)
+               return True
+
+       def keyGreen(self):
+               if not self.saveData():
+                       return
+               self.close(True)
+
+       def keyRed(self):
+               self.close(False)
+
+       def keyLeft(self):
+               ConfigListScreen.keyLeft(self)
+
+       def keyRight(self):
+               ConfigListScreen.keyRight(self)
+
+       def makeConfigList(self):
+               self.menulist = []
+
+               if self.mType == BookmarkEditWindow.CATEGORY:
+                       self.menuItemName = ConfigText(default=self.mData.mName, visible_width=65, fixed_size=False)
+
+                       self.menuEntryName = getConfigListEntry(_("Name"), self.menuItemName)
+
+                       self.menulist.append(self.menuEntryName)
+               else:
+                       self.menuItemTitle = ConfigText(default=self.mData.mTitle, visible_width=65, fixed_size=False)
+                       self.menuItemUrl   = ConfigText(default=self.mData.mUrl, visible_width=65, fixed_size=False)
+
+                       self.menuEntryTitle = getConfigListEntry(_("Title"), self.menuItemTitle)
+                       self.menuEntryUrl = getConfigListEntry(_("Url"), self.menuItemUrl)
+
+                       self.menulist.append(self.menuEntryTitle)
+                       self.menulist.append(self.menuEntryUrl)
+
+               self["config"].list = self.menulist
+               self["config"].l.setList(self.menulist)
+
+class BrowserBookmarkWindow(Screen):
+       skin = """
+               <screen name="BrowserBookmarkWindow" 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" />
+                       <widget source="key_0" render="Label" position="258,330" zPosition="1" size="300,30" font="Regular;20" halign="right" valign="center"/>
+
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="5,360" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/green.png" position="155,360" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/yellow.png" position="305,360" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/blue.png" position="450,360" size="140,40" alphatest="on" />
+
+                       <widget source="key_red" render="Label" position="5,360" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_green" render="Label" position="155,360" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_yellow" render="Label" position="305,360" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_blue" render="Label" position="450,360" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" foregroundColor="#ffffff" transparent="1" />
+               </screen>
+               """
+
+       def __init__(self, _session, _url=None, _title=None):
+               self.mUrl = _url
+               self.mTitle = _title
+               self.mBookmarkManager = BookmarkManager.getInstance()
+               self.mSession = _session
+               Screen.__init__(self, _session)
+               self["actions"] = ActionMap(["DirectionActions", "OkCancelActions","ColorActions", "NumberActions"], {
+                               "ok"    : self.keyOK,
+                               "cancel": self.keyCancel,
+                               "red"   : self.keyRed,
+                               "green" : self.keyGreen,
+                               "yellow": self.keyYellow,
+                               "blue"  : self.keyBlue,
+                               "0" : self.keyNumber,
+                       },-2)
+
+               self["key_red"]    = StaticText(_("Exit"))
+               self["key_green"]  = StaticText(_("Add"))
+               self["key_yellow"] = StaticText(_("Edit"))
+               self["key_blue"]   = StaticText(_("Delete"))
+               self["key_0"]      = StaticText(_("Set as Startpage"))
+
+               self.mBookmarkList = self.setBookmarkList()
+               self["bookmarklist"] = MenuList(self.mBookmarkList)
+
+               self.onLayoutFinish.append(self.layoutFinished)
+
+       def layoutFinished(self):
+               self.setTitle(_('Bookmark'))
+
+       def setBookmarkList(self):
+               l = []
+               #self.mBookmarkManager.dump()
+               cd = self.mBookmarkManager.getBookmarkRoot()
+               for ck in cd.iterkeys():
+                       l.append(('# ' + cd[ck].mName, cd[ck]))
+                       bd = cd[ck].mBookmarks
+                       for bk in bd.iterkeys():
+                               l.append(('    - ' + bd[bk].mTitle, bd[bk]))
+               return l
+
+       def updateBookmarkList(self):
+               self.mBookmarkList = self.setBookmarkList()
+               self["bookmarklist"].setList(self.mBookmarkList)
+
+       def cbEditWindow(self, ret=False):
+               if not ret:
+                       return
+               self.updateBookmarkList()
+
+       def getParentCategory(self):
+               idx = self["bookmarklist"].getSelectedIndex()
+               try:
+                       while idx >= 0:
+                               data = self.mBookmarkList[idx][0].strip()
+                               if data[0] == '#':
+                                       return self.mBookmarkList[idx][1]
+                               idx -= 1
+               except: pass
+               return None
+
+       def isCategoryItem(self):
+               try:
+                       head = self["bookmarklist"].getCurrent()[0].strip()
+                       if head[0] == '#':
+                               return True
+               except: pass
+               return False
+
+       def keyNumber(self):
+               if self.isCategoryItem(): return
+
+               data = self["bookmarklist"].getCurrent()[1]
+               if strIsEmpty(data.mUrl):
+                       msg = _("Invalid URL. Please check again!!")
+                       self.mSession.open(MessageBox, msg, MessageBox.TYPE_INFO)
+                       return
+               def cbSetStartpage(ret=None):
+                       if ret is None: return
+                       if ret:
+                               data = self["bookmarklist"].getCurrent()[1]
+                               BrowserSetting().setData(data.mUrl, data.mType)
+               msg = _("Do you want to set selected url to the Startpage?")
+               self.mSession.openWithCallback(cbSetStartpage, MessageBox, msg, MessageBox.TYPE_YESNO, default=True)
+
+       def keyGreen(self):
+               def cbGreen(data):
+                       if data is None:
+                               return
+                       if data[1] == 1:
+                               parent = self.getParentCategory()
+                               if parent is None:
+                                       return
+                               if strIsEmpty(self.mTitle):
+                                       return
+                               retAdd = self.mBookmarkManager.addBookmark(self.mTitle, self.mUrl, parent.mId, 0)
+                               if not retAdd:
+                                       msg = _("Current page is already exist.")
+                                       self.mSession.open(MessageBox, msg, MessageBox.TYPE_INFO)
+                               self.cbEditWindow(True)
+                       elif data[1] == 2:
+                               parent = self.getParentCategory()
+                               if parent is None:
+                                       return
+                               b = BookmarkData(0, '', '', parent.mId, 0)
+                               self.mSession.openWithCallback(self.cbEditWindow, BookmarkEditWindow, _('Add'), BookmarkEditWindow.BOOKMARK, b, self.mBookmarkManager)
+                       elif data[1] == 3:
+                               c = CategoryData(0, '')
+                               self.mSession.openWithCallback(self.cbEditWindow, BookmarkEditWindow, _('Add'), BookmarkEditWindow.CATEGORY, c, self.mBookmarkManager)
+               if strIsEmpty(self.mUrl):
+                       l = [(_('Direct Input(Bookmark)'),2,), (_('Direct Input(Category)'),3,)]
+               else:   l = [(_('Currentpage(Bookmark)'),1,), (_('Direct Input(Bookmark)'),2,), (_('Direct Input(Category)'),3,)]
+               self.mSession.openWithCallback(cbGreen, ChoiceBox, title=_("Please choose."), list=l)
+
+       def keyYellow(self):
+               data = self["bookmarklist"].getCurrent()[1]
+               if self.isCategoryItem():
+                       self.mSession.openWithCallback(self.cbEditWindow, BookmarkEditWindow, _('Edit'), BookmarkEditWindow.CATEGORY, data, self.mBookmarkManager)
+               else:   self.mSession.openWithCallback(self.cbEditWindow, BookmarkEditWindow, _('Edit'), BookmarkEditWindow.BOOKMARK, data, self.mBookmarkManager)
+
+       def keyBlue(self):
+               def cbBlue(ret=None):
+                       if not ret: return
+                       data = self["bookmarklist"].getCurrent()[1]
+                       if self.isCategoryItem():
+                               self.mBookmarkManager.deleteCategory(data.mId)
+                       else:   self.mBookmarkManager.deleteBookmark(data.mId)
+                       self.updateBookmarkList()
+               if self.isCategoryItem():
+                       msg = _("Do you want to delete the category and the bookmarks?")
+               else:   msg = _("Do you want to delete the bookmark?")
+               self.mSession.openWithCallback(cbBlue, MessageBox, msg, MessageBox.TYPE_YESNO, default=True)
+
+       def keyOK(self):
+               if self.isCategoryItem(): return
+
+               data = self["bookmarklist"].getCurrent()[1]
+               url = data.mUrl.strip()
+               if len(url) == 0:
+                       self.session.open(MessageBox, _("Can't open selected bookmark.\n   - URL data is empty!!"), type = MessageBox.TYPE_INFO)
+                       return
+               mode = data.mType
+               if mode:
+                       lang = language.getLanguage()
+                       if os.path.exists(vbcfg.MANUALROOT + '/' + lang):
+                               url = vbcfg.MANUALROOT + '/' + lang + '/main.html'
+               self.close((url, mode))
+
+       def keyRed(self):
+               self.keyCancel()
+
+       def keyCancel(self):
+               self.close()
+
+class BrowserHelpWindow(Screen, HelpableScreen):
+       MODE_GLOBAL,MODE_KEYBOARD,MODE_MOUSE = 1,2,3
+       skin = """
+               <screen name="BrowserHelpWindow" position="center,center" size="600,40" title="Browser Help" >
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="5,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/green.png" position="155,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/yellow.png" position="305,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/blue.png" position="450,0" size="140,40" alphatest="on" />
+
+                       <widget source="key_red" render="Label" position="5,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_green" render="Label" position="155,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_yellow" render="Label" position="305,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_blue" render="Label" position="450,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" foregroundColor="#ffffff" transparent="1" />
+               </screen>
+               """
+       def __init__(self, session):
+               Screen.__init__(self, session)
+               HelpableScreen.__init__(self)
+
+               self["key_red"]    = StaticText(_("Exit"))
+               self["key_green"]  = StaticText(_("Global"))
+               self["key_yellow"] = StaticText(_("Mouse"))
+               self["key_blue"]   = StaticText(_("Keyboard"))
+
+               self["actions"] = ActionMap(["DirectionActions", "OkCancelActions","ColorActions"], {
+                               "ok"    : self.keyRed,
+                               "cancel": self.keyRed,
+                               "red"   : self.keyRed,
+                               "green" : self.keyGreen,
+                               "yellow": self.keyYellow,
+                               "blue"  : self.keyBlue,
+                       },-2)
+
+               self.showHelpTimer = eTimer()
+               self.showHelpTimer.callback.append(self.cbShowHelpTimerClosed)
+               self.showHelpTimer.start(500)
+
+               self.onLayoutFinish.append(self.layoutFinished)
+
+       def layoutFinished(self):
+               self.setTitle(_('Browser Help'))
+
+       def cbShowHelpTimerClosed(self):
+               self.showHelpTimer.stop()
+               self.setHelpModeActions(self.MODE_GLOBAL)
+
+       def setHelpModeActions(self, _mode=0):
+               self.helpList = []
+               if _mode == self.MODE_GLOBAL:
+                       self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", {
+                               "cancel" : (self.keyPass, _("Exit the Browser.")),
+                       })
+                       self["MenuActions"] = HelpableActionMap(self, "MenuActions", {
+                               "menu" : (self.keyPass, _("Show the Menu window.")),
+                       })
+                       self["ColorActions"] = HelpableActionMap(self, "ColorActions", {
+                               "green"  : (self.keyPass, _("Enter Key")),
+                               "yellow" : (self.keyPass, _("Show the Virtual keyboard window.")),
+                               "blue"   : (self.keyPass, _("Backspace Key")),
+                       })
+                       self["EPGSelectActions"] = HelpableActionMap(self, "EPGSelectActions", {
+                               "info" : (self.keyPass, _("Switch to keyboard/mouse mode.")),
+                       })
+
+               elif _mode == self.MODE_MOUSE:
+                       self["DirectionActions"] = HelpableActionMap(self, "DirectionActions", {
+                               "up"    : (self.keyPass, _("It will move the mouse pointer up.")),
+                               "down"  : (self.keyPass, _("It will move the mouse pointer down.")),
+                               "left"  : (self.keyPass, _("It will move the mouse pointer left.")),
+                               "right" : (self.keyPass, _("It will move the mouse pointer right.")),
+                       })
+                       self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", {
+                               "ok" : (self.keyPass, _("Left Mouse Button")),
+                       })
+                       self["EPGSelectActions"] = HelpableActionMap(self, "EPGSelectActions", {
+                               "nextBouquet" : (self.keyPass, _("Right Mouse Button")),
+                               "nextService" : (self.keyPass, _("Left Key")),
+                               "prevService" : (self.keyPass, _("Right Key")),
+                       })
+               elif _mode == self.MODE_KEYBOARD:
+                       self["DirectionActions"] = HelpableActionMap(self, "DirectionActions", {
+                               "up"    : (self.keyPass, _("Up Key")),
+                               "down"  : (self.keyPass, _("Down Key")),
+                               "left"  : (self.keyPass, _("Left Key")),
+                               "right" : (self.keyPass, _("Right Key")),
+                       })
+                       self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", {
+                               "ok" : (self.keyPass, _("Enter Key")),
+                       })
+                       self["EPGSelectActions"] = HelpableActionMap(self, "EPGSelectActions", {
+                               "nextBouquet" : (self.keyPass, _("PageUp Key")),
+                               "prevBouquet" : (self.keyPass, _("PageDown Key")),
+                               "nextService" : (self.keyPass, _("Go to previous page.")),
+                               "prevService" : (self.keyPass, _("Go to next page.")),
+                       })
+
+               if _mode > 0:
+                       self.showHelp()
+
+       def keyPass(self):
+               pass
+
+       def keyRed(self):
+               self.close()
+
+       def keyGreen(self):
+               self.setHelpModeActions(self.MODE_GLOBAL)
+
+       def keyYellow(self):
+               self.setHelpModeActions(self.MODE_MOUSE)
+
+       def keyBlue(self):
+               self.setHelpModeActions(self.MODE_KEYBOARD)
+
+class Browser(Screen):
+       MENU_ITEM_WIDTH  = 150
+       MENU_ITEM_HEIGHT = 30
+       MENULIST_WIDTH   = 200
+       MENULIST_HEIGHT  = 25
+
+       # menulist->position->y : MENU_ITEM_HEIGHT+30
+       # menulist->size->x     : MENULIST_WIDTH
+
+       size = getDesktop(0).size()
+       WIDTH  = int(size.width())
+       HEIGHT = int(size.height())
+       skin =  """
+               <screen name="VuplusBrowser" position="0,0" size="%(width)d,%(height)d" backgroundColor="transparent" flags="wfNoBorder" title="Vuplus 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,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,%(bottom_pos_y)d" size="%(bottom_size_x)d,80" font="Regular;20" valign="center" halign="center" backgroundColor="#000000" />
+               </screen>
+               """ % { 'width'  :WIDTH,
+                       'height' :HEIGHT,
+                       'bottom_pos_y'  :HEIGHT-80,
+                       'bottom_size_x' :WIDTH }
+
+       MENULIST_ITEMS = []
+       COMMAND_MAP = {}
+       def __init__(self, session, url=None, is_webapp=False):
+               Screen.__init__(self, session)
+               self["actions"] = ActionMap(["DirectionActions", "MenuActions", "OkCancelActions"], {
+                        "cancel"      : self.keyCancel
+                       ,"ok"          : self.keyOK
+                       ,"left"        : self.keyLeft
+                       ,"right"       : self.keyRight
+                       ,"up"          : self.keyUp
+                       ,"down"        : self.keyDown
+                       ,"menu"        : self.keyMenu
+               }, -2)
+
+               self._cb_update_language()
+
+               self.idx_menu = 0
+               self.is_browser_opened = False
+               self.is_show_top = True
+               self.is_show_menu = False
+
+               self._current_url = None
+               self._current_title = None
+
+               self["topArea"]    = Label()
+               self["bottomArea"] = Label()
+
+               self["menuitemFile"] = MultiColorLabel()
+               self["menuitemTool"] = MultiColorLabel()
+               self["menuitemHelp"] = MultiColorLabel()
+
+               self.top_menus = [self["menuitemFile"], self["menuitemTool"], self["menuitemHelp"]]
+
+               self["menulist"] = MenuList(self.get_menulist_items(self.idx_menu))
+               self["submenulist"] = MenuList(None)
+
+               self.onLayoutFinish.append(self.layoutFinished)
+
+               self._close_timer = eTimer()
+               self._close_timer.callback.append(self._cb_stop_browser)
+
+               self.m_url = url
+               self.m_webapp = is_webapp
+               language.addCallback(self._cb_update_language)
+
+       def layoutFinished(self):
+               self["menuitemFile"].setText(_("File"))
+               self["menuitemTool"].setText(_("Tools"))
+               self["menuitemHelp"].setText(_("Help"))
+
+               self["menulist"].hide()
+               self["submenulist"].hide()
+
+               self["bottomArea"].setText(_("Vuplus Web Browser Plugin v1.0"))
+               self.setTitle(_("BrowserMain"))
+               self.set_menu_item()
+               vbcfg.LOG("Starting Browser")
+
+               if self.m_url is not None:
+                       self.keyMenu()
+                       if self.m_webapp:
+                               self._cb_start_browser(self.m_url, 1, 'YOUTUBETV_OPENURL')
+                       else:
+                               self._cb_start_browser(self.m_url, 1)
+
+       def _cb_update_language(self):
+               self.MENULIST_ITEMS = [
+                       [(_('Open Startpage'), None), (_('Open URL'), None), (_('Start/Stop'),None), (_('Exit'), None)],
+                       [(_('Bookmark'), None), (_('Preference'), None), (_('Position Setup'), None)],
+                       [(_('About'), None), (_('Help'), None)]
+               ]
+               self.COMMAND_MAP = {}
+               self.COMMAND_MAP[_('Open Startpage')] = self._cmd_OpenStartpage
+               self.COMMAND_MAP[_('Open URL')] = self._cmd_OpenURL
+               self.COMMAND_MAP[_('Start/Stop')] = self._cmd_StartStop
+               self.COMMAND_MAP[_('Exit')] = self._cmd_Exit
+               self.COMMAND_MAP[_('Bookmark')] = self._cmd_Bookmark
+               self.COMMAND_MAP[_('Preference')] = self._cmd_Preference
+               self.COMMAND_MAP[_('Position Setup')] = self._cmd_Position
+               self.COMMAND_MAP[_('About')] = self._cmd_About
+               self.COMMAND_MAP[_('Help')] = self._cmd_Help
+               self.COMMAND_MAP[_('Return')] = self._cmd_Return
+
+       def _cb_set_title(self, title=None):
+               vbcfg.LOG("page title: %s" % title)
+               if title is None:
+                       return
+               self.setTitle(title)
+
+       def _cb_close_window(self):
+               self._close_timer.start(1000)
+
+       def _cb_start_browser(self, data=None, mode=0, opcode='BROWSER_OPENURL'):
+               if not vbcfg.g_main.check_vbrowser():
+                       if self.m_url is not None:
+                               if vbcfg.g_service:
+                                       self.session.nav.playService(vbcfg.g_service)
+                       return
+               vbcfg.LOG("open url: %s %d" % (data, mode))
+               if strIsEmpty(data):
+                       return
+
+               try:
+                       if self._cb_set_title not in vbcfg.g_main.vbhandler.onSetTitleCB:
+                               vbcfg.g_main.vbhandler.onSetTitleCB.append(self._cb_set_title)
+               except Exception:
+                       pass
+
+               try:
+                       if self._cb_close_window not in vbcfg.g_main.vbhandler.onCloseCB:
+                               vbcfg.g_main.vbhandler.onCloseCB.append(self._cb_close_window)
+               except Exception:
+                       pass
+
+               vbcfg.g_position = vbcfg.getPosition()
+               fbClass.getInstance().lock()
+               eRCInput.getInstance().lock()
+
+               self.toggle_top()
+               ret = VBController.command(opcode, data)
+               self._current_url = data
+               if ret:
+                       self.is_browser_opened = True
+               else:
+                       self.is_browser_opened = False
+                       vbcfg.ERR("Failed to open url: %s" % data)
+
+       def _cb_stop_browser(self):
+               self._close_timer.stop()
+
+               try:
+                       if self._cb_set_title in vbcfg.g_main.vbhandler.onSetTitleCB:
+                               vbcfg.g_main.vbhandler.onSetTitleCB.remove(self._cb_set_title)
+               except Exception:
+                       pass
+
+               try:
+                       if self._cb_close_window in vbcfg.g_main.vbhandler.onCloseCB:
+                               vbcfg.g_main.vbhandler.onCloseCB.remove(self._cb_close_window)
+               except Exception:
+                       pass
+
+               self.toggle_top()
+
+               from enigma import getDesktop, gMainDC
+               desktop_size = getDesktop(0).size()
+               gMainDC.getInstance().setResolution(desktop_size.width(), desktop_size.height())
+               vbcfg.setPosition(vbcfg.g_position)
+
+               fbClass.getInstance().unlock()
+               eRCInput.getInstance().unlock()
+               self.is_browser_opened = False
+
+               vbcfg.LOG("Stop Browser")
+               self.setTitle(_("BrowserMain"))
+               if self.m_url is not None:
+                       self.keyCancel()
+                       if vbcfg.g_service:
+                               self.session.nav.playService(vbcfg.g_service)
+               else:
+                       self.keyRight()
+                       self.keyLeft()
+
+       def _cb_update_bookmark(self, data=None):
+               if data is None:
+                       return
+               if not vbcfg.g_main.check_vbrowser():
+                       message = _("Vuplus Browser was not running.\nPlease running browser using [File]>[Start/Stop] menu.")
+                       self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+                       return
+               (url, mode) = data
+               self._cb_start_browser(url, mode)
+
+       def _cmd_OpenStartpage(self):
+               if not vbcfg.g_main.check_vbrowser():
+                       message = _("Vuplus Browser was not running.\nPlease running browser using [File]>[Start/Stop] menu.")
+                       self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+                       return
+               mode = 0
+               #startpage = 'http://vuplus.com'
+               try:
+                       d = BrowserSetting().getData()
+                       start = d['start']
+                       mode = d['type']
+               except:
+                       pass
+               self._cb_start_browser(start, mode)
+
+       def _cmd_OpenURL(self):
+               if not vbcfg.g_main.check_vbrowser():
+                       message = _("Vuplus Browser was not running.\nPlease running browser using [File]>[Start/Stop] menu.")
+                       self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+                       return
+               self.session.openWithCallback(self._cb_start_browser, VirtualKeyBoard, title=(_("Please enter URL here")), text='http://')
+
+       def _cmd_StartStop(self):
+               if vbcfg.g_main is None:
+                       return
+               vbcfg.g_main.menu_toggle_vbrowser(self.keyMenu())
+
+       def _cmd_Exit(self):
+               self.close()
+
+       def _cmd_Bookmark(self):
+               url = self._current_url
+               if url is None:
+                       url = ''
+               title = self._current_title
+               if title is None:
+                       title = ''
+               self.session.openWithCallback(self._cb_update_bookmark, BrowserBookmarkWindow, url, title)
+
+       def _cmd_Preference(self):
+               url = self._current_url
+               if url is None:
+                       url = ''
+               self.session.open(BrowserPreferenceWindow, url)
+
+       def _cmd_Position(self):
+               self.session.open(BrowserPositionWindow)
+
+       def _cmd_About(self):
+               self.session.open(MessageBox, _('Vuplus Web Browser Plugin v1.0'), type = MessageBox.TYPE_INFO)
+
+       def _cmd_Help(self):
+               self.session.open(BrowserHelpWindow)
+
+       def _cmd_Return(self):
+               self.keyCancel()
+
+       def do_command(self, command):
+               try:
+                       self.COMMAND_MAP[command]()
+               except Exception, ErrMsg:
+                       vbcfg.ERR(ErrMsg)
+
+       def get_menulist_items(self, idx=0):
+               l = self.MENULIST_ITEMS[idx]
+               if self.is_browser_opened and idx == 0:
+                       l = [(_("Return"), None)]
+               return l
+
+       def set_menu_item(self):
+               self["menuitemFile"].setForegroundColorNum(0)
+               self["menuitemTool"].setForegroundColorNum(0)
+               self["menuitemHelp"].setForegroundColorNum(0)
+               self.top_menus[self.idx_menu].setForegroundColorNum(1)
+
+       def toggle_top(self):
+               if self.is_show_top:
+                       self.hide()
+               else:
+                       self.show()
+               self.is_show_top = not self.is_show_top
+
+       def toggle_menulist(self):
+               if self.is_show_menu:
+                       self["menulist"].hide()
+               else:
+                       self["menulist"].show()
+               self.is_show_menu = not self.is_show_menu
+
+       def toggle_browser(self, url=None, title=None):
+               self._current_url = url
+               if title is None:
+                       idx = len(url)
+                       if idx > 10:
+                               idx = 10
+                       title = url[:idx]
+               self._current_title = title
+               if self._current_url:
+                       vbcfg.DEBUG(self._current_url)
+
+               self.toggle_top()
+
+               self["menulist"].pageUp()
+               self.keyUp()
+               self.keyDown()
+
+       def keyCancel(self):
+               if self.is_browser_opened:
+                       fbClass.getInstance().lock()
+                       eRCInput.getInstance().lock()
+                       self.toggle_top()
+
+                       VBController.command("BROWSER_MENU_CLOSE")
+                       return
+               self._cmd_Exit()
+
+       def keyOK(self):
+               if not self.is_show_top:
+                       self.keyMenu()
+                       return
+               if not self.is_show_menu:
+                       self.keyDown()
+                       return
+               if self["menulist"].getCurrent()[1] is None:
+                       self.do_command(self["menulist"].getCurrent()[0])
+                       return
+               self.keyRight()
+
+       def keyLeft(self):
+               if self.idx_menu == 0:
+                       self.idx_menu = 2
+               else:
+                       self.idx_menu = self.idx_menu - 1
+
+               if self.is_show_menu:
+                       self["menulist"].pageUp()
+                       self.keyUp()
+                       self.keyDown()
+               self.set_menu_item()
+
+       def keyRight(self):
+               if self.idx_menu == 2:
+                       self.idx_menu = 0
+               else:
+                       self.idx_menu = self.idx_menu + 1
+
+               if self.is_show_menu:
+                       self["menulist"].pageUp()
+                       self.keyUp()
+                       self.keyDown()
+               self.set_menu_item()
+
+       def keyUp(self):
+               if self.is_show_menu and self["menulist"].getSelectedIndex() == 0:
+                       self.toggle_menulist()
+                       return
+               self["menulist"].up()
+
+       def keyDown(self):
+               if not self.is_show_menu:
+                       self["menulist"].setList(self.get_menulist_items(self.idx_menu))
+                       self["menulist"].resize(self.MENULIST_WIDTH, self.MENULIST_HEIGHT*len(self.get_menulist_items(self.idx_menu))+5)
+                       self["menulist"].move(self.MENU_ITEM_WIDTH*self.idx_menu+50,self.MENU_ITEM_HEIGHT+30)
+                       self.toggle_menulist()
+                       return
+               self["menulist"].down()
+
+       def keyMenu(self):
+               self.toggle_top()
diff --git a/lib/python/Plugins/Extensions/Vbrowser/hbbtv.py b/lib/python/Plugins/Extensions/Vbrowser/hbbtv.py
new file mode 100644 (file)
index 0000000..711c81c
--- /dev/null
@@ -0,0 +1,93 @@
+from Screens.Screen import Screen
+
+from enigma import eTimer, fbClass, eRCInput
+
+import struct, vbcfg
+
+from __init__ import _
+from vbipc import VBController
+
+class HbbTVWindow(Screen):
+       skin = """
+               <screen name="HbbTVWindow" position="0,0" size="1280,720" backgroundColor="transparent" flags="wfNoBorder" title="HbbTV Plugin">
+               </screen>
+               """
+       def __init__(self, session, url=None, app_info=None):
+               fbClass.getInstance().lock()
+               eRCInput.getInstance().lock()
+
+               Screen.__init__(self, session)
+
+               self._url = url
+               self._info = app_info
+
+               self.onLayoutFinish.append(self.start_hbbtv_application)
+
+               self._close_timer = eTimer()
+               self._close_timer.callback.append(self.stop_hbbtv_application)
+
+               try:
+                       if self._cb_set_title not in vbcfg.g_main.vbhandler.onSetTitleCB:
+                               vbcfg.g_main.vbhandler.onSetTitleCB.append(self._cb_set_title)
+               except Exception:
+                       pass
+
+               try:
+                       if self._cb_close_window not in vbcfg.g_main.vbhandler.onCloseCB:
+                               vbcfg.g_main.vbhandler.onCloseCB.append(self._cb_close_window)
+               except Exception:
+                       pass
+
+       def _cb_set_title(self, title=None):
+               vbcfg.LOG("pate title: %s" % title)
+               if title is None:
+                       return
+               self.setTitle(title)
+
+       def _cb_close_window(self):
+               self._close_timer.start(1000)
+
+       def start_hbbtv_application(self):
+               self.setTitle(_('HbbTV Plugin'))
+               vbcfg.LOG("Starting HbbTV")
+
+               vbcfg.DEBUG("url : %s" % self._url and self._url)
+               vbcfg.DEBUG("info: %s" % self._info and self._info["url"])
+
+               if self._info and self._info["control"] == 1 and vbcfg.g_channel_info is not None:
+                       (sid, onid, tsid, name) = vbcfg.g_channel_info
+                       params = struct.pack('iiiiii', 0, self._info["orgid"], sid, onid, tsid, 0)
+                       ret = VBController.command('HBBTV_LOADAIT', params)
+               else:
+                       ret = VBController.command('HBBTV_OPENURL', self._url)
+
+               if ret is False:
+                       self._close_timer.start(1000)
+                       vbcfg.ERR("Failed to start hbbtv")
+
+       def stop_hbbtv_application(self):
+               self._close_timer.stop()
+               self._close_timer = None
+
+               try:
+                       if self._cb_set_title in vbcfg.g_main.vbhandler.onSetTitleCB:
+                               vbcfg.g_main.vbhandler.onSetTitleCB.remove(self._cb_set_title)
+               except Exception:
+                       pass
+
+               try:
+                       if self._cb_close_window in vbcfg.g_main.vbhandler.onCloseCB:
+                               vbcfg.g_main.vbhandler.onCloseCB.remove(self._cb_close_window)
+               except Exception:
+                       pass
+
+               from enigma import getDesktop, gMainDC
+               desktop_size = getDesktop(0).size()
+               gMainDC.getInstance().setResolution(desktop_size.width(), desktop_size.height())
+
+               fbClass.getInstance().unlock()
+               eRCInput.getInstance().unlock()
+
+               vbcfg.LOG("Stop HbbTV")
+               self.close()
+
diff --git a/lib/python/Plugins/Extensions/Vbrowser/keymap.xml b/lib/python/Plugins/Extensions/Vbrowser/keymap.xml
new file mode 100644 (file)
index 0000000..d0ef391
--- /dev/null
@@ -0,0 +1,6 @@
+<keymap>
+       <map context="HelpbuttonActions">
+               <key id="KEY_HELP" mapto="help_b" flags="b" />
+               <key id="KEY_HELP" mapto="help_l" flags="l" />
+       </map>
+</keymap>
diff --git a/lib/python/Plugins/Extensions/Vbrowser/locale/Makefile.am b/lib/python/Plugins/Extensions/Vbrowser/locale/Makefile.am
new file mode 100644 (file)
index 0000000..3e5f8b4
--- /dev/null
@@ -0,0 +1,28 @@
+PLUGIN = Vbrowser
+LANGS = en de it
+
+CATEGORY ?= "Extensions"
+
+plugindir = $(libdir)/enigma2/python/Plugins/$(CATEGORY)/$(PLUGIN)
+
+LANGMO = $(LANGS:=.mo)
+LANGPO = $(LANGS:=.po)
+
+.po.mo:
+       $(MSGFMT) -o $@ $<
+
+BUILT_SOURCES = $(LANGMO)
+CLEANFILES = $(LANGMO) $(PLUGIN)-py.pot $(PLUGIN)-xml.pot $(PLUGIN).pot
+
+dist-hook: $(LANGPO)
+
+install-data-local: $(LANGMO)
+       for lang in $(LANGS); do \
+               $(mkinstalldirs) $(DESTDIR)$(plugindir)/locale/$$lang/LC_MESSAGES; \
+               $(INSTALL_DATA) $$lang.mo $(DESTDIR)$(plugindir)/locale/$$lang/LC_MESSAGES/$(PLUGIN).mo; \
+       done
+
+uninstall-local:
+       for lang in $(LANGS); do \
+               $(RM) $(DESTDIR)$(plugindir)/locale/$$lang/LC_MESSAGES/$(PLUGIN).mo; \
+       done
diff --git a/lib/python/Plugins/Extensions/Vbrowser/locale/Vbrowser.pot b/lib/python/Plugins/Extensions/Vbrowser/locale/Vbrowser.pot
new file mode 100644 (file)
index 0000000..abb9598
--- /dev/null
@@ -0,0 +1,459 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ORGANIZATION
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vbrowser\n"
+"POT-Creation-Date: 2014-07-01 10:50+KST\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: pygettext.py 1.5\n"
+
+
+#: browser.py:151 browser.py:265 browser.py:404 youtube.py:133
+msgid "Cancel"
+msgstr ""
+
+#: browser.py:152 browser.py:266 browser.py:405 youtube.py:134
+msgid "Save"
+msgstr ""
+
+#: browser.py:153
+msgid " "
+msgstr ""
+
+#: browser.py:173
+msgid "left"
+msgstr ""
+
+#: browser.py:174
+msgid "width"
+msgstr ""
+
+#: browser.py:175
+msgid "top"
+msgstr ""
+
+#: browser.py:176
+msgid "height"
+msgstr ""
+
+#: browser.py:228
+msgid "Really close without saving settings?"
+msgstr ""
+
+#: browser.py:278 browser.py:911 browser.py:920
+msgid "Preference"
+msgstr ""
+
+#: browser.py:291
+msgid ""
+"Invalid URL!!(Empty)\n"
+"Please, Input to the URL."
+msgstr ""
+
+#: browser.py:312 browser.py:1036
+msgid "Please enter URL here"
+msgstr ""
+
+#: browser.py:334
+msgid "Start Page"
+msgstr ""
+
+#: browser.py:336
+msgid "Current Page"
+msgstr ""
+
+#: browser.py:337
+msgid "Direct Input"
+msgstr ""
+
+#: browser.py:339
+msgid "Startpage"
+msgstr ""
+
+#: browser.py:354
+msgid "Keyboard Layout"
+msgstr ""
+
+#: browser.py:419 browser.py:574 browser.py:911 browser.py:919
+msgid "Bookmark"
+msgstr ""
+
+#: browser.py:424 browser.py:510
+msgid "Name"
+msgstr ""
+
+#: browser.py:427 browser.py:517
+msgid "Title"
+msgstr ""
+
+#: browser.py:429 browser.py:518
+msgid "Url"
+msgstr ""
+
+#: browser.py:433
+msgid ""
+"!!(Empty)\n"
+"Please, Input to the"
+msgstr ""
+
+#: browser.py:433
+msgid "Invalid "
+msgstr ""
+
+#: browser.py:457 browser.py:468 browser.py:563 browser.py:651 browser.py:654
+msgid "Add"
+msgstr ""
+
+#: browser.py:460 browser.py:464
+msgid "Category Name"
+msgstr ""
+
+#: browser.py:473 browser.py:481
+msgid "Bookmark Title"
+msgstr ""
+
+#: browser.py:476 browser.py:484
+msgid "Bookmark URL"
+msgstr ""
+
+#: browser.py:562 browser.py:721 browser.py:910 browser.py:918
+msgid "Exit"
+msgstr ""
+
+#: browser.py:564 browser.py:663 browser.py:664
+msgid "Edit"
+msgstr ""
+
+#: browser.py:565
+msgid "Delete"
+msgstr ""
+
+#: browser.py:566
+msgid "Set as Startpage"
+msgstr ""
+
+#: browser.py:620
+msgid "Invalid URL. Please check again!!"
+msgstr ""
+
+#: browser.py:628
+msgid "Do you want to set selected url to the Startpage?"
+msgstr ""
+
+#: browser.py:643
+msgid "Current page is already exist."
+msgstr ""
+
+#: browser.py:656 browser.py:657
+msgid "Direct Input(Bookmark)"
+msgstr ""
+
+#: browser.py:656 browser.py:657
+msgid "Direct Input(Category)"
+msgstr ""
+
+#: browser.py:657
+msgid "Currentpage(Bookmark)"
+msgstr ""
+
+#: browser.py:658
+msgid "Please choose."
+msgstr ""
+
+#: browser.py:675
+msgid "Do you want to delete the category and the bookmarks?"
+msgstr ""
+
+#: browser.py:676
+msgid "Do you want to delete the bookmark?"
+msgstr ""
+
+#: browser.py:685
+msgid ""
+"Can't open selected bookmark.\n"
+"   - URL data is empty!!"
+msgstr ""
+
+#: browser.py:722
+msgid "Global"
+msgstr ""
+
+#: browser.py:723
+msgid "Mouse"
+msgstr ""
+
+#: browser.py:724
+msgid "Keyboard"
+msgstr ""
+
+#: browser.py:742
+msgid "Browser Help"
+msgstr ""
+
+#: browser.py:752
+msgid "Exit the Browser."
+msgstr ""
+
+#: browser.py:755
+msgid "Show the Menu window."
+msgstr ""
+
+#: browser.py:758 browser.py:789
+msgid "Enter Key"
+msgstr ""
+
+#: browser.py:759
+msgid "Show the Virtual keyboard window."
+msgstr ""
+
+#: browser.py:760
+msgid "Backspace Key"
+msgstr ""
+
+#: browser.py:763
+msgid "Switch to keyboard/mouse mode."
+msgstr ""
+
+#: browser.py:768
+msgid "It will move the mouse pointer up."
+msgstr ""
+
+#: browser.py:769
+msgid "It will move the mouse pointer down."
+msgstr ""
+
+#: browser.py:770
+msgid "It will move the mouse pointer left."
+msgstr ""
+
+#: browser.py:771
+msgid "It will move the mouse pointer right."
+msgstr ""
+
+#: browser.py:774
+msgid "Left Mouse Button"
+msgstr ""
+
+#: browser.py:777
+msgid "Right Mouse Button"
+msgstr ""
+
+#: browser.py:778 browser.py:785
+msgid "Left Key"
+msgstr ""
+
+#: browser.py:779 browser.py:786
+msgid "Right Key"
+msgstr ""
+
+#: browser.py:783
+msgid "Up Key"
+msgstr ""
+
+#: browser.py:784
+msgid "Down Key"
+msgstr ""
+
+#: browser.py:792
+msgid "PageUp Key"
+msgstr ""
+
+#: browser.py:793
+msgid "PageDown Key"
+msgstr ""
+
+#: browser.py:794
+msgid "Go to previous page."
+msgstr ""
+
+#: browser.py:795
+msgid "Go to next page."
+msgstr ""
+
+#: browser.py:889
+msgid "File"
+msgstr ""
+
+#: browser.py:890
+msgid "Tools"
+msgstr ""
+
+#: browser.py:891 browser.py:912 browser.py:923 youtube.py:44
+msgid "Help"
+msgstr ""
+
+#: browser.py:896 browser.py:1065
+msgid "Vuplus Web Browser Plugin v1.0"
+msgstr ""
+
+#: browser.py:897 browser.py:997
+msgid "BrowserMain"
+msgstr ""
+
+#: browser.py:910 browser.py:915
+msgid "Open Startpage"
+msgstr ""
+
+#: browser.py:910 browser.py:916
+msgid "Open URL"
+msgstr ""
+
+#: browser.py:910 browser.py:917
+msgid "Start/Stop"
+msgstr ""
+
+#: browser.py:911 browser.py:921
+msgid "Position Setup"
+msgstr ""
+
+#: browser.py:912 browser.py:922
+msgid "About"
+msgstr ""
+
+#: browser.py:924 browser.py:1082
+msgid "Return"
+msgstr ""
+
+#: browser.py:1010 browser.py:1018 browser.py:1033
+msgid ""
+"Vuplus Browser was not running.\n"
+"Please running browser using [File]>[Start/Stop] menu."
+msgstr ""
+
+#: hbbtv.py:50
+msgid "HbbTV Plugin"
+msgstr ""
+
+#: plugin.py:189
+msgid ""
+"HbbTV Browser was not running.\n"
+"Please running browser before start HbbTV Application."
+msgstr ""
+
+#: plugin.py:218
+msgid "Stop"
+msgstr ""
+
+#: plugin.py:220 youtube.py:43
+msgid "Start"
+msgstr ""
+
+#: plugin.py:221
+msgid "Please choose one."
+msgstr ""
+
+#: plugin.py:244
+msgid "No detected HbbTV applications."
+msgstr ""
+
+#: plugin.py:245
+msgid "Please choose an HbbTV application."
+msgstr ""
+
+#: plugin.py:344 plugin.py:365
+msgid "YouTube TV"
+msgstr ""
+
+#: plugin.py:366 youtube.py:140
+msgid "YouTube TV Settings"
+msgstr ""
+
+#: plugin.py:367
+msgid "Browser Start/Stop"
+msgstr ""
+
+#: plugin.py:368
+msgid "HbbTV Applications"
+msgstr ""
+
+#: plugin.py:369
+msgid "Vuplus Web Browser"
+msgstr ""
+
+#: plugin.py:369
+msgid "start vuplus web browser"
+msgstr ""
+
+#: youtube.py:53
+msgid "Start YouTube TV"
+msgstr ""
+
+#: youtube.py:54
+msgid "YouTube TV is a new way to watch YouTube videos on Vu+"
+msgstr ""
+
+#: youtube.py:55
+msgid "* Start YouTube TV"
+msgstr ""
+
+#: youtube.py:56
+msgid "* RC Help"
+msgstr ""
+
+#: youtube.py:61
+msgid "Play ther selected the video"
+msgstr ""
+
+#: youtube.py:62
+msgid "Exit the YouTube TV"
+msgstr ""
+
+#: youtube.py:65
+msgid "Move up"
+msgstr ""
+
+#: youtube.py:66
+msgid "Move down"
+msgstr ""
+
+#: youtube.py:67
+msgid "Move left"
+msgstr ""
+
+#: youtube.py:68
+msgid "Move right"
+msgstr ""
+
+#: youtube.py:71
+msgid "Search a video"
+msgstr ""
+
+#: youtube.py:72
+msgid "Skip forward 10 sec"
+msgstr ""
+
+#: youtube.py:73
+msgid "Skip backward 10 sec"
+msgstr ""
+
+#: youtube.py:76
+msgid "Play current video"
+msgstr ""
+
+#: youtube.py:77
+msgid "Pause current video"
+msgstr ""
+
+#: youtube.py:78
+msgid "Stop current video"
+msgstr ""
+
+#: youtube.py:81
+msgid "Back"
+msgstr ""
+
+#: youtube.py:165
+msgid "YouTube TV URL"
+msgstr ""
+
+#: youtube.py:166
+msgid "Do not show YouTube TV Starter again"
+msgstr ""
+
diff --git a/lib/python/Plugins/Extensions/Vbrowser/locale/de.po b/lib/python/Plugins/Extensions/Vbrowser/locale/de.po
new file mode 100644 (file)
index 0000000..abb9598
--- /dev/null
@@ -0,0 +1,459 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ORGANIZATION
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vbrowser\n"
+"POT-Creation-Date: 2014-07-01 10:50+KST\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: pygettext.py 1.5\n"
+
+
+#: browser.py:151 browser.py:265 browser.py:404 youtube.py:133
+msgid "Cancel"
+msgstr ""
+
+#: browser.py:152 browser.py:266 browser.py:405 youtube.py:134
+msgid "Save"
+msgstr ""
+
+#: browser.py:153
+msgid " "
+msgstr ""
+
+#: browser.py:173
+msgid "left"
+msgstr ""
+
+#: browser.py:174
+msgid "width"
+msgstr ""
+
+#: browser.py:175
+msgid "top"
+msgstr ""
+
+#: browser.py:176
+msgid "height"
+msgstr ""
+
+#: browser.py:228
+msgid "Really close without saving settings?"
+msgstr ""
+
+#: browser.py:278 browser.py:911 browser.py:920
+msgid "Preference"
+msgstr ""
+
+#: browser.py:291
+msgid ""
+"Invalid URL!!(Empty)\n"
+"Please, Input to the URL."
+msgstr ""
+
+#: browser.py:312 browser.py:1036
+msgid "Please enter URL here"
+msgstr ""
+
+#: browser.py:334
+msgid "Start Page"
+msgstr ""
+
+#: browser.py:336
+msgid "Current Page"
+msgstr ""
+
+#: browser.py:337
+msgid "Direct Input"
+msgstr ""
+
+#: browser.py:339
+msgid "Startpage"
+msgstr ""
+
+#: browser.py:354
+msgid "Keyboard Layout"
+msgstr ""
+
+#: browser.py:419 browser.py:574 browser.py:911 browser.py:919
+msgid "Bookmark"
+msgstr ""
+
+#: browser.py:424 browser.py:510
+msgid "Name"
+msgstr ""
+
+#: browser.py:427 browser.py:517
+msgid "Title"
+msgstr ""
+
+#: browser.py:429 browser.py:518
+msgid "Url"
+msgstr ""
+
+#: browser.py:433
+msgid ""
+"!!(Empty)\n"
+"Please, Input to the"
+msgstr ""
+
+#: browser.py:433
+msgid "Invalid "
+msgstr ""
+
+#: browser.py:457 browser.py:468 browser.py:563 browser.py:651 browser.py:654
+msgid "Add"
+msgstr ""
+
+#: browser.py:460 browser.py:464
+msgid "Category Name"
+msgstr ""
+
+#: browser.py:473 browser.py:481
+msgid "Bookmark Title"
+msgstr ""
+
+#: browser.py:476 browser.py:484
+msgid "Bookmark URL"
+msgstr ""
+
+#: browser.py:562 browser.py:721 browser.py:910 browser.py:918
+msgid "Exit"
+msgstr ""
+
+#: browser.py:564 browser.py:663 browser.py:664
+msgid "Edit"
+msgstr ""
+
+#: browser.py:565
+msgid "Delete"
+msgstr ""
+
+#: browser.py:566
+msgid "Set as Startpage"
+msgstr ""
+
+#: browser.py:620
+msgid "Invalid URL. Please check again!!"
+msgstr ""
+
+#: browser.py:628
+msgid "Do you want to set selected url to the Startpage?"
+msgstr ""
+
+#: browser.py:643
+msgid "Current page is already exist."
+msgstr ""
+
+#: browser.py:656 browser.py:657
+msgid "Direct Input(Bookmark)"
+msgstr ""
+
+#: browser.py:656 browser.py:657
+msgid "Direct Input(Category)"
+msgstr ""
+
+#: browser.py:657
+msgid "Currentpage(Bookmark)"
+msgstr ""
+
+#: browser.py:658
+msgid "Please choose."
+msgstr ""
+
+#: browser.py:675
+msgid "Do you want to delete the category and the bookmarks?"
+msgstr ""
+
+#: browser.py:676
+msgid "Do you want to delete the bookmark?"
+msgstr ""
+
+#: browser.py:685
+msgid ""
+"Can't open selected bookmark.\n"
+"   - URL data is empty!!"
+msgstr ""
+
+#: browser.py:722
+msgid "Global"
+msgstr ""
+
+#: browser.py:723
+msgid "Mouse"
+msgstr ""
+
+#: browser.py:724
+msgid "Keyboard"
+msgstr ""
+
+#: browser.py:742
+msgid "Browser Help"
+msgstr ""
+
+#: browser.py:752
+msgid "Exit the Browser."
+msgstr ""
+
+#: browser.py:755
+msgid "Show the Menu window."
+msgstr ""
+
+#: browser.py:758 browser.py:789
+msgid "Enter Key"
+msgstr ""
+
+#: browser.py:759
+msgid "Show the Virtual keyboard window."
+msgstr ""
+
+#: browser.py:760
+msgid "Backspace Key"
+msgstr ""
+
+#: browser.py:763
+msgid "Switch to keyboard/mouse mode."
+msgstr ""
+
+#: browser.py:768
+msgid "It will move the mouse pointer up."
+msgstr ""
+
+#: browser.py:769
+msgid "It will move the mouse pointer down."
+msgstr ""
+
+#: browser.py:770
+msgid "It will move the mouse pointer left."
+msgstr ""
+
+#: browser.py:771
+msgid "It will move the mouse pointer right."
+msgstr ""
+
+#: browser.py:774
+msgid "Left Mouse Button"
+msgstr ""
+
+#: browser.py:777
+msgid "Right Mouse Button"
+msgstr ""
+
+#: browser.py:778 browser.py:785
+msgid "Left Key"
+msgstr ""
+
+#: browser.py:779 browser.py:786
+msgid "Right Key"
+msgstr ""
+
+#: browser.py:783
+msgid "Up Key"
+msgstr ""
+
+#: browser.py:784
+msgid "Down Key"
+msgstr ""
+
+#: browser.py:792
+msgid "PageUp Key"
+msgstr ""
+
+#: browser.py:793
+msgid "PageDown Key"
+msgstr ""
+
+#: browser.py:794
+msgid "Go to previous page."
+msgstr ""
+
+#: browser.py:795
+msgid "Go to next page."
+msgstr ""
+
+#: browser.py:889
+msgid "File"
+msgstr ""
+
+#: browser.py:890
+msgid "Tools"
+msgstr ""
+
+#: browser.py:891 browser.py:912 browser.py:923 youtube.py:44
+msgid "Help"
+msgstr ""
+
+#: browser.py:896 browser.py:1065
+msgid "Vuplus Web Browser Plugin v1.0"
+msgstr ""
+
+#: browser.py:897 browser.py:997
+msgid "BrowserMain"
+msgstr ""
+
+#: browser.py:910 browser.py:915
+msgid "Open Startpage"
+msgstr ""
+
+#: browser.py:910 browser.py:916
+msgid "Open URL"
+msgstr ""
+
+#: browser.py:910 browser.py:917
+msgid "Start/Stop"
+msgstr ""
+
+#: browser.py:911 browser.py:921
+msgid "Position Setup"
+msgstr ""
+
+#: browser.py:912 browser.py:922
+msgid "About"
+msgstr ""
+
+#: browser.py:924 browser.py:1082
+msgid "Return"
+msgstr ""
+
+#: browser.py:1010 browser.py:1018 browser.py:1033
+msgid ""
+"Vuplus Browser was not running.\n"
+"Please running browser using [File]>[Start/Stop] menu."
+msgstr ""
+
+#: hbbtv.py:50
+msgid "HbbTV Plugin"
+msgstr ""
+
+#: plugin.py:189
+msgid ""
+"HbbTV Browser was not running.\n"
+"Please running browser before start HbbTV Application."
+msgstr ""
+
+#: plugin.py:218
+msgid "Stop"
+msgstr ""
+
+#: plugin.py:220 youtube.py:43
+msgid "Start"
+msgstr ""
+
+#: plugin.py:221
+msgid "Please choose one."
+msgstr ""
+
+#: plugin.py:244
+msgid "No detected HbbTV applications."
+msgstr ""
+
+#: plugin.py:245
+msgid "Please choose an HbbTV application."
+msgstr ""
+
+#: plugin.py:344 plugin.py:365
+msgid "YouTube TV"
+msgstr ""
+
+#: plugin.py:366 youtube.py:140
+msgid "YouTube TV Settings"
+msgstr ""
+
+#: plugin.py:367
+msgid "Browser Start/Stop"
+msgstr ""
+
+#: plugin.py:368
+msgid "HbbTV Applications"
+msgstr ""
+
+#: plugin.py:369
+msgid "Vuplus Web Browser"
+msgstr ""
+
+#: plugin.py:369
+msgid "start vuplus web browser"
+msgstr ""
+
+#: youtube.py:53
+msgid "Start YouTube TV"
+msgstr ""
+
+#: youtube.py:54
+msgid "YouTube TV is a new way to watch YouTube videos on Vu+"
+msgstr ""
+
+#: youtube.py:55
+msgid "* Start YouTube TV"
+msgstr ""
+
+#: youtube.py:56
+msgid "* RC Help"
+msgstr ""
+
+#: youtube.py:61
+msgid "Play ther selected the video"
+msgstr ""
+
+#: youtube.py:62
+msgid "Exit the YouTube TV"
+msgstr ""
+
+#: youtube.py:65
+msgid "Move up"
+msgstr ""
+
+#: youtube.py:66
+msgid "Move down"
+msgstr ""
+
+#: youtube.py:67
+msgid "Move left"
+msgstr ""
+
+#: youtube.py:68
+msgid "Move right"
+msgstr ""
+
+#: youtube.py:71
+msgid "Search a video"
+msgstr ""
+
+#: youtube.py:72
+msgid "Skip forward 10 sec"
+msgstr ""
+
+#: youtube.py:73
+msgid "Skip backward 10 sec"
+msgstr ""
+
+#: youtube.py:76
+msgid "Play current video"
+msgstr ""
+
+#: youtube.py:77
+msgid "Pause current video"
+msgstr ""
+
+#: youtube.py:78
+msgid "Stop current video"
+msgstr ""
+
+#: youtube.py:81
+msgid "Back"
+msgstr ""
+
+#: youtube.py:165
+msgid "YouTube TV URL"
+msgstr ""
+
+#: youtube.py:166
+msgid "Do not show YouTube TV Starter again"
+msgstr ""
+
diff --git a/lib/python/Plugins/Extensions/Vbrowser/locale/en.po b/lib/python/Plugins/Extensions/Vbrowser/locale/en.po
new file mode 100644 (file)
index 0000000..abb9598
--- /dev/null
@@ -0,0 +1,459 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR ORGANIZATION
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Vbrowser\n"
+"POT-Creation-Date: 2014-07-01 10:50+KST\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: pygettext.py 1.5\n"
+
+
+#: browser.py:151 browser.py:265 browser.py:404 youtube.py:133
+msgid "Cancel"
+msgstr ""
+
+#: browser.py:152 browser.py:266 browser.py:405 youtube.py:134
+msgid "Save"
+msgstr ""
+
+#: browser.py:153
+msgid " "
+msgstr ""
+
+#: browser.py:173
+msgid "left"
+msgstr ""
+
+#: browser.py:174
+msgid "width"
+msgstr ""
+
+#: browser.py:175
+msgid "top"
+msgstr ""
+
+#: browser.py:176
+msgid "height"
+msgstr ""
+
+#: browser.py:228
+msgid "Really close without saving settings?"
+msgstr ""
+
+#: browser.py:278 browser.py:911 browser.py:920
+msgid "Preference"
+msgstr ""
+
+#: browser.py:291
+msgid ""
+"Invalid URL!!(Empty)\n"
+"Please, Input to the URL."
+msgstr ""
+
+#: browser.py:312 browser.py:1036
+msgid "Please enter URL here"
+msgstr ""
+
+#: browser.py:334
+msgid "Start Page"
+msgstr ""
+
+#: browser.py:336
+msgid "Current Page"
+msgstr ""
+
+#: browser.py:337
+msgid "Direct Input"
+msgstr ""
+
+#: browser.py:339
+msgid "Startpage"
+msgstr ""
+
+#: browser.py:354
+msgid "Keyboard Layout"
+msgstr ""
+
+#: browser.py:419 browser.py:574 browser.py:911 browser.py:919
+msgid "Bookmark"
+msgstr ""
+
+#: browser.py:424 browser.py:510
+msgid "Name"
+msgstr ""
+
+#: browser.py:427 browser.py:517
+msgid "Title"
+msgstr ""
+
+#: browser.py:429 browser.py:518
+msgid "Url"
+msgstr ""
+
+#: browser.py:433
+msgid ""
+"!!(Empty)\n"
+"Please, Input to the"
+msgstr ""
+
+#: browser.py:433
+msgid "Invalid "
+msgstr ""
+
+#: browser.py:457 browser.py:468 browser.py:563 browser.py:651 browser.py:654
+msgid "Add"
+msgstr ""
+
+#: browser.py:460 browser.py:464
+msgid "Category Name"
+msgstr ""
+
+#: browser.py:473 browser.py:481
+msgid "Bookmark Title"
+msgstr ""
+
+#: browser.py:476 browser.py:484
+msgid "Bookmark URL"
+msgstr ""
+
+#: browser.py:562 browser.py:721 browser.py:910 browser.py:918
+msgid "Exit"
+msgstr ""
+
+#: browser.py:564 browser.py:663 browser.py:664
+msgid "Edit"
+msgstr ""
+
+#: browser.py:565
+msgid "Delete"
+msgstr ""
+
+#: browser.py:566
+msgid "Set as Startpage"
+msgstr ""
+
+#: browser.py:620
+msgid "Invalid URL. Please check again!!"
+msgstr ""
+
+#: browser.py:628
+msgid "Do you want to set selected url to the Startpage?"
+msgstr ""
+
+#: browser.py:643
+msgid "Current page is already exist."
+msgstr ""
+
+#: browser.py:656 browser.py:657
+msgid "Direct Input(Bookmark)"
+msgstr ""
+
+#: browser.py:656 browser.py:657
+msgid "Direct Input(Category)"
+msgstr ""
+
+#: browser.py:657
+msgid "Currentpage(Bookmark)"
+msgstr ""
+
+#: browser.py:658
+msgid "Please choose."
+msgstr ""
+
+#: browser.py:675
+msgid "Do you want to delete the category and the bookmarks?"
+msgstr ""
+
+#: browser.py:676
+msgid "Do you want to delete the bookmark?"
+msgstr ""
+
+#: browser.py:685
+msgid ""
+"Can't open selected bookmark.\n"
+"   - URL data is empty!!"
+msgstr ""
+
+#: browser.py:722
+msgid "Global"
+msgstr ""
+
+#: browser.py:723
+msgid "Mouse"
+msgstr ""
+
+#: browser.py:724
+msgid "Keyboard"
+msgstr ""
+
+#: browser.py:742
+msgid "Browser Help"
+msgstr ""
+
+#: browser.py:752
+msgid "Exit the Browser."
+msgstr ""
+
+#: browser.py:755
+msgid "Show the Menu window."
+msgstr ""
+
+#: browser.py:758 browser.py:789
+msgid "Enter Key"
+msgstr ""
+
+#: browser.py:759
+msgid "Show the Virtual keyboard window."
+msgstr ""
+
+#: browser.py:760
+msgid "Backspace Key"
+msgstr ""
+
+#: browser.py:763
+msgid "Switch to keyboard/mouse mode."
+msgstr ""
+
+#: browser.py:768
+msgid "It will move the mouse pointer up."
+msgstr ""
+
+#: browser.py:769
+msgid "It will move the mouse pointer down."
+msgstr ""
+
+#: browser.py:770
+msgid "It will move the mouse pointer left."
+msgstr ""
+
+#: browser.py:771
+msgid "It will move the mouse pointer right."
+msgstr ""
+
+#: browser.py:774
+msgid "Left Mouse Button"
+msgstr ""
+
+#: browser.py:777
+msgid "Right Mouse Button"
+msgstr ""
+
+#: browser.py:778 browser.py:785
+msgid "Left Key"
+msgstr ""
+
+#: browser.py:779 browser.py:786
+msgid "Right Key"
+msgstr ""
+
+#: browser.py:783
+msgid "Up Key"
+msgstr ""
+
+#: browser.py:784
+msgid "Down Key"
+msgstr ""
+
+#: browser.py:792
+msgid "PageUp Key"
+msgstr ""
+
+#: browser.py:793
+msgid "PageDown Key"
+msgstr ""
+
+#: browser.py:794
+msgid "Go to previous page."
+msgstr ""
+
+#: browser.py:795
+msgid "Go to next page."
+msgstr ""
+
+#: browser.py:889
+msgid "File"
+msgstr ""
+
+#: browser.py:890
+msgid "Tools"
+msgstr ""
+
+#: browser.py:891 browser.py:912 browser.py:923 youtube.py:44
+msgid "Help"
+msgstr ""
+
+#: browser.py:896 browser.py:1065
+msgid "Vuplus Web Browser Plugin v1.0"
+msgstr ""
+
+#: browser.py:897 browser.py:997
+msgid "BrowserMain"
+msgstr ""
+
+#: browser.py:910 browser.py:915
+msgid "Open Startpage"
+msgstr ""
+
+#: browser.py:910 browser.py:916
+msgid "Open URL"
+msgstr ""
+
+#: browser.py:910 browser.py:917
+msgid "Start/Stop"
+msgstr ""
+
+#: browser.py:911 browser.py:921
+msgid "Position Setup"
+msgstr ""
+
+#: browser.py:912 browser.py:922
+msgid "About"
+msgstr ""
+
+#: browser.py:924 browser.py:1082
+msgid "Return"
+msgstr ""
+
+#: browser.py:1010 browser.py:1018 browser.py:1033
+msgid ""
+"Vuplus Browser was not running.\n"
+"Please running browser using [File]>[Start/Stop] menu."
+msgstr ""
+
+#: hbbtv.py:50
+msgid "HbbTV Plugin"
+msgstr ""
+
+#: plugin.py:189
+msgid ""
+"HbbTV Browser was not running.\n"
+"Please running browser before start HbbTV Application."
+msgstr ""
+
+#: plugin.py:218
+msgid "Stop"
+msgstr ""
+
+#: plugin.py:220 youtube.py:43
+msgid "Start"
+msgstr ""
+
+#: plugin.py:221
+msgid "Please choose one."
+msgstr ""
+
+#: plugin.py:244
+msgid "No detected HbbTV applications."
+msgstr ""
+
+#: plugin.py:245
+msgid "Please choose an HbbTV application."
+msgstr ""
+
+#: plugin.py:344 plugin.py:365
+msgid "YouTube TV"
+msgstr ""
+
+#: plugin.py:366 youtube.py:140
+msgid "YouTube TV Settings"
+msgstr ""
+
+#: plugin.py:367
+msgid "Browser Start/Stop"
+msgstr ""
+
+#: plugin.py:368
+msgid "HbbTV Applications"
+msgstr ""
+
+#: plugin.py:369
+msgid "Vuplus Web Browser"
+msgstr ""
+
+#: plugin.py:369
+msgid "start vuplus web browser"
+msgstr ""
+
+#: youtube.py:53
+msgid "Start YouTube TV"
+msgstr ""
+
+#: youtube.py:54
+msgid "YouTube TV is a new way to watch YouTube videos on Vu+"
+msgstr ""
+
+#: youtube.py:55
+msgid "* Start YouTube TV"
+msgstr ""
+
+#: youtube.py:56
+msgid "* RC Help"
+msgstr ""
+
+#: youtube.py:61
+msgid "Play ther selected the video"
+msgstr ""
+
+#: youtube.py:62
+msgid "Exit the YouTube TV"
+msgstr ""
+
+#: youtube.py:65
+msgid "Move up"
+msgstr ""
+
+#: youtube.py:66
+msgid "Move down"
+msgstr ""
+
+#: youtube.py:67
+msgid "Move left"
+msgstr ""
+
+#: youtube.py:68
+msgid "Move right"
+msgstr ""
+
+#: youtube.py:71
+msgid "Search a video"
+msgstr ""
+
+#: youtube.py:72
+msgid "Skip forward 10 sec"
+msgstr ""
+
+#: youtube.py:73
+msgid "Skip backward 10 sec"
+msgstr ""
+
+#: youtube.py:76
+msgid "Play current video"
+msgstr ""
+
+#: youtube.py:77
+msgid "Pause current video"
+msgstr ""
+
+#: youtube.py:78
+msgid "Stop current video"
+msgstr ""
+
+#: youtube.py:81
+msgid "Back"
+msgstr ""
+
+#: youtube.py:165
+msgid "YouTube TV URL"
+msgstr ""
+
+#: youtube.py:166
+msgid "Do not show YouTube TV Starter again"
+msgstr ""
+
diff --git a/lib/python/Plugins/Extensions/Vbrowser/locale/it.po b/lib/python/Plugins/Extensions/Vbrowser/locale/it.po
new file mode 100644 (file)
index 0000000..132802f
--- /dev/null
@@ -0,0 +1,469 @@
+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"
+
+#: browser.py:151 browser.py:265 browser.py:404 youtube.py:133
+msgid "Cancel"
+msgstr "Annulla"
+
+#: browser.py:152 browser.py:266 browser.py:405 youtube.py:134
+msgid "Save"
+msgstr "Salva"
+
+#: browser.py:153
+msgid " "
+msgstr " "
+
+#: browser.py:173
+msgid "left"
+msgstr ""
+
+#: browser.py:174
+msgid "width"
+msgstr ""
+
+#: browser.py:175
+msgid "top"
+msgstr ""
+
+#: browser.py:176
+msgid "height"
+msgstr ""
+
+#: browser.py:228
+msgid "Really close without saving settings?"
+msgstr ""
+
+#: browser.py:278 browser.py:911 browser.py:920
+msgid "Preference"
+msgstr "Preferenze"
+
+#: browser.py:291
+msgid ""
+"Invalid URL!!(Empty)\n"
+"Please, Input to the URL."
+msgstr ""
+"Indirizzo non valido!!\n"
+"Devi inserire un indirizzo (URL)."
+
+#: browser.py:312 browser.py:1036
+msgid "Please enter URL here"
+msgstr "Inserisci indirizzo (url)."
+
+#: browser.py:334
+msgid "Start Page"
+msgstr "Pagina iniziale"
+
+#: browser.py:336
+msgid "Current Page"
+msgstr "Pagina corrente"
+
+#: browser.py:337
+msgid "Direct Input"
+msgstr "Input diretto"
+
+#: browser.py:339
+msgid "Startpage"
+msgstr "Pagina iniziale"
+
+#: browser.py:354
+msgid "Keyboard Layout"
+msgstr "Layout tastiera."
+
+#: browser.py:419 browser.py:574 browser.py:911 browser.py:919
+msgid "Bookmark"
+msgstr "Preferiti"
+
+#: browser.py:424 browser.py:510
+msgid "Name"
+msgstr "Nome"
+
+#: browser.py:427 browser.py:517
+msgid "Title"
+msgstr "Titolo"
+
+#: browser.py:429 browser.py:518
+msgid "Url"
+msgstr "Url"
+
+#: browser.py:433
+msgid ""
+"!!(Empty)\n"
+"Please, Input to the"
+msgstr ""
+"!!(Vuoto)\n"
+"Inserisici in"
+
+#: browser.py:433
+msgid "Invalid "
+msgstr "Non valido"
+
+#: browser.py:457 browser.py:468 browser.py:563 browser.py:651 browser.py:654
+msgid "Add"
+msgstr "Aggiungi"
+
+#: browser.py:460 browser.py:464
+msgid "Category Name"
+msgstr "Nome Categoria"
+
+#: browser.py:473 browser.py:481
+msgid "Bookmark Title"
+msgstr "Titolo bookmark"
+
+#: browser.py:476 browser.py:484
+msgid "Bookmark URL"
+msgstr "Indirizzo Bookmark"
+
+#: browser.py:562 browser.py:721 browser.py:910 browser.py:918
+msgid "Exit"
+msgstr "Esci"
+
+#: browser.py:564 browser.py:663 browser.py:664
+msgid "Edit"
+msgstr "Modifica"
+
+#: browser.py:565
+msgid "Delete"
+msgstr "Cancella"
+
+#: browser.py:566
+msgid "Set as Startpage"
+msgstr "Configura come Home page"
+
+#: browser.py:620
+msgid "Invalid URL. Please check again!!"
+msgstr "Indirizzo non valido, riprova."
+
+#: browser.py:628
+msgid "Do you want to set selected url to the Startpage?"
+msgstr "Vuoi Configurare l'indirizzo selezionato come pagina iniziale?"
+
+#: browser.py:643
+msgid "Current page is already exist."
+msgstr "La pagina corrente è già esistente."
+
+#: browser.py:656 browser.py:657
+msgid "Direct Input(Bookmark)"
+msgstr "Inserimento diretto(Bookmark)"
+
+#: browser.py:656 browser.py:657
+msgid "Direct Input(Category)"
+msgstr "Inserimento diretto(Categoria)"
+
+#: browser.py:657
+msgid "Currentpage(Bookmark)"
+msgstr "Pagina corrente(Bookmark)"
+
+#: browser.py:658
+msgid "Please choose."
+msgstr "Scegli."
+
+#: browser.py:675
+msgid "Do you want to delete the category and the bookmarks?"
+msgstr "Vuoi davvero cancellare la categoria e i suoi preferiti ?"
+
+#: browser.py:676
+msgid "Do you want to delete the bookmark?"
+msgstr "Vuoi davvero cancellare il Bookmark ?"
+
+#: browser.py:685
+msgid ""
+"Can't open selected bookmark.\n"
+"   - URL data is empty!!"
+msgstr ""
+"Impossibile apreire il Bookmark selezionato.\n"
+"   - l'indirizzo URL è mancante!!"
+
+#: browser.py:722
+msgid "Global"
+msgstr "Globale"
+
+#: browser.py:723
+msgid "Mouse"
+msgstr "Mouse"
+
+#: browser.py:724
+msgid "Keyboard"
+msgstr "Tastiera"
+
+#: browser.py:742
+msgid "Browser Help"
+msgstr "Aiuto Browser"
+
+#: browser.py:752
+msgid "Exit the Browser."
+msgstr "Esci da Browser"
+
+#: browser.py:755
+msgid "Show the Menu window."
+msgstr "Mostra i Menu."
+
+#: browser.py:758 browser.py:789
+msgid "Enter Key"
+msgstr "Tasto Invio"
+
+#: browser.py:759
+msgid "Show the Virtual keyboard window."
+msgstr "Mostra la tastiera virtuale."
+
+#: browser.py:760
+msgid "Backspace Key"
+msgstr "Tasto Backsapce"
+
+#: browser.py:763
+msgid "Switch to keyboard/mouse mode."
+msgstr "Usa modalità tastiera/mouse."
+
+#: browser.py:768
+msgid "It will move the mouse pointer up."
+msgstr "Muove il puntatore del mouse verso l'alto."
+
+#: browser.py:769
+msgid "It will move the mouse pointer down."
+msgstr "Muove il puntatore del mouse verso il basso."
+
+#: browser.py:770
+msgid "It will move the mouse pointer left."
+msgstr "Muove il puntatore del mouse a sinistra."
+
+#: browser.py:771
+msgid "It will move the mouse pointer right."
+msgstr "Muove il puntatore del mouse a destra."
+
+#: browser.py:774
+msgid "Left Mouse Button"
+msgstr "Bottone sinistro mouse"
+
+#: browser.py:777
+msgid "Right Mouse Button"
+msgstr "Bottone destro mouse"
+
+#: browser.py:778 browser.py:785
+msgid "Left Key"
+msgstr "Tasto freccia sinistra"
+
+#: browser.py:779 browser.py:786
+msgid "Right Key"
+msgstr "Tasto freccia destra"
+
+#: browser.py:783
+msgid "Up Key"
+msgstr "Tasto freccia alto"
+
+#: browser.py:784
+msgid "Down Key"
+msgstr "Tasto freccia basso"
+
+#: browser.py:792
+msgid "PageUp Key"
+msgstr "Tasto pagina precedente"
+
+#: browser.py:793
+msgid "PageDown Key"
+msgstr "Tasto pagina successiva"
+
+#: browser.py:794
+msgid "Go to previous page."
+msgstr "Vai alla pagina precedente."
+
+#: browser.py:795
+msgid "Go to next page."
+msgstr "Vai alla pagina successiva."
+
+#: browser.py:889
+msgid "File"
+msgstr "File"
+
+#: browser.py:890
+msgid "Tools"
+msgstr "Strumenti"
+
+#: browser.py:891 browser.py:912 browser.py:923 youtube.py:44
+msgid "Help"
+msgstr "Aiuto"
+
+#: browser.py:896 browser.py:1065
+msgid "Vuplus Web Browser Plugin v1.0"
+msgstr "Plugin Vuplus Web Browser v1.0"
+
+#: browser.py:897 browser.py:997
+msgid "BrowserMain"
+msgstr "Browser"
+
+#: browser.py:910 browser.py:915
+msgid "Open Startpage"
+msgstr "Apri pagina iniziale"
+
+#: browser.py:910 browser.py:916
+msgid "Open URL"
+msgstr "Apri Url"
+
+#: browser.py:910 browser.py:917
+msgid "Start/Stop"
+msgstr "Avvia/Chiudi"
+
+#: browser.py:911 browser.py:921
+msgid "Position Setup"
+msgstr ""
+
+#: browser.py:912 browser.py:922
+msgid "About"
+msgstr "Informazioni"
+
+#: browser.py:924 browser.py:1082
+msgid "Return"
+msgstr "Indietro"
+
+#: browser.py:1010 browser.py:1018 browser.py:1033
+msgid ""
+"Vuplus 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]."
+
+#: hbbtv.py:50
+msgid "HbbTV Plugin"
+msgstr "Plugin HbbTV"
+
+#: plugin.py:189
+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:218
+msgid "Stop"
+msgstr "Chiudi"
+
+#: plugin.py:220 youtube.py:43
+msgid "Start"
+msgstr "Avvia"
+
+#: plugin.py:221
+msgid "Please choose one."
+msgstr "Seleziona"
+
+#: plugin.py:244
+msgid "No detected HbbTV applications."
+msgstr "Nessuna applicazione HbbTV trovata."
+
+#: plugin.py:245
+msgid "Please choose an HbbTV application."
+msgstr "Seleziona un'applicazione HbbTV."
+
+#: plugin.py:344 plugin.py:365
+msgid "YouTube TV"
+msgstr ""
+
+#: plugin.py:366 youtube.py:140
+msgid "YouTube TV Settings"
+msgstr ""
+
+#: plugin.py:367
+msgid "Browser Start/Stop"
+msgstr "Avvia/Chiudi browser"
+
+#: plugin.py:368
+msgid "HbbTV Applications"
+msgstr "Applicazioni HbbTV"
+
+#: plugin.py:369
+msgid "Vuplus Web Browser"
+msgstr "Web Browser Vuplus"
+
+#: plugin.py:369
+msgid "start vuplus web browser"
+msgstr "avvia il browser vuplus"
+
+#: youtube.py:53
+msgid "Start YouTube TV"
+msgstr ""
+
+#: youtube.py:54
+msgid "YouTube TV is a new way to watch YouTube videos on Vu+"
+msgstr ""
+
+#: youtube.py:55
+msgid "* Start YouTube TV"
+msgstr ""
+
+#: youtube.py:56
+msgid "* RC Help"
+msgstr ""
+
+#: youtube.py:61
+msgid "Play ther selected the video"
+msgstr ""
+
+#: youtube.py:62
+msgid "Exit the YouTube TV"
+msgstr ""
+
+#: youtube.py:65
+msgid "Move up"
+msgstr ""
+
+#: youtube.py:66
+msgid "Move down"
+msgstr ""
+
+#: youtube.py:67
+msgid "Move left"
+msgstr ""
+
+#: youtube.py:68
+msgid "Move right"
+msgstr ""
+
+#: youtube.py:71
+msgid "Search a video"
+msgstr ""
+
+#: youtube.py:72
+msgid "Skip forward 10 sec"
+msgstr ""
+
+#: youtube.py:73
+msgid "Skip backward 10 sec"
+msgstr ""
+
+#: youtube.py:76
+msgid "Play current video"
+msgstr ""
+
+#: youtube.py:77
+msgid "Pause current video"
+msgstr ""
+
+#: youtube.py:78
+msgid "Stop current video"
+msgstr ""
+
+#: youtube.py:81
+msgid "Back"
+msgstr ""
+
+#: youtube.py:165
+msgid "YouTube TV URL"
+msgstr ""
+
+#: youtube.py:166
+msgid "Do not show YouTube TV Starter again"
+msgstr ""
+
diff --git a/lib/python/Plugins/Extensions/Vbrowser/meta/Makefile.am b/lib/python/Plugins/Extensions/Vbrowser/meta/Makefile.am
new file mode 100644 (file)
index 0000000..7485330
--- /dev/null
@@ -0,0 +1,3 @@
+installdir = $(datadir)/meta
+
+dist_install_DATA = plugin_vbrowser.xml
diff --git a/lib/python/Plugins/Extensions/Vbrowser/meta/plugin_vbrowser.xml b/lib/python/Plugins/Extensions/Vbrowser/meta/plugin_vbrowser.xml
new file mode 100644 (file)
index 0000000..8775b0c
--- /dev/null
@@ -0,0 +1,16 @@
+<default>
+       <prerequisites>
+               <tag type="Network" />
+       </prerequisites>
+       <info>
+               <author>smlee</author>
+               <name>Vbrowser</name>
+               <packagename>enigma2-plugin-extensions-vbrowser</packagename>
+               <shortdescription>this is hbbtv plugin</shortdescription>
+               <description>this is hbbtv plugin</description>
+       </info>
+       <files type="package"> <!-- without version, without .ipk -->
+               <file type="package" name="enigma2-plugin-extensions-vbrowser" />
+               <file type="package" name="vbrowser" />
+       </files>
+</default>
diff --git a/lib/python/Plugins/Extensions/Vbrowser/plugin.py b/lib/python/Plugins/Extensions/Vbrowser/plugin.py
new file mode 100644 (file)
index 0000000..c1cd05b
--- /dev/null
@@ -0,0 +1,396 @@
+from Plugins.Plugin import PluginDescriptor
+from Screens.Screen import Screen
+from Screens.InfoBar import InfoBar
+from Screens.ChoiceBox import ChoiceBox
+from Screens.HelpMenu import HelpableScreen
+from Screens.MessageBox import MessageBox
+from Screens.VirtualKeyBoard import VirtualKeyBoard
+from Components.config import config
+from Components.ActionMap import ActionMap
+from Components.Language import language
+from Components.ServiceEventTracker import ServiceEventTracker
+
+from enigma import eTimer, fbClass, eRCInput, iServiceInformation, iPlayableService
+
+import os, struct, vbcfg
+
+from __init__ import _
+from hbbtv import HbbTVWindow
+from browser import Browser
+from youtube import YoutubeTVWindow, YoutubeTVSettings
+from vbipc import VBController, VBServerThread, VBHandlers
+
+strIsEmpty = lambda x: x is None or len(x) == 0
+
+vbcfg.SOCKETFILE = '/tmp/vbrowser.support'
+vbcfg.CONTROLFILE = '/tmp/vbrowser.controller'
+_OPCODE_LIST = [
+               'CONTROL_BACK',
+               'CONTROL_FORWARD',
+               'CONTROL_STOP',
+               'CONTROL_RELOAD',
+               'CONTROL_OPENURL',
+               'CONTROL_EXIT',
+               'CONTROL_TITLE',
+               'CONTROL_OK',
+               'CONTROL_OUT_OF_MEMORY',
+               'HBBTV_LOADAIT',
+               'HBBTV_OPENURL',
+               'YOUTUBETV_OPENURL',
+               'BROWSER_OPENURL',
+               'BROWSER_MENU_OPEN',
+               'BROWSER_MENU_CLOSE',
+               'BROWSER_VKB_OPEN',
+               'BROWSER_VKB_CLOSE',
+               'OOIF_GET_CURRENT_CHANNEL',
+               'OOIF_GET_VOLUME',
+               'OOIF_BROADCAST_PLAY',
+               'OOIF_BROADCAST_STOP',
+               'OOIF_BROADCAST_CHECK',
+               'OPCODE_END'
+               ]
+
+class VBHandler(VBHandlers):
+       def __init__(self, session):
+               self._session = session
+               self.current_title = None
+               self.videobackend_activate = False
+               self.onSetTitleCB = []
+               self.onCloseCB = []
+               VBHandlers.__init__(self, _OPCODE_LIST, '_CB_')
+
+       def close_vkb(self, data=""):
+               fbClass.getInstance().lock()
+               eRCInput.getInstance().lock()
+
+               if strIsEmpty(data):
+                       data = ""
+               VBController.command("BROWSER_VKB_CLOSE", data)
+
+       def _CB_CONTROL_EXIT(self, result, packet):
+               if self.onCloseCB:
+                       for x in self.onCloseCB:
+                               try:
+                                       x()
+                               except Exception:
+                                       if x in self.onCloseCB:
+                                               self.onCloseCB.remove(x)
+               if self.videobackend_activate is False:
+                       if vbcfg.g_service is not None:
+                               self._session.nav.playService(vbcfg.g_service)
+               return (True, None)
+
+       def _CB_CONTROL_TITLE(self, result, packet):
+               if packet.startswith('file://') or packet.startswith('http://'):
+                       return (True, None)
+               for x in self.onSetTitleCB:
+                       try:
+                               x(packet)
+                               self.current_title = packet
+                       except Exception:
+                               if x in self.onSetTitleCB:
+                                       self.onSetTitleCB.remove(x)
+               return (True, None)
+
+       def _CB_CONTROL_OK(self, result, packet):
+               if vbcfg.g_browser and packet.startswith('stop'):
+                       vbcfg.g_browser.keyOK()
+               return (True, None)
+
+       def _CB_CONTROL_OUT_OF_MEMORY(self, result, packet):
+               vbcfg.need_restart = True;
+               return (True, None)
+
+       def _CB_BROWSER_MENU_OPEN(self, result, packet):
+               if vbcfg.g_browser and vbcfg.g_browser.is_browser_opened:
+                       vbcfg.setPosition(vbcfg.g_position)
+                       fbClass.getInstance().unlock()
+                       eRCInput.getInstance().unlock()
+
+                       vbcfg.g_browser.toggle_browser(packet, self.current_title)
+               return (True, None)
+
+       def _CB_BROWSER_VKB_OPEN(self, result, packet):
+               if vbcfg.g_browser and vbcfg.g_browser.is_browser_opened:
+                       vbcfg.setPosition(vbcfg.g_position)
+                       fbClass.getInstance().unlock()
+                       eRCInput.getInstance().unlock()
+
+                       if strIsEmpty(packet):
+                               packet = ""
+                       self._session.openWithCallback(self.close_vkb, VirtualKeyBoard, title=("Please enter URL here"), text=str(packet))
+               return (True, None)
+
+       def _CB_OOIF_GET_CURRENT_CHANNEL(self, result, packet):
+               if (vbcfg.g_channel_info):
+                       try:
+                               data = struct.pack('iiii', vbcfg.g_channel_info[1], vbcfg.g_channel_info[2], vbcfg.g_channel_info[0], len(vbcfg.g_channel_info[3])) + vbcfg.g_channel_info[3]
+                       except Exception, err:
+                               vbcfg.ERR(err)
+                               return (False, None)
+               else:
+                       return (False, None)
+               return (True, data)
+
+       def _CB_OOIF_BROADCAST_PLAY(self, result, packet):
+               if vbcfg.g_service is not None:
+                       self._session.nav.playService(vbcfg.g_service)
+               self.videobackend_activate = False
+               return (True, None)
+
+       def _CB_OOIF_BROADCAST_STOP(self, result, packet):
+               vbcfg.g_service = self._session.nav.getCurrentlyPlayingServiceReference()
+               self._session.nav.stopService()
+               self.videobackend_activate = True
+               return (True, None)
+
+       def _CB_OOIF_BROADCAST_CHECK(self, result, packet):
+               if self._session.nav.getCurrentService() is None:
+                       return (False, None)
+               return (True, None)
+
+class VBMain(Screen):
+       skin = """<screen name="VBMAIN" position="0,0" size="0,0" backgroundColor="transparent" flags="wfNoBorder" title=" "></screen>"""
+       def __init__(self, session):
+               Screen.__init__(self, session)
+
+               self.vbcallback = None
+               self.vbhandler = VBHandler(session)
+               self.vbserver = VBServerThread()
+               self.vbserver.open(1)
+               self.vbserver.start()
+
+               # comment for dev
+               self.restart_vbrowser()
+               vbcfg.LOG("vbrowser start")
+
+               self._timer_infobar = eTimer()
+               self._timer_infobar.callback.append(self._cb_register_infobar)
+               self._timer_infobar.start(1000)
+
+               self._event = ServiceEventTracker(screen=self, eventmap={
+                               iPlayableService.evHBBTVInfo: self._cb_ait_detected,
+                               iPlayableService.evUpdatedInfo: self._cb_info_updated
+                       })
+               self._applicationList = None
+               self._app_info = None
+
+               try:
+                       from Screens.InfoBarGenerics import gHbbtvApplication
+                       self.m_vuplus = gHbbtvApplication.getUseAit()
+               except:
+                       self.m_vuplus = False
+
+       def _cb_register_infobar(self):
+               if InfoBar.instance:
+                       self._timer_infobar.stop()
+                       if self._cb_hbbtv_activated not in InfoBar.instance.onHBBTVActivation:
+                               InfoBar.instance.onHBBTVActivation.append(self._cb_hbbtv_activated)
+               vbcfg.DEBUG("registred HbbTV in InfoBar")
+
+       def _cb_hbbtv_activated(self, url=None, app_info=None):
+               if not self.check_vbrowser():
+                       message = _("HbbTV Browser was not running.\nPlease running browser before start HbbTV Application.")
+                       self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+                       return
+               self.start_hbbtv_application(url, app_info)
+
+       def _cb_ait_detected(self):
+               vbcfg.g_channel_info = None
+               self._applicationList = None
+               self._app_info = self.get_autostart_application()
+               vbcfg.DEBUG("detected AIT")
+
+       def _cb_info_updated(self):
+               vbcfg.g_service = self.session.nav.getCurrentlyPlayingServiceReference()
+               vbcfg.DEBUG("updated channel info")
+
+       def start_hbbtv_application(self, url, app_info):
+               if vbcfg.need_restart:
+                       self.restart_vbrowser()
+                       os.time.sleep(2)
+                       vbcfg.need_restart = False
+
+               if not app_info:
+                       app_info = self._app_info
+               self.session.open(HbbTVWindow, url, app_info)
+
+       def menu_toggle_vbrowser(self, callback=None):
+               mode = []
+               self.vbcallback = callback
+               if self.check_vbrowser():
+                       mode.append((_('Stop'), 'Stop'))
+               else:
+                       mode.append((_('Start'), 'Start'))
+               self.session.openWithCallback(self.toggle_vbrowser, ChoiceBox, title=_("Please choose one."), list=mode)
+
+       def toggle_vbrowser(self, selected):
+               if selected is not None:
+                       if self.vbcallback:
+                               self.vbcallback()
+                       try:
+                               mode = selected[1]
+                               if mode == 'Start':
+                                       if not self.check_vbrowser():
+                                               self.start_vbrowser()
+                               elif mode == 'Stop':
+                                       self.stop_vbrowser()
+
+                       except Exception, ErrMsg:
+                               vbcfg.ERR("toggle vbrowser: %s" % ErrMsg)
+
+       def menu_hbbtv_applications(self):
+               applications = []
+               if self._applicationList is not None:
+                       for x in self._applicationList:
+                               applications.append((x["name"], x))
+               else:
+                       applications.append((_("No detected HbbTV applications."), None))
+               self.session.openWithCallback(self.start_application_selected, ChoiceBox, title=_("Please choose an HbbTV application."), list=applications)
+
+       def start_application_selected(self, selected):
+               vbcfg.DEBUG(selected)
+               try:
+                       if selected[1] is not None:
+                               self._cb_hbbtv_activated(selected[1]["url"], selected[1])
+               except Exception, ErrMsg:
+                       vbcfg.ERR(ErrMsg)
+
+       def get_autostart_application(self):
+               if self._applicationList is None:
+                       service = self.session.nav.getCurrentService()
+                       info = service and service.info()
+                       if info is not None:
+                               sid = info.getInfo(iServiceInformation.sSID)
+                               onid = info.getInfo(iServiceInformation.sONID)
+                               tsid = info.getInfo(iServiceInformation.sTSID)
+                               name = info.getName()
+                               vbcfg.g_channel_info = (sid, onid, tsid, name)
+
+                               pmtid = info.getInfo(iServiceInformation.sPMTPID)
+                               demux = info.getInfoString(iServiceInformation.sLiveStreamDemuxId)
+                               vbcfg.DEBUG("demux = %s, pmtid = 0x%x, sid = 0x%x" % (demux, pmtid, sid))
+
+                               from aitreader import eAITSectionReader
+                               reader = eAITSectionReader(demux, pmtid, sid)
+                               if reader.doOpen(info, self.m_vuplus):
+                                       reader.doParseApplications()
+                                       reader.doDump()
+                               else:
+                                       vbcfg.ERR("no AIT")
+
+                               try:
+                                       self._applicationList = reader.getApplicationList()
+                               except:
+                                       pass
+
+               if self._applicationList is not None:
+                       for app in self._applicationList:
+                               if app["control"] in (1, -1):
+                                       return app
+               return None
+
+       def start_vbrowser(self):
+               if not self.check_vbrowser():
+                       os.system("%s/%s start"%(vbcfg.APPROOT, vbcfg.APP_RUN))
+               return True
+
+       def stop_vbrowser(self):
+               VBController.command('CONTROL_EXIT')
+               return True
+               try:
+                       os.system("%s/%s stop"%(vbcfg.APPROOT, vbcfg.APP_RUN))
+               except:
+                       pass
+               return True
+
+       def check_vbrowser(self):
+               try:
+                       ret = os.popen('%s/%s check'%(vbcfg.APPROOT, vbcfg.APP_RUN)).read()
+                       return ret.strip() != "0"
+               except Exception, ErrMsg:
+                       vbcfg.ERR("check vbrowser running: %s" % ErrMsg)
+               return False
+
+       def restart_vbrowser(self):
+               try:
+                       os.system("%s/%s restart"%(vbcfg.APPROOT, vbcfg.APP_RUN))
+               except:
+                       pass
+               return True
+
+def HelpableScreen__init__(self):
+       if isinstance(self, HelpableScreen):
+               HelpableScreen.showManual = showManual
+
+               self["helpActions"] = ActionMap(["HelpbuttonActions"], {
+                       "help_b" : self.showHelp,
+                       "help_l" : self.showManual,
+               }, -2)
+
+def showManual(self):
+       if not os.path.exists(vbcfg.MANUALROOT):
+               return
+
+       url = 'file://' + vbcfg.MANUALROOT + '/main.html'
+       lang = language.getLanguage()
+       if os.path.exists(vbcfg.MANUALROOT + '/' + lang):
+               url = 'file://' + vbcfg.MANUALROOT + '/' + lang + '/main.html'
+
+       vbcfg.g_browser = self.session.open(Browser, url)
+
+def auto_start_main(reason, **kwargs):
+       if reason:
+               try:
+                       if vbcfg.g_main.vbserver is not None:
+                               vbcfg.g_main.vbserver.kill()
+               except: pass
+
+def session_start_main(session, reason, **kwargs):
+       vbcfg.g_main = session.open(VBMain)
+       HelpableScreen.__init__ = HelpableScreen__init__
+       HelpableScreen.session = session
+
+def start_youtubetv_main(session, **kwargs):
+       def _cb_youtubetv_close(ret):
+               if ret:
+                       vbcfg.g_service = session.nav.getCurrentlyPlayingServiceReference()
+                       if vbcfg.g_service is not None:
+                               session.nav.stopService()
+                       vbcfg.g_browser = session.open(Browser, vbcfg.g_youtubetv_cfg.uri.value, True)
+
+       if config.plugins.youtubetv.showhelp.value == True:
+               _cb_youtubetv_close(True)
+       else:
+               session.openWithCallback(_cb_youtubetv_close, YoutubeTVWindow)
+
+
+def menu_start_youtube(menuid, **kwargs):
+       if menuid == "mainmenu":
+               return [(_("YouTube TV"), start_youtubetv_main, "youtube_tv", 46)]
+       return []
+
+def plugin_setting_youtube(session, **kwargs):
+       session.open(YoutubeTVSettings)
+
+def plugin_start_browser(session, **kwargs):
+       vbcfg.g_browser = session.open(Browser)
+
+def extension_toggle_browser(session, **kwargs):
+       if vbcfg.g_main is not None:
+               vbcfg.g_main.menu_toggle_vbrowser()
+
+def extension_start_application(session, **kwargs):
+       if vbcfg.g_main is not None:
+               vbcfg.g_main.menu_hbbtv_applications()
+
+def Plugins(**kwargs):
+       l = []
+       l.append(PluginDescriptor(where=PluginDescriptor.WHERE_AUTOSTART, fnc=auto_start_main))
+       l.append(PluginDescriptor(where=PluginDescriptor.WHERE_SESSIONSTART, needsRestart=True, fnc=session_start_main, weight=-10))
+       l.append(PluginDescriptor(name=_("YouTube TV"), where=PluginDescriptor.WHERE_MENU, fnc=menu_start_youtube))
+       l.append(PluginDescriptor(name=_("YouTube TV Settings"), where=PluginDescriptor.WHERE_PLUGINMENU, fnc=plugin_setting_youtube))
+       l.append(PluginDescriptor(name=_("Browser Start/Stop"), where=PluginDescriptor.WHERE_EXTENSIONSMENU, needsRestart=True, fnc=extension_toggle_browser))
+       l.append(PluginDescriptor(name=_("HbbTV Applications"), where=PluginDescriptor.WHERE_EXTENSIONSMENU, needsRestart=True, fnc=extension_start_application))
+       l.append(PluginDescriptor(name=_("Vuplus Web Browser"), description=_("start vuplus web browser"), where=PluginDescriptor.WHERE_PLUGINMENU, needsRestart=True, fnc=plugin_start_browser))
+       return l
diff --git a/lib/python/Plugins/Extensions/Vbrowser/vbcfg.py b/lib/python/Plugins/Extensions/Vbrowser/vbcfg.py
new file mode 100644 (file)
index 0000000..c840ede
--- /dev/null
@@ -0,0 +1,84 @@
+from time import strftime, localtime
+from Tools.Directories import fileExists
+
+g_main = None
+g_browser = None
+g_youtubetv_cfg = None
+g_service = None
+g_channel_info = None
+g_position = None
+
+need_restart = False
+
+APPROOT = "/usr/local/vbrowser"
+APP_RUN = "run.sh"
+
+PLUGINROOT = "/usr/lib/enigma2/python/Plugins/Extensions/Vbrowser"
+MANUALROOT = "/usr/local/manual"
+
+SOCKETFILE  = None
+CONTROLFILE = None
+
+def getPosition():
+       if fileExists("/proc/stb/fb/dst_left"):
+               try:
+                       file = open("/proc/stb/fb/dst_left", "r")
+                       dst_left = int(file.read().strip(), 16)
+                       file.close()
+                       file = open("/proc/stb/fb/dst_width", "r")
+                       dst_width = int(file.read().strip(), 16)
+                       file.close()
+                       file = open("/proc/stb/fb/dst_top", "r")
+                       dst_top = int(file.read().strip(), 16)
+                       file.close()
+                       file = open("/proc/stb/fb/dst_height", "r")
+                       dst_height = int(file.read().strip(), 16)
+                       file.close()
+               except Exception, Err:
+                       ERR(Err)
+                       return None
+       return (dst_left, dst_width, dst_top, dst_height)
+
+def setPosition(params):
+       if params is None:
+               return
+       if params[0] + params[1] > 720 or params[2] + params[3] > 576 :
+               return
+       else:
+               try:
+                       file = open("/proc/stb/fb/dst_left", "w")
+                       file.write('%X' % params[0])
+                       file.close()
+                       file = open("/proc/stb/fb/dst_width", "w")
+                       file.write('%X' % params[1])
+                       file.close()
+                       file = open("/proc/stb/fb/dst_top", "w")
+                       file.write('%X' % params[2])
+                       file.close()
+                       file = open("/proc/stb/fb/dst_height", "w")
+                       file.write('%X' % params[3])
+                       file.close()
+               except Exception, Err:
+                       ERR(Err)
+                       return
+
+# for debug True
+g_debug = False
+
+def LogEntry(mode, string):
+       if g_debug:
+               print strftime("%x %X", localtime()), "%5s [%12s]" % (mode, "Plugin"), string
+       elif mode != "DEBUG":
+               print "[vbrowser]", string
+
+def DEBUG(string):
+       LogEntry("DEBUG", string)
+
+def LOG(string):
+       LogEntry("LOG", string)
+
+def WARN(string):
+       LogEntry("WARN", string)
+
+def ERR(string):
+       LogEntry("ERROR", string)
diff --git a/lib/python/Plugins/Extensions/Vbrowser/vbipc.py b/lib/python/Plugins/Extensions/Vbrowser/vbipc.py
new file mode 100644 (file)
index 0000000..2e0e454
--- /dev/null
@@ -0,0 +1,153 @@
+from enigma import fbClass, eRCInput
+import os, threading, time, socket, select, struct
+import vbcfg
+
+_OPCODE  = {}
+_BUFSIZE = 4096
+
+def SetHandler(opcode, handler):
+       try:
+               _OPCODE[opcode][1] = handler
+       except:
+               vbcfg.ERR("Fail to set handler (unknown opcode): %s" % opcode)
+               return False
+       return True
+
+def GetHandler(opcode):
+       for key, value in _OPCODE.items():
+               if value[0] == opcode:
+                       vbcfg.DEBUG("recv socket: [%s]" % key)
+                       return value[1]
+       return None
+
+def GetOpcode(opcode):
+       try:
+               return _OPCODE[opcode][0]
+       except: return -1;
+
+class VBController:
+       @staticmethod
+       def assamble(opcodestr, data):
+               opcode = _OPCODE[opcodestr][0]
+               header = struct.pack('i', opcode)
+               return header + data
+
+       @staticmethod
+       def command(opcodestr, data = ""):
+               cmd_fd = None
+               vbcfg.DEBUG("send ipc: [%s]" % opcodestr)
+               try:
+                       send_data = VBController.assamble(opcodestr, data)
+                       if not os.path.exists(vbcfg.CONTROLFILE):
+                               raise Exception("no found controller file.")
+                       cmd_fd = os.open(vbcfg.CONTROLFILE, os.O_WRONLY)
+                       if cmd_fd is None:
+                               raise Exception("fail to open controller file.")
+                       os.write(cmd_fd, send_data)
+               except Exception, err:
+                       vbcfg.ERR("VBHController: %s" % err)
+                       fbClass.getInstance().unlock()
+                       eRCInput.getInstance().unlock()
+                       return False
+               finally:
+                       if cmd_fd is not None:
+                               os.close(cmd_fd)
+               return True
+
+class VBServerThread(threading.Thread):
+       def __init__(self):
+               threading.Thread.__init__(self)
+               self.mSock = None
+               self.mFlag = False
+               self.mTimeout = 5
+
+       def open(self, timeout = 5):
+               addr = vbcfg.SOCKETFILE
+               self.mTimeout = timeout
+
+               try:
+                       os.unlink(addr)
+               except:
+                       if os.path.exists(addr):
+                               return False
+               try:
+                       self.mSock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+                       self.mSock.settimeout(self.mTimeout)
+                       self.mSock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+                       self.mSock.bind(addr)
+               except: return False
+               return True
+
+       def parse(self, data):
+               hlen = struct.calcsize('ibi')
+               packet = ""
+               opcode, result, length = struct.unpack('ibi', data[:hlen])
+               #vbcfg.DEBUG("%s %s %d" % (opcode, result, length))
+               if length > 0:
+                       packet = data[hlen:hlen+length]
+               return [opcode, result, packet]
+
+       def assamble(self, opcode, result, packet):
+               if packet is None:
+                       packet = ""
+               header = struct.pack('ibi', opcode, (result and 1 or 0), len(packet))
+               return header + packet
+
+       def process(self, conn, addr):
+               read_data = conn.recv(_BUFSIZE)
+               request = self.parse(read_data)
+               opcode, result, read_packet = request[0], request[1], request[2]
+               result, send_packet = False,None
+               try:
+                       result, send_packet = GetHandler(opcode)(result, read_packet)
+               except Exception, ErrMsg:
+                       vbcfg.ERR(ErrMsg)
+               send_data = self.assamble(opcode, result, send_packet)
+               conn.sendall(send_data)
+
+       def run(self):
+               if self.mSock is None:
+                       raise
+
+               self.mFlag = True
+               self.mSock.listen(1)
+               while self.mFlag:
+                       readable, writable, errored = select.select([self.mSock], [], [], self.mTimeout)
+                       for s in readable:
+                               if s is self.mSock:
+                                       conn, addr = None, None
+                                       try:
+                                               conn, addr = self.mSock.accept()
+                                               self.process(conn, addr)
+                                       except Exception, err:
+                                               vbcfg.ERR("VBSServerThread: %s" % err)
+                                       finally:
+                                               if conn is not None:
+                                                       conn.close()
+
+       def kill(self):
+               self.mFlag = False
+
+class VBHandlers:
+       def __init__(self, opcode_list, szcbh):
+               opcode = 0
+               for opcode_str in opcode_list:
+                       if opcode_str is None and len(opcode_str) == 0:
+                               continue
+                       _OPCODE[opcode_str] = [opcode, None]
+                       opcode = opcode + 1
+
+               registreted_idx = 0
+               for fname in dir(self):
+                       try:
+                               if not fname.startswith(szcbh):
+                                       continue
+                               fref = getattr(self, fname)
+                               if fref is None:
+                                       continue
+                               opcodestr = fname[len(szcbh):]
+                               vbcfg.DEBUG("registrated at %s" % opcodestr)
+                               SetHandler(opcodestr, fref)
+                               registreted_idx += 1
+                       except: pass
+               vbcfg.DEBUG("%d registreated" % registreted_idx)
diff --git a/lib/python/Plugins/Extensions/Vbrowser/youtube.py b/lib/python/Plugins/Extensions/Vbrowser/youtube.py
new file mode 100644 (file)
index 0000000..23215dc
--- /dev/null
@@ -0,0 +1,172 @@
+from Screens.Screen import Screen
+from Screens.HelpMenu import HelpableScreen
+from Components.ActionMap import ActionMap, HelpableActionMap
+from Components.ConfigList import ConfigListScreen
+from Components.Label import Label
+from Components.Sources.StaticText import StaticText
+from Components.config import config, ConfigSubsection, ConfigYesNo, ConfigText, getConfigListEntry
+
+import vbcfg
+
+from __init__ import _
+
+config.plugins.youtubetv = ConfigSubsection()
+config.plugins.youtubetv.showhelp = ConfigYesNo(default = False)
+config.plugins.youtubetv.uri = ConfigText(default = "http://www.youtube.com/tv", visible_width = 50, fixed_size = False)
+#config.plugins.youtubetv.uri = ConfigText(default = "http://tv-html.irt.de/", visible_width = 50, fixed_size = False)
+
+vbcfg.g_youtubetv_cfg = config.plugins.youtubetv
+
+class YoutubeTVWindow(Screen, HelpableScreen):
+       skin =  """
+               <screen name="YoutubeTVWindow" position="center,center" size="550,160" title="Start YouTube TV" >
+                       <widget name="infomation" position="5,0" size="540,80" valign="center" halign="center" font="Regular;20" />
+                       <widget name="startdesc" position="10,80" size="395,40" valign="center" font="Regular;20" />
+                       <widget name="helpdesc" position="10,120" size="395,40" valign="center" font="Regular;20" />
+                       <ePixmap pixmap="skin_default/buttons/green.png" position="400,80" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/yellow.png" position="400,120" size="140,40" alphatest="on" />
+                       <widget source="key_green" render="Label" position="400,80" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_yellow" render="Label" position="400,120" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" foregroundColor="#ffffff" transparent="1" />
+               </screen>
+               """
+
+        def __init__(self, session):
+                Screen.__init__(self, session)
+               HelpableScreen.__init__(self)
+
+               self["actions"] = ActionMap(["WizardActions", "DirectionActions", "OkCancelActions","ColorActions", "EPGSelectActions",], {
+                       "cancel": self.keyCancel,
+                       "red"   : self.keyCancel,
+                       "green" : self.keyGreen,
+                       "yellow": self.keyYellow,
+               },-2)
+
+               self["key_green"]  = StaticText(_("Start"))
+               self["key_yellow"] = StaticText(_("Help"))
+
+               self["infomation"] = Label()
+               self["startdesc"]  = Label()
+               self["helpdesc"]   = Label()
+
+               self.onLayoutFinish.append(self.layoutFinished)
+
+       def layoutFinished(self):
+               self.setTitle(_('Start YouTube TV'))
+               self["infomation"].setText(_("YouTube TV is a new way to watch YouTube videos on Vu+"))
+               self["startdesc" ].setText(_("* Start YouTube TV"))
+               self["helpdesc"  ].setText(_("* RC Help"))
+
+       def setHelpModeActions(self):
+               self.helpList = []
+               self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions", {
+                       "ok"    : (self.keyPass, _("Play ther selected the video")),
+                       "cancel": (self.keyPass, _("Exit the YouTube TV")),
+               })
+               self["EventViewActions"] = HelpableActionMap(self, "EventViewActions", {
+                       "pageUp"    : (self.keyPass, _("Move up")),
+                       "pageDown"  : (self.keyPass, _("Move down")),
+                       "prevEvent" : (self.keyPass, _("Move left")),
+                       "nextEvent" : (self.keyPass, _("Move right")),
+               })
+               self["EPGSelectActions"] = HelpableActionMap(self, "EPGSelectActions", {
+                       "info"        : (self.keyPass, _("Search a video")),
+                       "nextService" : (self.keyPass, _("Skip forward 10 sec")),
+                       "prevService" : (self.keyPass, _("Skip backward 10 sec")),
+               })
+               self["MediaPlayerActions"] = HelpableActionMap(self, "MediaPlayerActions", {
+                       "play"  : (self.keyPass, _("Play current video")),
+                       "pause" : (self.keyPass, _("Pause current video")),
+                       "stop"  : (self.keyPass, _("Stop current video")),
+               })
+               self["ColorActions"] = HelpableActionMap(self, "ColorActions", {
+                       "red"   : (self.keyPass, _("Back")),
+               })
+               self.showHelp()
+
+       def keyPass(self):
+               pass
+
+       def keyCancel(self):
+               config.plugins.youtubetv.showhelp.cancel()
+               self.close(False)
+
+       def keyGreen(self):
+               config.plugins.youtubetv.showhelp.save()
+               config.plugins.youtubetv.save()
+               config.plugins.save()
+               vbcfg.g_youtubetv_cfg = config.plugins.youtubetv
+               self.close(True)
+
+       def keyYellow(self):
+               self.setHelpModeActions()
+
+       def keyBlue(self):
+               if config.plugins.youtubetv.showhelp.value == True :
+                       config.plugins.youtubetv.showhelp.setValue(False)
+               else:   config.plugins.youtubetv.showhelp.setValue(True)
+
+class YoutubeTVSettings(ConfigListScreen, Screen):
+       skin=   """
+               <screen position="center,center" size="600,140" title="YouTube TV Settings">
+                       <widget name="config" position="0,0" size="600,100" scrollbarMode="showOnDemand" />
+
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="310,100" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/green.png" position="150,100" size="140,40" alphatest="on" />
+
+                       <widget source="key_red" render="Label" position="310,100" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" foregroundColor="#ffffff" transparent="1" />
+                       <widget source="key_green" render="Label" position="150,100" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" foregroundColor="#ffffff" transparent="1" />
+               </screen>
+               """
+
+       def __init__(self, session):
+               self.session = session
+               self.menulist = []
+
+               Screen.__init__(self, session)
+               ConfigListScreen.__init__(self, self.menulist)
+
+               self["actions"] = ActionMap(["OkCancelActions", "ColorActions",], {
+                       "ok"     : self.keyGreen,
+                       "green"  : self.keyGreen,
+                       "red"    : self.keyRed,
+                       "cancel" : self.keyRed,
+               }, -2)
+               self["key_red"]   = StaticText(_("Cancel"))
+               self["key_green"] = StaticText(_("Save"))
+
+               self.makeConfigList()
+               self.onLayoutFinish.append(self.layoutFinished)
+
+       def layoutFinished(self):
+               self.setTitle(_('YouTube TV Settings'))
+
+       def keyGreen(self):
+               config.plugins.youtubetv.showhelp.save()
+               config.plugins.youtubetv.uri.save()
+               config.plugins.youtubetv.save()
+               config.plugins.save()
+
+               vbcfg.g_youtubetv_cfg = config.plugins.youtubetv
+               self.close()
+
+       def keyRed(self):
+               config.plugins.youtubetv.showhelp.cancel()
+               config.plugins.youtubetv.uri.cancel()
+               self.close()
+
+       def keyLeft(self):
+               ConfigListScreen.keyLeft(self)
+
+       def keyRight(self):
+               ConfigListScreen.keyRight(self)
+
+       def makeConfigList(self):
+               self.menulist = []
+
+               entryUri = getConfigListEntry(_("YouTube TV URL"), config.plugins.youtubetv.uri)
+               entryShowHelp = getConfigListEntry(_("Do not show YouTube TV Starter again"), config.plugins.youtubetv.showhelp)
+               self.menulist.append(entryUri)
+               self.menulist.append(entryShowHelp)
+               self["config"].list = self.menulist
+               self["config"].l.setList(self.menulist)
+