NetworkBrowser: - replace buttons and labels through StaticText for better skinability
authorMladen Horvat <acid-burn@opendreambox.org>
Fri, 25 Sep 2009 15:13:58 +0000 (15:13 +0000)
committerMladen Horvat <acid-burn@opendreambox.org>
Fri, 25 Sep 2009 15:13:58 +0000 (15:13 +0000)
- rework gui to better fit inside e2 networkconfiguration
- dont allow "/" on beginning of a sharedirectory name to workaround double / inside mount command
- fix wrong return from mountedit screen back to networkbrowser, so we dont get again the userdialog
- clear expandet list on refresh
- more informations inside networkbrowserstatusbar
- minor fixes

networkbrowser/CONTROL/control
networkbrowser/src/MountEdit.py
networkbrowser/src/MountManager.py
networkbrowser/src/MountView.py
networkbrowser/src/NetworkBrowser.py
networkbrowser/src/UserDialog.py
networkbrowser/src/UserManager.py

index d3db9ff..67c5814 100755 (executable)
@@ -6,5 +6,5 @@ Section: extra
 Priority: optional
 Maintainer: Mladen Horvat <acid-burn@opendreambox.org>
 Homepage: http://www.dream-multimedia-tv.de/
-Depends: enigma2(>=2.6git20090219)
+Depends: enigma2(>=2.6git20090926)
 Source: http://www.dream-multimedia-tv.de/
\ No newline at end of file
index cc6c30e..8980c34 100755 (executable)
@@ -5,10 +5,9 @@ from Screens.Screen import Screen
 from Screens.MessageBox import MessageBox
 from Screens.VirtualKeyBoard import VirtualKeyBoard
 from Components.ActionMap import ActionMap
-from Components.Button import Button
+from Components.Sources.StaticText import StaticText
 from Components.config import config, ConfigIP, NoSave, ConfigText, ConfigEnableDisable, ConfigPassword, ConfigSelection, getConfigListEntry, ConfigYesNo
 from Components.ConfigList import ConfigListScreen
-from Components.Label import Label
 from Components.Pixmap import Pixmap
 from Components.ActionMap import ActionMap, NumberActionMap
 from enigma import ePoint
@@ -17,15 +16,14 @@ from re import sub as re_sub
 
 class AutoMountEdit(Screen, ConfigListScreen):
         skin = """
-                <screen name="AutoMountEdit" position="90,110" size="560,400" title="MountEdit">
-                        <widget name="config" position="10,10" size="540,200" zPosition="1" scrollbarMode="showOnDemand" />
-                        <widget name="ButtonGreen" pixmap="skin_default/buttons/button_green.png" position="30,365" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                        <widget name="introduction2" position="110,330" size="300,20" zPosition="10" font="Regular;21" halign="center" transparent="1" />
-                        <widget name="ButtonRedtext" position="410,365" size="140,21" zPosition="10" font="Regular;21" transparent="1" />
-                        <widget name="ButtonRed" pixmap="skin_default/buttons/button_red.png" position="390,365" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                        <widget name="VKeyIcon" pixmap="skin_default/vkey_icon.png" position="40,345" zPosition="10" size="60,48" transparent="1" alphatest="on" />
-                        <widget name="HelpWindow" pixmap="skin_default/vkey_icon.png" position="175,325" zPosition="1" size="1,1" transparent="1" alphatest="on" />
-                        <ePixmap pixmap="skin_default/bottombar.png" position="10,310" size="540,120" zPosition="1" transparent="1" alphatest="on" />
+                <screen name="AutoMountEdit" position="center,center" size="560,450" title="MountEdit">
+                        <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
+                        <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+                        <widget name="config" position="5,50" size="550,250" zPosition="1" scrollbarMode="showOnDemand" />
+                        <ePixmap pixmap="skin_default/div-h.png" position="0,420" zPosition="1" size="560,2" />
+                        <widget source="introduction" render="Label" position="10,430" size="540,21" zPosition="10" font="Regular;21" halign="center" valign="center" backgroundColor="#25062748" transparent="1"/>
+                        <widget name="VKeyIcon" pixmap="skin_default/buttons/key_text.png" position="10,430" zPosition="10" size="35,25" transparent="1" alphatest="on" />
+                        <widget name="HelpWindow" pixmap="skin_default/vkey_icon.png" position="160,350" zPosition="1" size="1,1" transparent="1" alphatest="on" />    
                 </screen>"""
 
         def __init__(self, session, plugin_path, mountinfo = None ):
@@ -51,9 +49,9 @@ class AutoMountEdit(Screen, ConfigListScreen):
                         "red": self.close,
                 }, -2)
 
