From 7b40b63a3d185cec1f2f6e59eebb31ad01ec6ff1 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Mon, 9 Nov 2015 20:06:36 +0900 Subject: [PATCH 1/3] Refresh all amount edits when units change. Improved version of prior commit. --- gui/qt/amountedit.py | 2 +- gui/qt/main_window.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gui/qt/amountedit.py b/gui/qt/amountedit.py index fd1ab74e55ae..c5ef3ab8ff9f 100644 --- a/gui/qt/amountedit.py +++ b/gui/qt/amountedit.py @@ -95,7 +95,7 @@ def get_amount(self): def setAmount(self, amount): if amount is None: - self.setText("") + self.setText(" ") # Space forces repaint in case units changed else: self.setText(format_satoshis_plain(amount, self.decimal_point())) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index ca507602a65f..9affe2669f63 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -2686,6 +2686,8 @@ def on_unit(x): unit_result = units[unit_combo.currentIndex()] if self.base_unit() == unit_result: return + edits = self.amount_e, self.fee_e, self.receive_amount_e, fee_e + amounts = [edit.get_amount() for edit in edits] if unit_result == 'BTC': self.decimal_point = 8 elif unit_result == 'mBTC': @@ -2698,8 +2700,8 @@ def on_unit(x): self.history_list.update() self.receive_list.update() self.address_list.update() - self.do_clear() - fee_e.setAmount(self.wallet.fee_per_kb(self.config)) + for edit, amount in zip(edits, amounts): + edit.setAmount(amount) self.update_status() unit_combo.currentIndexChanged.connect(on_unit) gui_widgets.append((unit_label, unit_combo)) From 1abc5412cd924bd2ae65cb608022e460227272e2 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Mon, 9 Nov 2015 22:53:27 +0900 Subject: [PATCH 2/3] Add self to AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 29c23f6a9edb..9cff06784e0c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,3 +9,4 @@ Genjix - Porting pro-mode functionality to lite-gui and worked on server Slush - Work on the server. Designed the original Stratum spec. Julian Toash (Tuxavant) - Various fixes to the client. rdymac - Website and translations. +kyuupichan - Miscellaneous. \ No newline at end of file From 55fafc35c11298cd0469271358c65262cf2935ee Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 9 Nov 2015 16:09:57 +0100 Subject: [PATCH 3/3] fix json_encode with python console --- gui/qt/console.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gui/qt/console.py b/gui/qt/console.py index 62e65673e13c..16ac901951d2 100644 --- a/gui/qt/console.py +++ b/gui/qt/console.py @@ -213,10 +213,9 @@ def write(self, text): try: # eval is generally considered bad practice. use it wisely! result = eval(command, self.namespace, self.namespace) - result = util.json_encode(result) if result != None: if self.is_json: - util.print_msg(result) + util.print_msg(util.json_encode(result)) else: self.appendPlainText(repr(result)) except SyntaxError: