electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit fec96775089a1831a49bbd1a0e7d06d29b2d4021
parent cd9477c0da88288c6b92f430b533bf3026c84b67
Author: SomberNight <somber.night@protonmail.com>
Date:   Wed, 20 Nov 2019 18:00:45 +0100

qt open channel: minor dialog fixes

Diffstat:
Melectrum/gui/qt/amountedit.py | 4++--
Melectrum/gui/qt/channels_list.py | 10++++++----
Melectrum/gui/qt/main_window.py | 4++--
3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/electrum/gui/qt/amountedit.py b/electrum/gui/qt/amountedit.py @@ -13,7 +13,7 @@ from electrum.util import (format_satoshis_plain, decimal_point_to_base_unit_nam FEERATE_PRECISION, quantize_feerate) -class MyLineEdit(QLineEdit): +class FreezableLineEdit(QLineEdit): frozen = pyqtSignal() def setFrozen(self, b): @@ -21,7 +21,7 @@ class MyLineEdit(QLineEdit): self.setFrame(not b) self.frozen.emit() -class AmountEdit(MyLineEdit): +class AmountEdit(FreezableLineEdit): shortcut = pyqtSignal() def __init__(self, base_unit, is_int=False, parent=None): diff --git a/electrum/gui/qt/channels_list.py b/electrum/gui/qt/channels_list.py @@ -13,7 +13,7 @@ from electrum.wallet import Abstract_Wallet from electrum.lnutil import LOCAL, REMOTE, format_short_channel_id, LN_MAX_FUNDING_SAT from .util import MyTreeView, WindowModalDialog, Buttons, OkButton, CancelButton, EnterButton, WaitingDialog -from .amountedit import BTCAmountEdit +from .amountedit import BTCAmountEdit, FreezableLineEdit from .channel_details import ChannelDetailsDialog @@ -163,22 +163,24 @@ class ChannelsList(MyTreeView): d = WindowModalDialog(self.parent, _('Open Channel')) vbox = QVBoxLayout(d) vbox.addWidget(QLabel(_('Enter Remote Node ID or connection string or invoice'))) - local_nodeid = QLineEdit() + local_nodeid = FreezableLineEdit() local_nodeid.setMinimumWidth(700) local_nodeid.setText(bh2u(lnworker.node_keypair.pubkey)) - local_nodeid.setReadOnly(True) + local_nodeid.setFrozen(True) local_nodeid.setCursorPosition(0) remote_nodeid = QLineEdit() remote_nodeid.setMinimumWidth(700) amount_e = BTCAmountEdit(self.parent.get_decimal_point) # max button def spend_max(): + amount_e.setFrozen(max_button.isChecked()) + if not max_button.isChecked(): + return make_tx = self.parent.mktx_for_open_channel('!') tx = make_tx(None) amount = tx.output_value() amount = min(amount, LN_MAX_FUNDING_SAT) amount_e.setAmount(amount) - amount_e.setFrozen(True) max_button = EnterButton(_("Max"), spend_max) max_button.setFixedWidth(100) max_button.setCheckable(True) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py @@ -77,7 +77,7 @@ from electrum.util import pr_expiration_values from electrum.lnutil import ln_dummy_address from .exception_window import Exception_Hook -from .amountedit import AmountEdit, BTCAmountEdit, MyLineEdit, FeerateEdit +from .amountedit import AmountEdit, BTCAmountEdit, FreezableLineEdit, FeerateEdit from .qrcodewidget import QRCodeWidget, QRDialog from .qrtextedit import ShowQRTextEdit, ScanQRTextEdit from .transaction_dialog import show_transaction @@ -1212,7 +1212,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): + _('The description is not sent to the recipient of the funds. It is stored in your wallet file, and displayed in the \'History\' tab.') description_label = HelpLabel(_('Description'), msg) grid.addWidget(description_label, 2, 0) - self.message_e = MyLineEdit() + self.message_e = FreezableLineEdit() self.message_e.setMinimumWidth(700) grid.addWidget(self.message_e, 2, 1, 1, -1)