electrum

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

commit d1f4804962c46cb873e3bcc4608a0423291f18b3
parent d35791ff65672ff6d06462da115c5f374d023e1d
Author: ThomasV <thomasv@electrum.org>
Date:   Wed, 16 Oct 2019 11:06:12 +0200

misc Qt fixes
 - improve layout of send tab
 - use tabs to show receive widgets
 - add menu item to copy address from request
 - show copied content in copy dialog

Diffstat:
Melectrum/gui/qt/main_window.py | 27+++++++++++++--------------
Melectrum/gui/qt/request_list.py | 1+
2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py @@ -1014,14 +1014,14 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): vbox_g.addLayout(grid) vbox_g.addStretch() - hbox_r = QHBoxLayout() - hbox_r.addWidget(self.receive_qr) - hbox_r.addWidget(self.receive_address_e) + self.receive_widgets = QTabWidget() + self.receive_widgets.addTab(self.receive_qr, 'QR Code') + self.receive_widgets.addTab(self.receive_address_e, 'Text') hbox = QHBoxLayout() hbox.addLayout(vbox_g) hbox.addStretch() - hbox.addLayout(hbox_r) + hbox.addWidget(self.receive_widgets) w = QWidget() w.searchable_list = self.request_list @@ -1108,8 +1108,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): def do_copy(self, title, content): self.app.clipboard().setText(content) - self.show_message(_("{} copied to clipboard").format(title)) - #QToolTip.showText(QCursor.pos(), _("{} copied to clipboard").format(title), self.parent) + self.show_message(_(f"{title} copied to clipboard:\n\n{content}")) def export_payment_request(self, addr): r = self.wallet.receive_requests.get(addr) @@ -1209,6 +1208,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): description_label = HelpLabel(_('Description'), msg) grid.addWidget(description_label, 2, 0) self.message_e = MyLineEdit() + self.message_e.setMinimumWidth(700) grid.addWidget(self.message_e, 2, 1, 1, -1) msg = _('Amount to be sent.') + '\n\n' \ @@ -1227,12 +1227,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): lambda: self.fiat_send_e.setFrozen(self.amount_e.isReadOnly())) self.max_button = EnterButton(_("Max"), self.spend_max) - self.max_button.setFixedWidth(self.amount_e.width()) + self.max_button.setFixedWidth(100) self.max_button.setCheckable(True) grid.addWidget(self.max_button, 3, 3) - hbox = QHBoxLayout() - hbox.addStretch(1) - grid.addLayout(hbox, 3, 4) self.from_label = QLabel(_('From')) grid.addWidget(self.from_label, 4, 0) @@ -1347,13 +1344,14 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): self.preview_button.setToolTip(_('Display the details of your transaction before signing it.')) self.send_button = EnterButton(_("Send"), self.do_pay) self.clear_button = EnterButton(_("Clear"), self.do_clear) + buttons = QHBoxLayout() buttons.addStretch(1) - buttons.addWidget(self.save_button) buttons.addWidget(self.clear_button) + buttons.addWidget(self.save_button) buttons.addWidget(self.preview_button) buttons.addWidget(self.send_button) - grid.addLayout(buttons, 6, 1, 1, 3) + grid.addLayout(buttons, 6, 1, 1, 4) self.amount_e.shortcut.connect(self.spend_max) self.payto_e.textChanged.connect(self.update_fee) @@ -1415,6 +1413,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): vbox0.addLayout(grid) hbox = QHBoxLayout() hbox.addLayout(vbox0) + hbox.addStretch(1) w = QWidget() vbox = QVBoxLayout(w) vbox.addLayout(hbox) @@ -2017,8 +2016,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): self.show_send_tab_onchain_fees(b) def show_send_tab_onchain_fees(self, b: bool): - self.feecontrol_fields.setVisible(b) - self.fee_e_label.setVisible(b) + self.feecontrol_fields.setEnabled(b) + #self.fee_e_label.setVisible(b) def pay_to_URI(self, URI): if not URI: diff --git a/electrum/gui/qt/request_list.py b/electrum/gui/qt/request_list.py @@ -176,6 +176,7 @@ class RequestList(MyTreeView): menu.addAction(_("Copy Request"), lambda: self.parent.do_copy('Lightning Request', req['invoice'])) else: menu.addAction(_("Copy Request"), lambda: self.parent.do_copy('Bitcoin URI', req['URI'])) + menu.addAction(_("Copy Address"), lambda: self.parent.do_copy('Bitcoin Address', req['address'])) if 'view_url' in req: menu.addAction(_("View in web browser"), lambda: webopen(req['view_url'])) menu.addAction(_("Delete"), lambda: self.parent.delete_request(key))