pylance fixes and terminal plugin launching
This commit is contained in:
@@ -17,8 +17,10 @@ from PySide6.QtWidgets import QWidget, QVBoxLayout, QTextEdit, QLineEdit, QMainW
|
||||
from PySide6.QtCore import QProcess, Qt, QThread, Signal
|
||||
|
||||
from file_ext_registration import register_file_association, is_windows_admin
|
||||
from plugin_manager import PluginManager
|
||||
from src.shared.shareddata import API_URL, API_URL_SECONDARY, APP_NAME, CURRENT_VERSION, PLATFORM_NAME
|
||||
from src.window.about import AboutWindow
|
||||
from src.window.plugins import PluginsWindow
|
||||
from updater import UpdateManager
|
||||
|
||||
|
||||
@@ -42,7 +44,7 @@ class _AssocWorker(QThread):
|
||||
|
||||
|
||||
class TerminalWindow(QWidget):
|
||||
def __init__(self, parent: QWidget | None = None) -> None:
|
||||
def __init__(self, parent: QWidget | None, plugin_manager: PluginManager) -> None:
|
||||
super().__init__(parent, Qt.WindowType.Window)
|
||||
self.setWindowTitle(f"Terminal - {APP_NAME.upper()}")
|
||||
self.resize(320, 180)
|
||||
@@ -58,6 +60,7 @@ class TerminalWindow(QWidget):
|
||||
self.setLayout(layout)
|
||||
|
||||
self._process: QProcess | None = None
|
||||
self.plugin_manager = plugin_manager
|
||||
|
||||
self.commands: dict[str, Callable[..., Any]] = {
|
||||
"hello": self.cmd_hello,
|
||||
@@ -66,6 +69,7 @@ class TerminalWindow(QWidget):
|
||||
"about": self.cmd_about,
|
||||
"assoc": self.cmd_assoc,
|
||||
"update": self.cmd_update,
|
||||
"plugins": self.cmd_plugins,
|
||||
"utest": self.cmd_utest,
|
||||
}
|
||||
|
||||
@@ -122,6 +126,10 @@ class TerminalWindow(QWidget):
|
||||
self.about = AboutWindow(self)
|
||||
self.about.show()
|
||||
|
||||
def cmd_plugins(self, *args: Any) -> None:
|
||||
self.about = PluginsWindow(self, self.plugin_manager)
|
||||
self.about.show()
|
||||
|
||||
def cmd_update(self, *args: Any) -> str:
|
||||
main_win = self.parent()
|
||||
if not isinstance(main_win, QMainWindow):
|
||||
|
||||
Reference in New Issue
Block a user