-                self["VirtualKB"] = ActionMap(["ShortcutActions"],
+                self["VirtualKB"] = ActionMap(["VirtualKeyboardActions"],
                 {
-                        "green": self.KeyGreen,
+                        "showVirtualKeyboard": self.KeyText,
                 }, -2)
 
                 self.list = []
@@ -61,17 +59,14 @@ class AutoMountEdit(Screen, ConfigListScreen):
                 self.createSetup()
                 self.onLayoutFinish.append(self.layoutFinished)
                 # Initialize Buttons
-                self["ButtonGreen"] = Pixmap()
                 self["VKeyIcon"] = Pixmap()
                 self["HelpWindow"] = Pixmap()
-                self["introduction2"] = Label(_("Press OK to activate the settings."))
-                self["ButtonRed"] = Pixmap()
-                self["ButtonRedtext"] = Label(_("Close"))
+                self["introduction"] = StaticText(_("Press OK to activate the settings."))
+                self["key_red"] = StaticText(_("Cancel"))
 
 
         def layoutFinished(self):
                 self.setTitle(_("Mounts editor"))
-                self["ButtonGreen"].hide()
                 self["VKeyIcon"].hide()
                 self["VirtualKB"].setEnabled(False)
                 self["HelpWindow"].hide()
@@ -210,7 +205,7 @@ class AutoMountEdit(Screen, ConfigListScreen):
                 if self["config"].getCurrent() == self.mounttypeEntry:
                         self.createSetup()
 
-        def KeyGreen(self):
+        def KeyText(self):
                 print "Green Pressed"
                 if self["config"].getCurrent() == self.sharenameEntry:
                         self.session.openWithCallback(lambda x : self.VirtualKeyBoardCallback(x, 'sharename'), VirtualKeyBoard, title = (_("Enter share name:")), text = self.sharenameConfigEntry.value)
@@ -226,20 +221,20 @@ class AutoMountEdit(Screen, ConfigListScreen):
         def VirtualKeyBoardCallback(self, callback = None, entry = None):
                 if callback is not None and len(callback) and entry is not None and len(entry):
                         if entry == 'sharename':
-                                self.sharenameConfigEntry = NoSave(ConfigText(default = callback, visible_width = 50, fixed_size = False))
-                                self.createSetup()
+                                self.sharenameConfigEntry.setValue(callback)
+                                self["config"].invalidate(self.sharenameConfigEntry)
                         if entry == 'sharedir':
-                                self.sharedirConfigEntry = NoSave(ConfigText(default = callback, visible_width = 50, fixed_size = False))
-                                self.createSetup()
+                                self.sharedirConfigEntry.setValue(callback)
+                                self["config"].invalidate(self.sharedirConfigEntry)
                         if entry == 'options':
-                                self.optionsConfigEntry = NoSave(ConfigText(default = callback, visible_width = 50, fixed_size = False))
-                                self.createSetup()
+                                self.optionsConfigEntry.setValue(callback)
+                                self["config"].invalidate(self.optionsConfigEntry)                                
                         if entry == 'username':
-                                self.usernameConfigEntry = NoSave(ConfigText(default = callback, visible_width = 50, fixed_size = False))
-                                self.createSetup()
+                                self.usernameConfigEntry.setValue(callback)
+                                self["config"].invalidate(self.usernameConfigEntry)
                         if entry == 'password':
-                                self.passwordConfigEntry = NoSave(ConfigPassword(default = callback, visible_width = 50, fixed_size = False))
-                                self.createSetup()
+                                self.passwordConfigEntry.setValue(callback)
+                                self["config"].invalidate(self.passwordConfigEntry)
 
         def keyLeft(self):
                 ConfigListScreen.keyLeft(self)
@@ -252,14 +247,12 @@ class AutoMountEdit(Screen, ConfigListScreen):
         def selectionChanged(self):
                 current = self["config"].getCurrent()
                 if current == self.activeEntry or current == self.ipEntry or current == self.mounttypeEntry or current == self.hdd_replacementEntry:
-                        self["ButtonGreen"].hide()
                         self["VKeyIcon"].hide()
                         self["VirtualKB"].setEnabled(False)
                 else:
                         helpwindowpos = self["HelpWindow"].getPosition()
                         if current[1].help_window.instance is not None:
                                 current[1].help_window.instance.move(ePoint(helpwindowpos[0],helpwindowpos[1]))
-                                self["ButtonGreen"].show()
                                 self["VKeyIcon"].show()
                                 self["VirtualKB"].setEnabled(True)
 
@@ -277,10 +270,15 @@ class AutoMountEdit(Screen, ConfigListScreen):
 
         def updateConfig(self, ret = False):
                 if (ret == True):
+                        sharedir = None
+                        if self.sharedirConfigEntry.value.startswith("/"):
+                                sharedir = self.sharedirConfigEntry.value[1:]
+                        else:
+                                sharedir = self.sharedirConfigEntry.value
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "sharename", self.sharenameConfigEntry.value)
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "active", self.activeConfigEntry.value)
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "ip", self.ipConfigEntry.getText())
-                        iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "sharedir", self.sharedirConfigEntry.value)
+                        iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "sharedir", sharedir)
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "mounttype", self.mounttypeConfigEntry.value)
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "options", self.optionsConfigEntry.value)
                         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, "username", self.usernameConfigEntry.value)
