Please review this at http://codereview.appspot.com/4273054/

Affected files:
  M tryton/gui/window/dblogin.py


Index: tryton/gui/window/dblogin.py
===================================================================
--- a/tryton/gui/window/dblogin.py
+++ b/tryton/gui/window/dblogin.py
@@ -389,6 +389,8 @@
         self.combo_profile.add_attribute(cell, 'sensitive', 1)
         self.combo_profile.set_model(self.profile_store)
         self.combo_profile.connect('changed', self.profile_changed)
+        self.combo_profile.connect('move-active', self.profile_move_active)
+        self.move_active = False
         self.profile_label = gtk.Label(_(u'Profile:'))
         self.profile_label.set_justify(gtk.JUSTIFY_RIGHT)
         self.profile_label.set_alignment(1, 0.5)
@@ -456,10 +458,16 @@
             username = ''
         if username:
             self.entry_login.set_text(username)
-            self.entry_password.grab_focus()
+            focus_widget = self.entry_password
         else:
             self.entry_login.set_text('')
-            self.entry_login.grab_focus()
+            focus_widget = self.entry_login
+        if not self.move_active:
+            focus_widget.grab_focus()
+        self.move_active = False
+
+    def profile_move_active(self, combobox, scrolltype):
+        self.move_active = True

     def run(self, profile_name, parent):
         if not profile_name:



-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgpqnyTbImIqB.pgp
Description: PGP signature

Reply via email to