Please review this at http://codereview.appspot.com/857042/show

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


Index: tryton/gui/window/dbcreate.py
===================================================================
--- a/tryton/gui/window/dbcreate.py
+++ b/tryton/gui/window/dbcreate.py
@@ -70,6 +70,8 @@
         except:
             self.server_connection_state(False)
             return False
+        CONFIG['login.server'] = host
+        CONFIG['login.port'] = port
         return True

     def event_passwd_clear(self, widget, event, data=None):
Index: tryton/gui/window/dbdumpdrop.py
===================================================================
--- a/tryton/gui/window/dbdumpdrop.py
+++ b/tryton/gui/window/dbdumpdrop.py
@@ -41,7 +41,9 @@
         if not res:
             return None
         host, port = res
-        DBBackupDrop.refreshlist(widget, db_widget, label, host, port)
+        if DBBackupDrop.refreshlist(widget, db_widget, label, host, port):
+            CONFIG['login.server'] = host
+            CONFIG['login.port'] = port
         return (host, port)

     def event_show_button_ok(self, widget, event, data=None):
Index: tryton/gui/window/dblogin.py
===================================================================
--- a/tryton/gui/window/dblogin.py
+++ b/tryton/gui/window/dblogin.py
@@ -143,8 +143,12 @@
         if not res:
             return False
         host, port = res
-        return DBLogin.refreshlist(widget, db_widget, label, button,
host, port,
+        res = DBLogin.refreshlist(widget, db_widget, label, button,
host, port,
                 butconnect)
+        if res:
+            CONFIG['login.server'] = host
+            CONFIG['login.port'] = port
+        return res

     def db_create(self, widget):
         dia = DBCreate()



-- 
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: pgpTltdxXUpJ0.pgp
Description: PGP signature

Reply via email to