[webbrowser] improve the analysis of the rc-keyboard/rc-mouse handler
[vuplus_dvbapp] / lib / python / Plugins / Extensions / WebBrowser / plugin.py
index bf91f97..1985c06 100644 (file)
@@ -407,10 +407,11 @@ class BrowserLauncher(ConfigListScreen, Screen):
        skin=   """
                <screen name="BrowserLauncher" position="center,center" size="309,498" title="Web Browser">
                        <ePixmap pixmap="Vu_HD/buttons/red.png" position="4,0" size="40,40" alphatest="on" />
-                       <ePixmap pixmap="Vu_HD/buttons/green.png" position="100,0" size="40,40" alphatest="on" />
-                       <ePixmap pixmap="Vu_HD/buttons/button_off.png" position="200,0" size="40,40" alphatest="on" />
-                       <widget source="key_red" render="Label" position="15,0" zPosition="1" size="50,30" font="Regular;20" halign="right" valign="center" transparent="1" />
-                       <widget source="key_green" render="Label" position="120,0" zPosition="1" size="50,30" font="Regular;20" halign="right" valign="center" transparent="1" />
+                       <ePixmap pixmap="Vu_HD/buttons/green.png" position="154,0" size="40,40" alphatest="on" />
+
+                       <widget source="key_red" render="Label" position="30,0" zPosition="1" size="125,30" font="Regular;20" halign="center" valign="center" transparent="1" />
+                       <widget source="key_green" render="Label" position="180,0" zPosition="1" size="125,30" font="Regular;20" halign="center" valign="center" transparent="1" />
+
                        <widget name="config" position="0,50" size="309,100" scrollbarMode="showOnDemand" />
                        <ePixmap pixmap="Vu_HD/rc_wb_desc.png" position="0,150" size="309,296" alphatest="on" />
                        <widget name="info" position="0,455" size="309,50" font="Regular;18" halign="center" foregroundColor="blue" transparent="1" />
@@ -598,26 +599,28 @@ class BrowserLauncher(ConfigListScreen, Screen):
                                                event_list.append((h, _(h)))
                                                self.name_list.append((h, n))
                                                if n[1:].startswith("dream") and self.rc_mouse is None:
-                                                       self.rc_mouse = copy.deepcopy(h)
-                                                       self.rc_keyboard = copy.deepcopy(h)
-                                                       print "detected!! rc"
+                                                       for thl in h.split(" "):
+                                                               if thl.startswith("event"):
+                                                                       self.rc_mouse = copy.deepcopy(h)
+                                                                       self.rc_keyboard = copy.deepcopy(h)
+                                                                       print "detected!! rc:", h
                                                        continue
                                                if h.startswith("mouse") and self.usb_mouse is None:
                                                        self.usb_mouse = copy.deepcopy(h)
-                                                       print "detected!! usb mouse"
+                                                       print "detected!! usb mouse:",h
                                                        continue
                                                if tn == -1 and self.usb_keyboard is None:
                                                        self.usb_keyboard = copy.deepcopy(h)
-                                                       print "detected!! usb keyboard"
+                                                       print "detected!! usb keyboard:",h
                                elif line[0] == 'B' and line[3:].startswith("ABS") and p.startswith("usb-"):
                                        for h in h_list:
                                                if self.usb_mouse is not None:
                                                        break
                                                if self.usb_keyboard is not None and h == self.usb_keyboard[0]:
                                                        self.usb_keyboard = None
-                                                       print "clean!! usb keyboard"
+                                                       print "clean!! usb keyboard:",h
                                                self.usb_mouse = copy.deepcopy(h)
-                                               print "detected!! usb mouse"
+                                               print "detected!! usb mouse:",h
 
                tmp = copy.deepcopy(event_list)
                if self.usb_mouse is not None:
@@ -645,7 +648,7 @@ class BrowserLauncher(ConfigListScreen, Screen):
 
                kbd_cmd = " "
                mouse_cmd = " "
-               extra_cmd = " " 
+               extra_cmd = "export VU_DOWNLOAD_DIR=/tmp; " 
                browser_cmd = "%s/%s -qws" % (self.browser_root, self.browser_name)
 
                mouse_param = self.mouse.value