changeset 422:5a18c5f08d9b

Primitivus: Profile Manager: fixed redraw on profile change + use of AdvandedEdit for login field
author Goffi <goffi@goffi.org>
date Sun, 06 Nov 2011 15:19:51 +0100
parents 28e4299d4553
children 6c20c76abdcc
files frontends/src/primitivus/primitivus frontends/src/primitivus/profile_manager.py
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/primitivus/primitivus	Wed Nov 02 22:50:06 2011 +0100
+++ b/frontends/src/primitivus/primitivus	Sun Nov 06 15:19:51 2011 +0100
@@ -126,7 +126,10 @@
 
     def redraw(self):
         """redraw the screen"""
-        self.loop.draw_screen()
+        try:
+            self.loop.draw_screen()
+        except AttributeError:
+            pass
 
     def start(self):
         self.i = 0
--- a/frontends/src/primitivus/profile_manager.py	Wed Nov 02 22:50:06 2011 +0100
+++ b/frontends/src/primitivus/profile_manager.py	Sun Nov 06 15:19:51 2011 +0100
@@ -20,7 +20,7 @@
 """
 
 import urwid
-from urwid_satext.sat_widgets import Password,List,InputDialog,ConfirmDialog,Alert,FocusFrame
+from urwid_satext.sat_widgets import AdvancedEdit,Password,List,InputDialog,ConfirmDialog,Alert,FocusFrame
 from sat.tools.jid import JID
 
 
@@ -33,7 +33,7 @@
         profiles.sort()
         
         #login & password box must be created before list because of onProfileChange
-        self.login_wid = urwid.Edit(_('Login:'),align='center')
+        self.login_wid = AdvancedEdit(_('Login:'),align='center')
         self.pass_wid = Password(_('Password:'),align='center')
         
         self.list_profile = List(profiles, style=['single'], align='center', on_click=self.onProfileChange)
@@ -115,6 +115,7 @@
         if profile_name:
             self.host.bridge.asyncGetParamA("JabberID", "Connection", profile_key=profile_name, callback=setJID, errback=self.getParamError)
             self.host.bridge.asyncGetParamA("Password", "Connection", profile_key=profile_name, callback=setPassword, errback=self.getParamError)
+        self.host.redraw()
         
     def onConnectProfile(self, button):
         profile_name = self.list_profile.getSelectedValue()