@@ -315,7 +313,10 @@ class AutoMountEdit(Screen, ConfigListScreen):
                         data['ip'] = self.ipConfigEntry.getText()
                         data['sharename'] = re_sub("\W", "", self.sharenameConfigEntry.value)
                         # "\W" matches everything that is "not numbers, letters, or underscores",where the alphabet defaults to ASCII.
-                        data['sharedir'] = self.sharedirConfigEntry.value
+                        if self.sharedirConfigEntry.value.startswith("/"):
+                                data['sharedir'] = self.sharedirConfigEntry.value[1:]
+                        else:
+                                data['sharedir'] = self.sharedirConfigEntry.value
                         data['options'] =  self.optionsConfigEntry.value
                         data['mounttype'] = self.mounttypeConfigEntry.value
                         data['username'] = self.usernameConfigEntry.value
index b5ed66f..3c56469 100755 (executable)
@@ -4,7 +4,7 @@ from __init__ import _
 from Screens.Screen import Screen
 from Screens.MessageBox import MessageBox
 from Screens.VirtualKeyBoard import VirtualKeyBoard
-from Components.Label import Label
+from Components.Sources.StaticText import StaticText
 from Components.Pixmap import Pixmap
 from Components.ActionMap import ActionMap
 from Components.Network import iNetwork
@@ -20,8 +20,10 @@ from UserManager import UserManager
 
 class AutoMountManager(Screen):
        skin = """
-               <screen name="AutoMountManager" position="90,140" size="560,350" title="AutoMountManager">
-                       <widget source="config" render="Listbox" position="10,10" size="540,220" scrollbarMode="showOnDemand" >
+               <screen name="AutoMountManager" position="center,center" size="560,400" title="AutoMountManager">
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
+                       <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+                       <widget source="config" render="Listbox" position="5,50" size="540,300" scrollbarMode="showOnDemand" >
                                <convert type="TemplatedMultiContent">
                                        {"template": [
                                                        MultiContentEntryText(pos = (0, 3), size = (480, 25), font=0, flags = RT_HALIGN_LEFT, text = 0), # index 2 is the Menu Titel
@@ -33,10 +35,8 @@ class AutoMountManager(Screen):
                                        }
                                </convert>
                        </widget>
-                       <widget name="introduction" position="90,260" size="300,20" zPosition="10" font="Regular;21" halign="center" transparent="1" />
-                       <widget name="ButtonRedtext" position="410,305" size="140,21" zPosition="10" font="Regular;21" transparent="1" />
-                       <widget name="ButtonRed" pixmap="skin_default/buttons/button_red.png" position="390,305" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                       <ePixmap pixmap="skin_default/bottombar.png" position="10,250" size="540,120" zPosition="1" transparent="1" alphatest="on" />
+                       <ePixmap pixmap="skin_default/div-h.png" position="0,360" zPosition="1" size="560,2" />
+                       <widget source="introduction" render="Label" position="10,370" size="540,21" zPosition="10" font="Regular;21" halign="center" valign="center" backgroundColor="#25062748" transparent="1"/>
                </screen>"""
        def __init__(self, session, iface ,plugin_path):
                self.skin_path = plugin_path
@@ -51,9 +51,8 @@ class AutoMountManager(Screen):
                        "cancel": self.exit,
                        "red": self.exit,
                })
-               self["ButtonRed"] = Pixmap()
-               self["ButtonRedtext"] = Label(_("Close"))
-               self["introduction"] = Label(_("Press OK to select."))
+               self["key_red"] = StaticText(_("Close"))
+               self["introduction"] = StaticText(_("Press OK to select."))
 
                self.list = []
                self["config"] = List(self.list)
index e9003c9..9f4f725 100755 (executable)
@@ -3,7 +3,7 @@
 from __init__ import _
 from Screens.Screen import Screen
 from Screens.MessageBox import MessageBox
