tdefine frozen signal for exchange rate plugin - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit f4dfec4565af18094e2626f4b0ba174cabf330e1 DIR parent c742e8c5cff5b89893939488c65942ea8e5a9a6c HTML Author: ThomasV <thomasv@gitorious> Date: Tue, 24 Jun 2014 17:44:31 +0200 define frozen signal for exchange rate plugin Diffstat: M gui/qt/amountedit.py | 2 ++ M gui/qt/main_window.py | 1 + M gui/qt/paytoedit.py | 2 ++ M plugins/exchange_rate.py | 1 + 4 files changed, 6 insertions(+), 0 deletions(-) --- DIR diff --git a/gui/qt/amountedit.py b/gui/qt/amountedit.py t@@ -6,10 +6,12 @@ from PyQt4.QtGui import * from decimal import Decimal class MyLineEdit(QLineEdit): + frozen = pyqtSignal() def setFrozen(self, b): self.setReadOnly(b) self.setFrame(not b) + self.frozen.emit() class AmountEdit(MyLineEdit): DIR diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py t@@ -872,6 +872,7 @@ class ElectrumWindow(QMainWindow): fee = self.wallet.estimated_fee(inputs, 1) amount = total - fee self.amount_e.setAmount(amount) + self.amount_e.textEdited.emit("") self.fee_e.setAmount(fee) return DIR diff --git a/gui/qt/paytoedit.py b/gui/qt/paytoedit.py t@@ -123,6 +123,8 @@ class PayToEdit(QRTextEdit): else: self.amount_edit.setText("") + self.amount_edit.textEdited.emit("") + if total or len(lines)>1: self.lock_amount() else: DIR diff --git a/plugins/exchange_rate.py b/plugins/exchange_rate.py t@@ -661,4 +661,5 @@ class Plugin(BasePlugin): if fiat_amount is not None: self.fiat_e.setText("%.2f"%fiat_amount) self.btc_e.textEdited.connect(btc_changed) + self.btc_e.frozen.connect(lambda: self.fiat_e.setFrozen(self.btc_e.isReadOnly())) self.win.send_grid.addWidget(self.fiat_e, 4, 3, Qt.AlignHCenter)