Please review this at http://codereview.tryton.org/233005/
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
@@ -23,6 +23,7 @@
self.profiles = profiles
self.current_database = None
self.old_profile, self.current_profile = None, None
+ self.db_cache = None
self.updating_db = False
# GTK Stuffs
@@ -290,6 +291,8 @@
port = self.port_entry.get_text()
if not (host and port):
return
+ if (host, port, self.current_profile) == self.db_cache:
+ return
if self.updating_db:
return
if dbname is None:
@@ -307,6 +310,7 @@
def callback(dbs, createdb):
self.updating_db = False
+ self.db_cache = (host, port, self.current_profile)
if dbs is None and createdb is None:
pass
@@ -343,6 +347,7 @@
port = int(self.port_entry.get_text())
dia = DBCreate(host, port)
dbname = dia.run()
+ self.db_cache = None
self.username_entry.set_text('admin')
self.display_dbwidget(None, None, dbname)