Skip to content

Commit 2607a0d

Browse files
committed
Plugins dialog: remove direct download option.
Since users have to trust plugin publishers, we should expect the plugin to be signed by its author, and the user to verify the signature before installing.
1 parent d7f6820 commit 2607a0d

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

electrum/gui/qt/plugins_dialog.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,7 @@ def __init__(self, config: 'SimpleConfig', plugins: 'Plugins', *, gui_object: Op
177177
vbox.addWidget(scroll)
178178
add_button = QPushButton(_('Add'))
179179
add_button.setMinimumWidth(40) # looks better on windows, no difference on linux
180-
menu = QMenu()
181-
menu.addAction(_('Local ZIP file'), self.add_plugin_dialog)
182-
menu.addAction(_('Download ZIP file'), self.download_plugin_dialog)
183-
add_button.setMenu(menu)
180+
add_button.clicked.connect(self.add_plugin_dialog)
184181
vbox.addLayout(Buttons(add_button, CloseButton(self)))
185182
self.show_list()
186183

@@ -271,28 +268,6 @@ def on_auto_setup_clicked():
271268
if self.show_message(msg, buttons=buttons) or exit_dialog:
272269
break
273270

274-
def download_plugin_dialog(self):
275-
from .util import line_dialog
276-
from electrum.util import UserCancelled
277-
pubkey, salt = self.plugins.get_pubkey_bytes()
278-
if not pubkey:
279-
self.init_plugins_password()
280-
return
281-
url = line_dialog(self, 'url', _('Enter plugin URL'), _('Download'))
282-
if not url:
283-
return
284-
coro = self.plugins.download_external_plugin(url)
285-
try:
286-
d = RunCoroutineDialog(self, _("Downloading plugin..."), coro)
287-
path = d.run()
288-
except UserCancelled:
289-
return
290-
except Exception as e:
291-
self._logger.exception("")
292-
self.show_error(f"{e}")
293-
return
294-
self._try_add_external_plugin_from_path(path)
295-
296271
def add_plugin_dialog(self):
297272
pubkey, salt = self.plugins.get_pubkey_bytes()
298273
if not pubkey:

0 commit comments

Comments
 (0)