-from Components.Label import Label
+from Components.Sources.StaticText import StaticText
 from Components.ActionMap import ActionMap
 from Components.Network import iNetwork
 from Components.Sources.List import List
@@ -15,11 +15,15 @@ from MountEdit import AutoMountEdit
 class AutoMountView(Screen):
         skin = """
                 <screen name="AutoMountView" position="90,140" size="560,350" title="MountView">
-                        <widget name="legend1" position="0,0" zPosition="1" size="130,40" font="Regular;18" halign="center" valign="center" />
-                        <widget name="legend2" position="130,0" zPosition="1" size="310,40" font="Regular;18" halign="center" valign="center" />
-                        <widget name="legend3" position="410,0" zPosition="1" size="100,40" font="Regular;18" halign="center" valign="center" />
-                        <ePixmap pixmap="skin_default/div-h.png" position="0,40" zPosition="2" size="560,2" />
-                        <widget source="config" render="Listbox" position="5,50" size="555,200" scrollbarMode="showOnDemand">
+                        <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
+                        <ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
+                        <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+                        <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
+                        <widget source="legend1" render="Label" position="0,50" zPosition="1" size="130,40" font="Regular;18" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
+                        <widget source="legend2" render="Label" position="130,50" zPosition="1" size="310,40" font="Regular;18" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
+                        <widget source="legend3" render="Label" position="410,50" zPosition="1" size="100,40" font="Regular;18" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
+                        <ePixmap pixmap="skin_default/div-h.png" position="0,90" zPosition="2" size="560,2" />
+                        <widget source="config" render="Listbox" position="5,100" size="555,200" scrollbarMode="showOnDemand">
                                 <convert type="TemplatedMultiContent">
                                         {"template": [
                                                         MultiContentEntryPixmapAlphaTest(pos = (15, 1), size = (48, 48), png = 0), # index 0 is the isMounted pixmap
@@ -34,12 +38,8 @@ class AutoMountView(Screen):
                                         }
                                 </convert>
                         </widget>
-                        <widget name="introduction" position="110,270" size="300,20" zPosition="10" font="Regular;21" halign="center" transparent="1" />
-                        <widget name="ButtonRedtext" position="410,305" size="140,21" zPosition="10" font="Regular;21" transparent="1" />
-                        <ePixmap pixmap="skin_default/buttons/button_red.png" position="390,305" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                        <ePixmap pixmap="skin_default/buttons/button_yellow.png" position="30,305" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                        <widget name="deletetext" position="50,305" size="350,21" zPosition="10" font="Regular;21" transparent="1" />
-                        <ePixmap pixmap="skin_default/bottombar.png" position="10,250" size="540,120" zPosition="1" transparent="1" alphatest="on" />
+                        <ePixmap pixmap="skin_default/div-h.png" position="0,310" zPosition="1" size="560,2" />
+                        <widget source="introduction" render="Label" position="110,320" size="300,20" zPosition="10" font="Regular;21" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
                 </screen>"""
 
         def __init__(self, session, plugin_path):
@@ -56,12 +56,12 @@ class AutoMountView(Screen):
                         "red": self.exit,
                         "yellow": self.delete,
                 })
-                self["legend1"] = Label(_("Mounted/\nUnmounted"))
-                self["legend2"] = Label(_("Mount informations"))
-                self["legend3"] = Label(_("Active/\nInactive"))
-                self["introduction"] = Label(_("Press OK to edit the settings."))
-                self["ButtonRedtext"] = Label(_("Close"))
-                self["deletetext"] = Label(_("Delete selected mount"))
+                self["legend1"] = StaticText(_("Mounted/\nUnmounted"))
+                self["legend2"] = StaticText(_("Mount informations"))
+                self["legend3"] = StaticText(_("Active/\nInactive"))
+                self["introduction"] = StaticText(_("Press OK to edit the settings."))
+                self["key_red"] = StaticText(_("Close"))
+                self["key_yellow"] = StaticText(_("Delete mount"))
 
                 self.list = []
                 self["config"] = List(self.list)
index 2307701..a35621a 100755 (executable)
@@ -7,6 +7,7 @@ from Screens.MessageBox import MessageBox
 from Components.Label import Label
 from Components.ActionMap import ActionMap, NumberActionMap
 from Components.Sources.List import List
+from Components.Sources.StaticText import StaticText
 from Components.Network import iNetwork
 from Components.Input import Input
 from Components.config import getConfigListEntry, NoSave, config, ConfigIP
