From c9128b3ef4b3836c7a7d8e6a7f81e99a824f0f1f Mon Sep 17 00:00:00 2001 From: silkyjohnson1 <61355155+silkyjohnson1@users.noreply.github.com> Date: Tue, 27 Feb 2024 08:11:08 -0500 Subject: [PATCH 1/2] Update main_window.py --- electrum/gui/qt/main_window.py | 76 +++++++++++++++++----------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index b07764998..7cd8dcae7 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -1577,12 +1577,12 @@ def create_status_bar(self): self.search_box.hide() sb.addPermanentWidget(self.search_box) - self.update_check_button = QPushButton("") - self.update_check_button.setFlat(True) - self.update_check_button.setCursor(QCursor(Qt.PointingHandCursor)) - self.update_check_button.setIcon(read_QIcon("update.png")) - self.update_check_button.hide() - sb.addPermanentWidget(self.update_check_button) + #self.update_check_button = QPushButton("") + #self.update_check_button.setFlat(True) + #self.update_check_button.setCursor(QCursor(Qt.PointingHandCursor)) + #self.update_check_button.setIcon(read_QIcon("update.png")) + #self.update_check_button.hide() + #sb.addPermanentWidget(self.update_check_button) self.tasks_label = QLabel('') sb.addPermanentWidget(self.tasks_label) @@ -2483,38 +2483,38 @@ def enable_settings_widget(p: Optional['BasePlugin'], name: str, i: int): widget = settings_widgets[name] = p.settings_widget(d) grid.addWidget(widget, i, 1) - def do_toggle(cb, name, i): - p = plugins.toggle(name) - cb.setChecked(bool(p)) - enable_settings_widget(p, name, i) - # note: all enabled plugins will receive this hook: - run_hook('init_qt', self.gui_object) - - for i, descr in enumerate(plugins.descriptions.values()): - full_name = descr['__name__'] - prefix, _separator, name = full_name.rpartition('.') - p = plugins.get(name) - if descr.get('registers_keystore'): - continue - try: - cb = QCheckBox(descr['fullname']) - plugin_is_loaded = p is not None - cb_enabled = (not plugin_is_loaded and plugins.is_available(name, self.wallet) - or plugin_is_loaded and p.can_user_disable()) - cb.setEnabled(cb_enabled) - cb.setChecked(plugin_is_loaded and p.is_enabled()) - grid.addWidget(cb, i, 0) - enable_settings_widget(p, name, i) - cb.clicked.connect(partial(do_toggle, cb, name, i)) - msg = descr['description'] - if descr.get('requires'): - msg += '\n\n' + _('Requires') + ':\n' + '\n'.join(map(lambda x: x[1], descr.get('requires'))) - grid.addWidget(HelpButton(msg), i, 2) - except Exception: - self.logger.exception(f"cannot display plugin {name}") - grid.setRowStretch(len(plugins.descriptions.values()), 1) - vbox.addLayout(Buttons(CloseButton(d))) - d.exec_() + # def do_toggle(cb, name, i): + # p = plugins.toggle(name) + # cb.setChecked(bool(p)) + # enable_settings_widget(p, name, i) + # # note: all enabled plugins will receive this hook: + # run_hook('init_qt', self.gui_object) + # + # for i, descr in enumerate(plugins.descriptions.values()): + # full_name = descr['__name__'] + # prefix, _separator, name = full_name.rpartition('.') + # p = plugins.get(name) + # if descr.get('registers_keystore'): + # continue + # try: + # cb = QCheckBox(descr['fullname']) + # plugin_is_loaded = p is not None + # cb_enabled = (not plugin_is_loaded and plugins.is_available(name, self.wallet) + # or plugin_is_loaded and p.can_user_disable()) + # cb.setEnabled(cb_enabled) + # cb.setChecked(plugin_is_loaded and p.is_enabled()) + # grid.addWidget(cb, i, 0) + # enable_settings_widget(p, name, i) + # cb.clicked.connect(partial(do_toggle, cb, name, i)) + # msg = descr['description'] + # if descr.get('requires'): + # msg += '\n\n' + _('Requires') + ':\n' + '\n'.join(map(lambda x: x[1], descr.get('requires'))) + # grid.addWidget(HelpButton(msg), i, 2) + # except Exception: + # self.logger.exception(f"cannot display plugin {name}") + # grid.setRowStretch(len(plugins.descriptions.values()), 1) + # vbox.addLayout(Buttons(CloseButton(d))) + # d.exec_() def cpfp_dialog(self, parent_tx: Transaction) -> None: new_tx = self.wallet.cpfp(parent_tx, 0) From 6dccfc8b089494ff1258ba5b9f49bf0e9a9c4e56 Mon Sep 17 00:00:00 2001 From: silkyjohnson1 <61355155+silkyjohnson1@users.noreply.github.com> Date: Tue, 27 Feb 2024 08:14:05 -0500 Subject: [PATCH 2/2] Update main_window.py --- electrum/gui/qt/main_window.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index 7cd8dcae7..9cd80226b 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -2471,18 +2471,18 @@ def plugins_dialog(self): settings_widgets = {} - def enable_settings_widget(p: Optional['BasePlugin'], name: str, i: int): - widget = settings_widgets.get(name) # type: Optional[QWidget] - if widget and not p: - # plugin got disabled, rm widget - grid.removeWidget(widget) - widget.setParent(None) - settings_widgets.pop(name) - elif widget is None and p and p.requires_settings() and p.is_enabled(): - # plugin got enabled, add widget - widget = settings_widgets[name] = p.settings_widget(d) - grid.addWidget(widget, i, 1) - + # def enable_settings_widget(p: Optional['BasePlugin'], name: str, i: int): + # widget = settings_widgets.get(name) # type: Optional[QWidget] + # if widget and not p: + # # plugin got disabled, rm widget + # grid.removeWidget(widget) + # widget.setParent(None) + # settings_widgets.pop(name) + # elif widget is None and p and p.requires_settings() and p.is_enabled(): + # # plugin got enabled, add widget + # widget = settings_widgets[name] = p.settings_widget(d) + # grid.addWidget(widget, i, 1) + # # def do_toggle(cb, name, i): # p = plugins.toggle(name) # cb.setChecked(bool(p))