plugins: minor tweaks
- add icon to PluginDialog - add icon to psbt_nosr - rename 'PSBT Nostr' as 'Nostr Multisig'
This commit is contained in:
@@ -9,6 +9,7 @@ from PyQt6.QtCore import Qt
|
|||||||
from electrum.i18n import _
|
from electrum.i18n import _
|
||||||
|
|
||||||
from .util import WindowModalDialog, Buttons, CloseButton, WWLabel, insert_spaces, MessageBoxMixin, EnterButton
|
from .util import WindowModalDialog, Buttons, CloseButton, WWLabel, insert_spaces, MessageBoxMixin, EnterButton
|
||||||
|
from .util import read_QIcon_from_bytes, IconLabel
|
||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@@ -25,8 +26,9 @@ class PluginDialog(WindowModalDialog):
|
|||||||
author = metadata.get('author', '')
|
author = metadata.get('author', '')
|
||||||
description = metadata.get('description', '')
|
description = metadata.get('description', '')
|
||||||
requires = metadata.get('requires')
|
requires = metadata.get('requires')
|
||||||
version = metadata.get('version', 'n/a')
|
version = metadata.get('version')
|
||||||
zip_hash = metadata.get('zip_hash_sha256', None)
|
zip_hash = metadata.get('zip_hash_sha256', None)
|
||||||
|
icon_path = metadata.get('icon')
|
||||||
|
|
||||||
WindowModalDialog.__init__(self, window, 'Plugin')
|
WindowModalDialog.__init__(self, window, 'Plugin')
|
||||||
self.setMinimumSize(400, 250)
|
self.setMinimumSize(400, 250)
|
||||||
@@ -37,17 +39,26 @@ class PluginDialog(WindowModalDialog):
|
|||||||
self.status_button = status_button
|
self.status_button = status_button
|
||||||
p = self.plugins.get(name) # is enabled
|
p = self.plugins.get(name) # is enabled
|
||||||
vbox = QVBoxLayout(self)
|
vbox = QVBoxLayout(self)
|
||||||
|
name_label = IconLabel(text=display_name, reverse=True)
|
||||||
|
if icon_path:
|
||||||
|
name_label.icon_size = 64
|
||||||
|
icon = read_QIcon_from_bytes(self.plugins.read_file(name, icon_path))
|
||||||
|
name_label.setIcon(icon)
|
||||||
|
vbox.addWidget(name_label)
|
||||||
form = QFormLayout(None)
|
form = QFormLayout(None)
|
||||||
form.addRow(QLabel(_('Name') + ':'), QLabel(display_name))
|
if author:
|
||||||
form.addRow(QLabel(_('Author') + ':'), QLabel(author))
|
form.addRow(QLabel(_('Author') + ':'), QLabel(author))
|
||||||
form.addRow(QLabel(_('Description') + ':'), WWLabel(description))
|
if description:
|
||||||
form.addRow(QLabel(_('Version') + ':'), QLabel(version))
|
form.addRow(QLabel(_('Description') + ':'), WWLabel(description))
|
||||||
|
if version:
|
||||||
|
form.addRow(QLabel(_('Version') + ':'), QLabel(version))
|
||||||
if zip_hash:
|
if zip_hash:
|
||||||
form.addRow(QLabel('Hash [sha256]:'), WWLabel(insert_spaces(zip_hash, 8)))
|
form.addRow(QLabel('Hash [sha256]:'), WWLabel(insert_spaces(zip_hash, 8)))
|
||||||
if requires:
|
if requires:
|
||||||
msg = '\n'.join(map(lambda x: x[1], requires))
|
msg = '\n'.join(map(lambda x: x[1], requires))
|
||||||
form.addRow(QLabel(_('Requires') + ':'), WWLabel(msg))
|
form.addRow(QLabel(_('Requires') + ':'), WWLabel(msg))
|
||||||
vbox.addLayout(form)
|
vbox.addLayout(form)
|
||||||
|
vbox.addStretch()
|
||||||
close_button = CloseButton(self)
|
close_button = CloseButton(self)
|
||||||
close_button.setText(_('Close'))
|
close_button.setText(_('Close'))
|
||||||
buttons = [close_button]
|
buttons = [close_button]
|
||||||
@@ -297,7 +308,6 @@ class PluginsDialog(WindowModalDialog, MessageBoxMixin):
|
|||||||
self.show_list()
|
self.show_list()
|
||||||
|
|
||||||
def show_list(self):
|
def show_list(self):
|
||||||
from .util import read_QIcon_from_bytes, IconLabel
|
|
||||||
descriptions = self.plugins.descriptions
|
descriptions = self.plugins.descriptions
|
||||||
descriptions = sorted(descriptions.items())
|
descriptions = sorted(descriptions.items())
|
||||||
grid = self.grid
|
grid = self.grid
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "labels",
|
"name": "labels",
|
||||||
"fullname": "LabelSync",
|
"fullname": "LabelSync",
|
||||||
|
"author": "The Electrum Developers",
|
||||||
"description": "Save your wallet labels on a remote server, and synchronize them across multiple devices where you use Electrum. Labels, transactions IDs and addresses are encrypted before they are sent to the remote server.",
|
"description": "Save your wallet labels on a remote server, and synchronize them across multiple devices where you use Electrum. Labels, transactions IDs and addresses are encrypted before they are sent to the remote server.",
|
||||||
"icon":"labelsync.png",
|
"icon":"labelsync.png",
|
||||||
"available_for": ["qt", "qml", "cmdline"]
|
"available_for": ["qt", "qml", "cmdline"]
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "psbt_nostr",
|
"name": "nostr_multisig",
|
||||||
"fullname": "PSBT over Nostr",
|
"fullname": "Nostr Multisig",
|
||||||
"description": "This plugin facilitates the use of multi-signatures wallets. It sends and receives partially signed transactions from/to your cosigner wallet. PSBTs are sent and retrieved from Nostr relays.",
|
"description": "This plugin facilitates the use of multi-signatures wallets. It sends and receives partially signed transactions from/to your cosigner wallet. PSBTs are sent and retrieved from Nostr relays.",
|
||||||
"author": "The Electrum Developers",
|
"author": "The Electrum Developers",
|
||||||
"available_for": ["qt"],
|
"available_for": ["qt"],
|
||||||
|
"icon":"nostr_multisig.png",
|
||||||
"version": "0.0.1"
|
"version": "0.0.1"
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
electrum/plugins/psbt_nostr/nostr_multisig.png
Normal file
BIN
electrum/plugins/psbt_nostr/nostr_multisig.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Reference in New Issue
Block a user