@@ -62,8 +63,15 @@ class NetworkDescriptor:
 class NetworkBrowser(Screen):
        skin = """
                <screen name="NetworkBrowser" position="90,80" size="560,450" title="Network Neighbourhood">
-                       <ePixmap pixmap="skin_default/bottombar.png" position="10,360" size="540,120" zPosition="1" transparent="1" alphatest="on" />
-                       <widget source="list" render="Listbox" position="10,10" size="540,350" zPosition="10" scrollbarMode="showOnDemand">
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" size="140,40" alphatest="on" />
+                       <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+                       <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+                       <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
+                       <widget source="key_blue" render="Label" position="420,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#18188b" transparent="1" />
+                       <widget source="list" render="Listbox" position="5,50" size="540,350" zPosition="10" scrollbarMode="showOnDemand">
                                <convert type="TemplatedMultiContent">
                                        {"template": [
                                                        MultiContentEntryPixmapAlphaTest(pos = (0, 0), size = (48, 48), png = 1), # index 1 is the expandable/expanded/verticalline icon
@@ -78,15 +86,8 @@ class NetworkBrowser(Screen):
                                        }
                                </convert>
                        </widget>
-                       <ePixmap pixmap="skin_default/buttons/button_green.png" position="30,370" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                       <widget name="mounttext" position="50,370" size="250,21" zPosition="10" font="Regular;21" transparent="1" />
-                       <ePixmap pixmap="skin_default/buttons/button_blue.png" position="30,395" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                       <widget name="searchtext" position="50,395" size="150,21" zPosition="10" font="Regular;21" transparent="1" />
-                       <widget name="infotext" position="300,375" size="250,21" zPosition="10" font="Regular;21" transparent="1" />
-                       <ePixmap pixmap="skin_default/buttons/button_red.png" position="410,420" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                       <widget name="closetext" position="430,420" size="120,21" zPosition="10" font="Regular;21" transparent="1" />
-                       <ePixmap pixmap="skin_default/buttons/button_yellow.png" position="30,420" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                       <widget name="rescantext" position="50,420" size="300,21" zPosition="10" font="Regular;21" transparent="1" />
+                       <ePixmap pixmap="skin_default/div-h.png" position="0,410" zPosition="1" size="560,2" />         
+                       <widget source="infotext" render="Label" position="0,420" size="560,30" zPosition="10" font="Regular;21" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
                </screen>"""
 
        def __init__(self, session, iface,plugin_path):
@@ -103,12 +104,12 @@ class NetworkBrowser(Screen):
                self.cache_ttl = 604800 #Seconds cache is considered valid, 7 Days should be ok
                self.cache_file = '/etc/enigma2/networkbrowser.cache' #Path to cache directory
 
