start of plugin support?

This commit is contained in:
2026-09-01 02:14:47 -07:00
parent 815f342ead
commit ca203fcb56
9 changed files with 476 additions and 243 deletions
+24 -9
View File
@@ -36,6 +36,7 @@ from PySide6.QtSvgWidgets import QSvgWidget # needed to show svgs when app is no
from file_ext_registration import register_file_association, ELEVATION_FLAG
from project_manager import ProjectManager
from src.window.about import AboutWindow
from src.window.plugins import PluginsWindow
from src.window.terminal import TerminalWindow
from src.window.updateevents import EventUpdateMode, UpdateEventsBlazesWindow, UpdateEventsWindow
from src.window.updateoptodes import UpdateOptodesWindow
@@ -43,7 +44,7 @@ from src.window.userguide import UserGuideWindow
from src.window.viewerlauncher import ViewerLauncherWidget
from src.window.welcome import WelcomeDialog
from src.shared.flaresbasewidget import FilePickerWidget, ParamSection, ProgressBubble
from src.shared.shareddata import API_URL, API_URL_SECONDARY, APP_NAME, CURRENT_VERSION, PLATFORM_NAME, DATA_SCHEMA
from src.shared.shareddata import API_URL, API_URL_SECONDARY, APP_NAME, CURRENT_VERSION, PLATFORM_NAME, DATA_SCHEMA, get_app_dir
from startup_args import parse_startup_args
from updater import finish_update_if_needed, UpdateManager, LocalPendingUpdateCheckThread
@@ -556,6 +557,7 @@ class MainApplication(QMainWindow):
self.optodes = None
self.events = None
self.events_blazes = None
self.plugins = None
self.terminal = None
self.bubble_widgets = {}
self.param_sections = []
@@ -910,6 +912,13 @@ class MainApplication(QMainWindow):
preferences_menu.addAction(action)
self.pref_actions[config_key] = action
plugins_menu = menu_bar.addMenu("Plugins")
plugins_actions = [
("Plugin Manager", "Ctrl+Alt+P", self.plugins_gui, resource_path("icons/terminal_24dp_1F1F1F.svg")),
]
for name, shortcut, slot, icon in plugins_actions:
plugins_menu.addAction(make_action(name, shortcut, slot, icon=icon))
terminal_menu = menu_bar.addMenu("Terminal")
terminal_actions = [
("New Terminal", "Ctrl+Alt+T", self.terminal_gui, resource_path("icons/terminal_24dp_1F1F1F.svg")),
@@ -1315,7 +1324,12 @@ class MainApplication(QMainWindow):
"This action is not available at this time.",
QMessageBox.Ok
)
def plugins_gui(self):
if self.plugins is None or not self.plugins.isVisible():
self.plugins = PluginsWindow(self)
self.plugins.show()
def terminal_gui(self):
if self.terminal is None or not self.terminal.isVisible():
self.terminal = TerminalWindow(self)
@@ -2746,13 +2760,14 @@ if __name__ == "__main__":
log_path = os.path.join(os.path.dirname(sys.executable), f"../../../{APP_NAME}.log")
cfg_path = os.path.join(os.path.dirname(sys.executable), f"../../../{APP_NAME}.cfg")
else:
log_path = os.path.join(os.getcwd(), f"{APP_NAME}.log")
cfg_path = os.path.join(os.getcwd(), f"{APP_NAME}.cfg")
log_path = os.path.join(get_app_dir(), f"{APP_NAME}.log")
cfg_path = os.path.join(get_app_dir(), f"{APP_NAME}.cfg")
try:
os.remove(log_path)
except:
pass
if os.path.exists(log_path):
os.remove(log_path)
except Exception as e:
print(f"Warning: Could not remove old log file: {e}")
sys.stdout = open(log_path, "a", buffering=1)
sys.stderr = sys.stdout
print(f"\n=== App started at {datetime.now()} ===\n")
@@ -2778,4 +2793,4 @@ if __name__ == "__main__":
window.show()
sys.exit(app.exec())
# Not 2600 lines yay!
# Not 2800 lines yay!