From cec20899175aa359407236b7f1749e77c69a524d Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 7 May 2025 09:30:58 +0200 Subject: [PATCH] revealer plugin: do not add icon to status bar timelock_recovery: move help button to the top --- electrum/plugins/revealer/qt.py | 12 +++++------- electrum/plugins/timelock_recovery/qt.py | 16 +++++++++++----- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/electrum/plugins/revealer/qt.py b/electrum/plugins/revealer/qt.py index 4a766f998..bb19aa7de 100644 --- a/electrum/plugins/revealer/qt.py +++ b/electrum/plugins/revealer/qt.py @@ -98,12 +98,10 @@ class Plugin(RevealerPlugin): QFontDatabase.addApplicationFont(os.path.join(os.path.dirname(__file__), 'DejaVuSansMono-Bold.ttf')) @hook - def create_status_bar(self, sb): - b = StatusBarButton( - read_QIcon_from_bytes(self.icon_bytes), - "Revealer "+_("Visual Cryptography Plugin"), - partial(self.setup_dialog, sb), sb.height()) - sb.addPermanentWidget(b) + def init_menubar(self, window): + ma = window.wallet_menu.addAction('Revealer', partial(self.setup_dialog, window)) + icon = read_QIcon_from_bytes(self.icon_bytes) + ma.setIcon(icon) def requires_settings(self): return True @@ -131,7 +129,7 @@ class Plugin(RevealerPlugin): return keystore.get_seed(password) def setup_dialog(self, window): - self.wallet = window.parent().wallet + self.wallet = window.wallet self.update_wallet_name(self.wallet) self.user_input = False diff --git a/electrum/plugins/timelock_recovery/qt.py b/electrum/plugins/timelock_recovery/qt.py index be8320c26..19aad6d41 100644 --- a/electrum/plugins/timelock_recovery/qt.py +++ b/electrum/plugins/timelock_recovery/qt.py @@ -192,18 +192,22 @@ class Plugin(TimelockRecoveryPlugin): plan_dialog.close() return - plan_grid = QGridLayout() - plan_grid.setSpacing(8) - grid_row = 0 - + title_hbox = QHBoxLayout() + title_hbox.addWidget(QLabel(_('To create a recovery plan, enter a recipient and a cancellation time window'))) + title_hbox.addStretch(1) help_button = QPushButton(_("Help")) help_button.clicked.connect(lambda: self.create_intro_dialog(context)) + title_hbox.addWidget(help_button) next_button = QPushButton(_("Next"), plan_dialog) next_button.clicked.connect(plan_dialog.close) next_button.clicked.connect(lambda: self.start_plan(context)) next_button.setEnabled(False) + plan_grid = QGridLayout() + plan_grid.setSpacing(8) + grid_row = 0 + payto_e = PayToEdit(context.main_window.send_tab) # Reuse configuration from send tab payto_e.toggle_paytomany() @@ -349,8 +353,10 @@ class Plugin(TimelockRecoveryPlugin): # Create a VBox layout for the main contents of the dialog. vbox_layout = QVBoxLayout() + vbox_layout.addLayout(title_hbox) + vbox_layout.addStretch(1) vbox_layout.addLayout(plan_grid, stretch=1) - vbox_layout.addLayout(Buttons(help_button, next_button)) + vbox_layout.addLayout(Buttons(next_button)) # Populate the HBox layout. hbox_layout.addWidget(logo_label)