-               self["closetext"] = Label(_("Close"))
-               self["mounttext"] = Label(_("Mounts management"))
-               self["rescantext"] = Label(_("Rescan network"))
-               self["infotext"] = Label(_("Press OK to mount!"))
-               self["searchtext"] = Label(_("Expert"))
-
+               self["key_red"] = StaticText(_("Close"))
+               self["key_green"] = StaticText(_("Mounts management"))
+               self["key_yellow"] = StaticText(_("Rescan"))
+               self["key_blue"] = StaticText(_("Expert"))
+               self["infotext"] = StaticText(_("Press OK to mount!"))
+               
                self["shortcuts"] = ActionMap(["ShortcutActions", "WizardActions"],
                {
                        "ok": self.go,
@@ -138,9 +139,10 @@ class NetworkBrowser(Screen):
                iNetwork.stopGetInterfacesConsole()
 
        def startRun(self):
+               self.expanded = []
                self.setStatus('update')
                self.mounts = iAutoMount.getMountsList()
-               self["infotext"].hide()
+               self["infotext"].setText("")
                self.vc = valid_cache(self.cache_file, self.cache_ttl)
                if self.cache_ttl > 0 and self.vc != 0:
                        self.process_NetworkIPs()
@@ -353,10 +355,15 @@ class NetworkBrowser(Screen):
                current = self["list"].getCurrent()
                self.listindex = self["list"].getIndex()
                if current:
-                       if current[0][0] in ("nfsShare", "smbShare"):
-                               self["infotext"].show()
-                       else:
-                               self["infotext"].hide()
+                       if len(current[0]) >= 2:
+                               if current[0][0] in ("nfsShare", "smbShare"):
+                                       self["infotext"].setText(_("Press OK to mount this share!"))
+                               else:
+                                       selectedhost = current[0][2]
+                                       if selectedhost in self.expanded:
+                                               self["infotext"].setText(_("Press OK to collapse this host"))
+                                       else:
+                                               self["infotext"].setText(_("Press OK to expand this host"))
 
        def go(self):
                sel = self["list"].getCurrent()
@@ -373,6 +380,7 @@ class NetworkBrowser(Screen):
                                self.expanded.remove(selectedhost)
                                self.updateNetworkList()
                        else:
+                               self.hostcache_file = None
                                self.hostcache_file = '/etc/enigma2/' + selectedhostname.strip() + '.cache' #Path to cache directory
                                if os_path.exists(self.hostcache_file):
                                        print '[Networkbrowser] Loading userinfo cache from ',self.hostcache_file
@@ -388,9 +396,14 @@ class NetworkBrowser(Screen):
                        print '[Networkbrowser] sel nfsShare'
                        self.openMountEdit(sel[0])
                if sel[0][0] == 'smbShare': # share entry selected
-                       print '[Networkbrowser] sel nfsShare'
-                       self.session.openWithCallback(self.passwordQuestion, MessageBox, (_("Do you want to enter a username and password for this host?\n") ) )
-                       self.openMountEdit(sel[0])
+                       print '[Networkbrowser] sel cifsShare'
+                       self.hostcache_file = None
+                       self.hostcache_file = '/etc/enigma2/' + selectedhostname.strip() + '.cache' #Path to cache directory
+                       if os_path.exists(self.hostcache_file):
+                               print '[Networkbrowser] userinfo found from ',self.sharecache_file
+                               self.openMountEdit(sel[0])
+                       else:
+                               self.session.openWithCallback(self.passwordQuestion, MessageBox, (_("Do you want to enter a username and password for this host?\n") ) )
 
        def passwordQuestion(self, ret = False):
                sel = self["list"].getCurrent()
@@ -468,23 +481,23 @@ class NetworkBrowser(Screen):
 
 class ScanIP(Screen, ConfigListScreen):
        skin = """
-               <screen name="ScanIP" position="100,100" size="550,80" title="Scan IP" >
-                       <widget name="config" position="10,10" size="530,25" scrollbarMode="showOnDemand" />
-                       <ePixmap pixmap="skin_default/buttons/red.png" position="10,40" zPosition="2" size="140,40" transparent="1" alphatest="on" />
-                       <widget name="closetext" position="20,50" size="140,21" zPosition="10" font="Regular;21" transparent="1" />
-                       <ePixmap pixmap="skin_default/buttons/green.png" position="160,40" zPosition="2" size="140,40" transparent="1" alphatest="on" />
-                       <widget name="edittext" position="170,50" size="140,21" zPosition="10" font="Regular;21" transparent="1" />
-                       <ePixmap pixmap="skin_default/buttons/yellow.png" position="320,40" zPosition="2" size="140,40" transparent="1" alphatest="on" />
-                       <widget name="scanaddress" position="325,50" size="140,21" zPosition="10" font="Regular;21" transparent="1" />
+               <screen name="ScanIP" position="center,center" size="560,80" title="Scan IP" >
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
+                       <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+                       <widget source="key_green" render="Label" position="140,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+                       <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
+                       <widget name="config" position="5,50" size="540,25" scrollbarMode="showOnDemand" />
                </screen>"""
 
        def __init__(self, session):
                Screen.__init__(self, session)
                self.session = session
 
-               self["closetext"] = Label(_("Cancel"))
-               self["edittext"] = Label(_("Scan NFS Share"))
-               self["scanaddress"] = Label(_("address range"))
+               self["key_red"] = StaticText(_("Cancel"))
+               self["key_green"] = StaticText(_("Scan NFS share"))
+               self["key_yellow"] = StaticText(_("Scan range"))
 
                self["actions"] = ActionMap(["SetupActions", "ColorActions"],
                {
@@ -494,7 +507,9 @@ class ScanIP(Screen, ConfigListScreen):
                        "green": self.goNfs,
                        "yellow": self.goAddress,
                }, -1)
+               
                self.ipAddress = ConfigIP(default=[0,0,0,0])
+               
                ConfigListScreen.__init__(self, [
                        getConfigListEntry(_("IP Address"), self.ipAddress),
                ], self.session)
index cf00067..ecd747e 100755 (executable)
@@ -7,7 +7,7 @@ from Screens.VirtualKeyBoard import VirtualKeyBoard
 from Components.ActionMap import ActionMap
 from Components.config import ConfigText, ConfigPassword, NoSave, getConfigListEntry
 from Components.ConfigList import ConfigListScreen
-from Components.Label import Label
+from Components.Sources.StaticText import StaticText
 from Components.Pixmap import Pixmap
 from Components.ActionMap import ActionMap, NumberActionMap
 from enigma import ePoint
@@ -48,15 +48,14 @@ def load_cache(cache_file):
 
 class UserDialog(Screen, ConfigListScreen):
        skin = """
-               <screen name="UserDialog" position="90,110" size="560,380" title="UserDialog">
-                       <widget name="config" position="10,10" size="540,200" zPosition="1" scrollbarMode="showOnDemand" />
-                       <widget name="ButtonGreen" pixmap="skin_default/buttons/button_green.png" position="20,330" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                       <widget name="introduction2" position="90,300" size="300,20" zPosition="10" font="Regular;21" halign="center" transparent="1" />
-                       <widget name="ButtonRedtext" position="410,345" size="140,21" zPosition="10" font="Regular;21" transparent="1" />
-                       <widget name="ButtonRed" pixmap="skin_default/buttons/button_red.png" position="390,345" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                       <widget name="VKeyIcon" pixmap="skin_default/vkey_icon.png" position="35,310" zPosition="10" size="60,48" transparent="1" alphatest="on" />
-                       <widget name="HelpWindow" pixmap="skin_default/vkey_icon.png" position="175,300" zPosition="1" size="1,1" transparent="1" alphatest="on" />
-                       <ePixmap pixmap="skin_default/bottombar.png" position="10,290" size="540,120" zPosition="1" transparent="1" alphatest="on" />
+               <screen name="UserDialog" position="center,center" size="560,300" title="UserDialog">
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
+                       <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+                       <widget name="config" position="5,50" size="550,200" zPosition="1" scrollbarMode="showOnDemand" />
+                       <ePixmap pixmap="skin_default/div-h.png" position="0,270" zPosition="1" size="560,2" />
+                       <widget source="introduction" render="Label" position="10,280" size="540,21" zPosition="10" font="Regular;21" halign="center" valign="center" backgroundColor="#25062748" transparent="1"/>
+                       <widget name="VKeyIcon" pixmap="skin_default/buttons/key_text.png" position="10,280" zPosition="10" size="35,25" transparent="1" alphatest="on" />
+                       <widget name="HelpWindow" pixmap="skin_default/vkey_icon.png" position="160,250" zPosition="1" size="1,1" transparent="1" alphatest="on" />     
                </screen>"""
 
        def __init__(self, session, plugin_path, hostinfo = None ):
@@ -68,16 +67,17 @@ class UserDialog(Screen, ConfigListScreen):
                self.cache_file = '/etc/enigma2/' + self.hostinfo + '.cache' #Path to cache directory
                self.createConfig()
 
-               self["shortcuts"] = ActionMap(["ShortcutActions","WizardActions"],
+               self["actions"] = NumberActionMap(["SetupActions"],
                {
-                       "red": self.close,
-                       "back": self.close,
                        "ok": self.ok,
+                       "back": self.close,
+                       "cancel": self.close,
+                       "red": self.close,
                }, -2)
 
-               self["VirtualKB"] = ActionMap(["ShortcutActions","WizardActions"],
+               self["VirtualKB"] = ActionMap(["VirtualKeyboardActions"],
                {
-                       "green": self.KeyGreen,
+                       "showVirtualKeyboard": self.KeyText,
                }, -2)
 
                self.list = []
@@ -85,20 +85,16 @@ class UserDialog(Screen, ConfigListScreen):
                self.createSetup()
                self.onLayoutFinish.append(self.layoutFinished)
                # Initialize Buttons
-               self["ButtonGreen"] = Pixmap()
                self["VKeyIcon"] = Pixmap()
                self["HelpWindow"] = Pixmap()
-               self["introduction2"] = Label(_("Press OK to save settings."))
-               self["ButtonRed"] = Pixmap()
-               self["ButtonRedtext"] = Label(_("Close"))
+               self["introduction"] = StaticText(_("Press OK to save settings."))
+               self["key_red"] = StaticText(_("Close"))
 
        def layoutFinished(self):
-               print self["config"].getCurrent()
                self.setTitle(_("Enter user and password for host: ")+ self.hostinfo)
-               self["ButtonGreen"].show()
-               self["VKeyIcon"].show()
-               self["VirtualKB"].setEnabled(True)
-               self["HelpWindow"].show()
+               self["VKeyIcon"].hide()
+               self["VirtualKB"].setEnabled(False)
+               self["HelpWindow"].hide()
 
        # helper function to convert ips from a sring to a list of ints
        def convertIP(self, ip):
@@ -141,7 +137,7 @@ class UserDialog(Screen, ConfigListScreen):
                self["config"].l.setList(self.list)
                self["config"].onSelectionChanged.append(self.selectionChanged)
 
-       def KeyGreen(self):
+       def KeyText(self):
                if self["config"].getCurrent() == self.usernameEntry:
                        self.session.openWithCallback(lambda x : self.VirtualKeyBoardCallback(x, 'username'), VirtualKeyBoard, title = (_("Enter username:")), text = self.username.value)
                if self["config"].getCurrent() == self.passwordEntry:
@@ -150,11 +146,15 @@ class UserDialog(Screen, ConfigListScreen):
        def VirtualKeyBoardCallback(self, callback = None, entry = None):
                if callback is not None and len(callback) and entry is not None and len(entry):
                        if entry == 'username':
-                               self.username = NoSave(ConfigText(default = callback, visible_width = 50, fixed_size = False))
-                               self.createSetup()
+                               self.usernameEntry.setValue(callback)
+                               self["config"].invalidate(self.usernameEntry)
+                               #self.username = NoSave(ConfigText(default = callback, visible_width = 50, fixed_size = False))
+                               #self.createSetup()
                        if entry == 'password':
-                               self.password = NoSave(ConfigPassword(default = callback, visible_width = 50, fixed_size = False))
-                               self.createSetup()
+                               self.passwordEntry.setValue(callback)
+                               self["config"].invalidate(self.passwordEntry)
+                               #self.password = NoSave(ConfigPassword(default = callback, visible_width = 50, fixed_size = False))
+                               #self.createSetup()
 
        def newConfig(self):
                if self["config"].getCurrent() == self.InterfaceEntry:
index bd973b6..3e2a61d 100755 (executable)
@@ -2,7 +2,7 @@
 # for localized messages
 from __init__ import _
 from Screens.Screen import Screen
-from Components.Label import Label
+from Components.Sources.StaticText import StaticText
 from Components.Pixmap import Pixmap
 from Components.ActionMap import ActionMap
 from Components.Sources.List import List
@@ -14,8 +14,12 @@ from os import unlink, listdir, path as os_path
 
 class UserManager(Screen):
        skin = """
-               <screen name="UserManager" position="90,140" size="560,350" title="UserManager">
-                       <widget source="config" render="Listbox" position="10,10" size="540,220" scrollbarMode="showOnDemand">
+               <screen name="UserManager" position="center,center" size="560,400" title="UserManager">
+                       <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" alphatest="on" />
+                       <ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" alphatest="on" />
+                       <widget source="key_red" render="Label" position="0,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
+                       <widget source="key_yellow" render="Label" position="280,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" backgroundColor="#a08500" transparent="1" />
+                       <widget source="config" render="Listbox" position="5,50" size="540,220" scrollbarMode="showOnDemand">
                                <convert type="TemplatedMultiContent">
                                        {"template": [
                                                        MultiContentEntryText(pos = (80, 5), size = (400, 50), font=0, flags = RT_HALIGN_LEFT, text = 0), # index 0 is the name
@@ -26,12 +30,8 @@ class UserManager(Screen):
                                        }
                                </convert>
                        </widget>
-                       <widget name="introduction" position="50,270" size="500,20" zPosition="10" font="Regular;21" halign="center" transparent="1" />
-                       <widget name="ButtonRedtext" position="410,305" size="140,21" zPosition="10" font="Regular;21" transparent="1" />
-                       <widget name="ButtonRed" pixmap="skin_default/buttons/button_red.png" position="390,305" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                       <ePixmap pixmap="skin_default/buttons/button_yellow.png" position="30,305" zPosition="10" size="15,16" transparent="1" alphatest="on" />
-                       <widget name="deletetext" position="50,305" size="350,21" zPosition="10" font="Regular;21" transparent="1" />
-                       <ePixmap pixmap="skin_default/bottombar.png" position="10,250" size="540,120" zPosition="1" transparent="1" alphatest="on" />
+                       <ePixmap pixmap="skin_default/div-h.png" position="0,360" zPosition="1" size="560,2" />
+                       <widget source="introduction" render="Label" position="10,370" size="540,21" zPosition="10" font="Regular;21" halign="center" valign="center" backgroundColor="#25062748" transparent="1"/>
                </screen>"""
 
        def __init__(self, session, plugin_path):
@@ -46,10 +46,10 @@ class UserManager(Screen):
                        "red": self.exit,
                        "yellow": self.delete,
                })
-               self["ButtonRed"] = Pixmap()
-               self["ButtonRedtext"] = Label(_("Close"))
-               self["introduction"] = Label(_("Press OK to edit selected settings."))
-               self["deletetext"] = Label(_("Delete"))
+
+               self["key_red"] = StaticText(_("Close"))
+               self["introduction"] = StaticText(_("Press OK to edit selected settings."))
+               self["key_yellow"] = StaticText(_("Delete"))
 
                self.list = []
                self["config"] = List(self.list)