npe2 tooltip and icon
* add tooltip, icon
* add npe2 function
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see
* move widgets to function
* move widgets to function
@@ -46,6 +46,7 @@ from ...plugins.pypi import (
from ...utils._appdirs import user_plugin_dir, user_site_packages
from ...utils.misc import parse_version, running_as_bundled_app
from ...utils.translations import trans
+from ..qt_resources import QColoredSVGIcon
from ..qthreading import create_worker
from ..widgets.qt_message_popup import WarnPopup
@@ -325,7 +326,7 @@ class PluginListItem(QFrame):
self.help_button.setText(trans._("Website"))
self.help_button.setObjectName("help_button")
if npe_version != 1:
- self.enabled_checkbox.setEnabled(False)
+ self._handle_npe2_plugin()
if installed:
self.enabled_checkbox.show()
@@ -336,6 +337,17 @@ class PluginListItem(QFrame):
self.action_button.setText(trans._("install"))
self.action_button.setObjectName("install_button")
+ def _handle_npe2_plugin(self):
+ npe2_icon = QLabel(self)
+ icon = QColoredSVGIcon.from_resources('logo_silhouette')
+ npe2_icon.setPixmap(icon.colored(color='#33F0FF').pixmap(20, 20))
+ self.row1.insertWidget(2, QLabel('npe2'))
+ self.row1.insertWidget(2, npe2_icon)
+ self.enabled_checkbox.setEnabled(False)
+ self.enabled_checkbox.setToolTip(
+ 'This is a npe2 plugin and cannot be enabled/disabled at this time.'
+ )
+
def _get_dialog(self) -> QDialog:
p = self.parent()
while not isinstance(p, QDialog) and p.parent():
