diff frontends/primitivus/profile_manager.py @ 119:ded2431cea5a

Primitivus: chat window / text sending. Primitivus has now the most basics features \o/ - core: new getVersion method - primitivus: new debug key (C-d), only work if SàT is in dev version (D in version) - quick_app: new post_init method, used for automatique task like auto-plug - primitivus: lists now use genericList (Box) or List (Flow) - primitivus: List now manage correctly its size - primitivus: new FocusFrame widget which manage focus changing with 'tab' - primitivus: advancedEdit now manage 'click' signal - primitivus: contactList now manager 'change' and 'click' signals - primitivus: Chat window now working
author Goffi <goffi@goffi.org>
date Mon, 05 Jul 2010 19:13:36 +0800
parents 1f0fd6f03e2b
children 2240f34f6452
line wrap: on
line diff
--- a/frontends/primitivus/profile_manager.py	Sat Jul 03 13:56:44 2010 +0800
+++ b/frontends/primitivus/profile_manager.py	Mon Jul 05 19:13:36 2010 +0800
@@ -20,7 +20,7 @@
 """
 
 import urwid
-from custom_widgets import Password,List,InputDialog,ConfirmDialog,Alert
+from custom_widgets import Password,List,InputDialog,ConfirmDialog,Alert,FocusFrame
 
 
 class ProfileManager(urwid.WidgetWrap):
@@ -35,7 +35,7 @@
         self.login_wid = urwid.Edit(_('Login:'),align='center')
         self.pass_wid = Password(_('Password:'),align='center')
         
-        self.list_profile = List(profiles, style=['single'], align='center', on_state_change=self.onProfileChange)
+        self.list_profile = List(profiles, style=['single'], align='center', on_click=self.onProfileChange)
 
         #toto = urwid.Padding(urwid.Text('toto'), align='center')
 
@@ -74,7 +74,7 @@
         self.host.removePopUp()
 
     def deleteProfile(self, button):
-        profile_name = self.list_profile.getValue()
+        profile_name = self.list_profile.getSelectedValue()
         if profile_name:
             self.host.bridge.deleteProfile(profile_name)
             self.__refillProfiles()
@@ -86,11 +86,11 @@
         self.host.showPopUp(pop_up_widget)
 
     def onDeleteProfile(self, e):
-        pop_up_widget = ConfirmDialog(_("Are you sure you want to delete the profile %s ?") % self.list_profile.getValue(), no_cb=self.cancelDialog, yes_cb=self.deleteProfile)
+        pop_up_widget = ConfirmDialog(_("Are you sure you want to delete the profile %s ?") % self.list_profile.getSelectedValue(), no_cb=self.cancelDialog, yes_cb=self.deleteProfile)
         self.host.showPopUp(pop_up_widget)
 
     def onProfileChange(self, list_wid):
-        profile_name = list_wid.getValue()
+        profile_name = list_wid.getSelectedValue()
         if profile_name:
             jabberID = self.host.bridge.getParamA("JabberID", "Connection", profile_key=profile_name)
             password = self.host.bridge.getParamA("Password", "Connection", profile_key=profile_name)
@@ -98,7 +98,7 @@
             self.pass_wid.set_edit_text(password)
         
     def onConnectProfile(self, button):
-        profile_name = self.list_profile.getValue()
+        profile_name = self.list_profile.getSelectedValue()
         if not profile_name:
             pop_up_widget = Alert(_('No profile selected'), _('You need to create and select a profile before connecting'), ok_cb=self.cancelDialog)
             self.host.showPopUp(pop_up_widget)