Primitivus: Profile Manager: fixed redraw on profile change + use of AdvandedEdit for login field

This commit is contained in:
Goffi 2011-11-06 15:19:51 +01:00
commit 8ac5759a5f
2 changed files with 7 additions and 3 deletions

View file

@ -126,7 +126,10 @@ class PrimitivusApp(QuickApp):
def redraw(self):
"""redraw the screen"""
self.loop.draw_screen()
try:
self.loop.draw_screen()
except AttributeError:
pass
def start(self):
self.i = 0

View file

@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
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 @@ class ProfileManager(urwid.WidgetWrap):
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 @@ class ProfileManager(urwid.WidgetWrap):
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()