diff --git a/CHANGELOG b/CHANGELOG index b221bddb00..ad30f3f346 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Add checkbox on restore to update database * Add 'login.host' options to hide server connection * Handle required attribute with local domains * Allow to run wizard in tabs diff --git a/tryton/gui/main.py b/tryton/gui/main.py index f1e474b7c0..7715c34b38 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -1455,7 +1455,7 @@ class Main(object): if not filename: return dialog = DBRestore(self.window, filename=filename) - url, dbname, passwd = dialog.run(self.window) + url, dbname, passwd, update = dialog.run(self.window) if dbname: file_p = file(filename, 'rb') data_b64 = base64.encodestring(file_p.read()) @@ -1463,7 +1463,7 @@ class Main(object): host, port = url.rsplit(':' , 1) try: res = rpc.db_exec(host, int(port), 'restore', dbname, passwd, \ - data_b64) + data_b64, update) except Exception, exception: self.refresh_ssl() if exception[0] == \ diff --git a/tryton/gui/window/dbrestore.py b/tryton/gui/window/dbrestore.py index 6a8f21cd87..04b8eb663c 100644 --- a/tryton/gui/window/dbrestore.py +++ b/tryton/gui/window/dbrestore.py @@ -70,7 +70,7 @@ class DBRestore(object): vbox = gtk.VBox() self.dialog.vbox.pack_start(vbox) self.tooltips = common.Tooltips() - table = gtk.Table(5, 3, False) + table = gtk.Table(6, 3, False) table.set_border_width(9) table.set_row_spacings(3) table.set_col_spacings(3) @@ -141,6 +141,12 @@ class DBRestore(object): label_db_name = gtk.Label(_("New Database Name:")) label_db_name.set_alignment(1, 0.5) table.attach(label_db_name, 0, 1, 4, 5, yoptions=gtk.FILL) + label_db_update = gtk.Label(_('Update Database:')) + label_db_update.set_alignment(1, 0.5) + table.attach(label_db_update, 0, 1, 5, 6, yoptions=gtk.FILL) + self.check_update = gtk.CheckButton() + self.check_update.set_active(True) + table.attach(self.check_update, 1, 3, 5, 6, yoptions=gtk.FILL) # Buttons and events self.dialog.connect("key-press-event", \ self.event_show_button_restore) @@ -181,6 +187,7 @@ class DBRestore(object): database = False passwd = False url = False + update = False #TODO: This needs to be unified with the other widgets self.button_server_change.connect_after('clicked', \ lambda a, b: common.request_server(b, self.dialog), \ @@ -190,6 +197,7 @@ class DBRestore(object): database = self.entry_db_name.get_text() url = self.entry_server_url.get_text() passwd = self.entry_server_password.get_text() + update = self.check_update.get_active() break else: self.dialog.destroy() @@ -198,4 +206,4 @@ class DBRestore(object): parent.present() self.dialog.destroy() - return url, database, passwd + return url, database, passwd, update