pylance fixes and terminal plugin launching
This commit is contained in:
+8
-4
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
Filename: plugin_manager.py
|
||||
Description: Manager file for anything plugin related
|
||||
Note: Compliant with pylance strict type checking
|
||||
|
||||
Author: Tyler de Zeeuw
|
||||
License: GPL-3.0
|
||||
@@ -117,7 +118,7 @@ class PluginManager(QObject):
|
||||
|
||||
print(f"[PluginManager] {summary_msg}")
|
||||
|
||||
parent_widget = getattr(self, "main_window", None) or self
|
||||
parent_widget = getattr(self, "main_window", None)
|
||||
QMessageBox.warning(
|
||||
parent_widget,
|
||||
"Plugin Load Failures",
|
||||
@@ -166,7 +167,9 @@ class PluginManager(QObject):
|
||||
for action in menubar.actions():
|
||||
clean_text = action.text().replace("&", "").strip().lower()
|
||||
if clean_text == "plugins":
|
||||
plugins_menu = action.menu()
|
||||
menu = action.menu()
|
||||
if isinstance(menu, QMenu):
|
||||
plugins_menu = menu
|
||||
break
|
||||
|
||||
# If it doesn't exist yet, create it
|
||||
@@ -191,8 +194,9 @@ class PluginManager(QObject):
|
||||
plugins_menu.addSeparator()
|
||||
manager_action = plugins_menu.addAction("Manage Plugins...")
|
||||
|
||||
if hasattr(self.main_window, "plugins_gui") and callable(self.main_window.plugins_gui):
|
||||
manager_action.triggered.connect(self.main_window.plugins_gui)
|
||||
plugins_gui_func = getattr(self.main_window, "plugins_gui", None)
|
||||
if callable(plugins_gui_func):
|
||||
manager_action.triggered.connect(plugins_gui_func)
|
||||
|
||||
def unload_plugins(self) -> None:
|
||||
"""Clears current active plugin instances."""
|
||||
|
||||
Reference in New Issue
Block a user