From 7a787c4315eb096d5f97f6bdb5845e9330885198 Mon Sep 17 00:00:00 2001 From: tyler Date: Tue, 1 Sep 2026 16:27:28 -0700 Subject: [PATCH] test --- packages/test-plugin.zip | Bin 0 -> 1604 bytes plugins.json | 14 ++++++-- test-plugin/__init__.py | 68 +++++++++++++++++++++++++++++++++++++++ test-plugin/plugin.json | 9 ++++++ 4 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 packages/test-plugin.zip create mode 100644 test-plugin/__init__.py create mode 100644 test-plugin/plugin.json diff --git a/packages/test-plugin.zip b/packages/test-plugin.zip new file mode 100644 index 0000000000000000000000000000000000000000..195a99ad4d821e277654e7d6dcc7692262c15a26 GIT binary patch literal 1604 zcmWIWW@Zs#0DDNWDJ(=V;yW?*CiNrH*c5MBoMq`2u> z%|Pq}!~tNFI2bq>ZZ)EsB#veh#6Z2Q;`}^phUUaf&jJ|?!liv1xtI(ET&fS&M+BW- zs32DMuOZ?_$BB(`k9HQ^Y&q-3`tknWitvm?%g=4cZI%l&IA2?HaD{i&alP$F(!RZv z+^d~(U-(AtYXv{oF^tvD`uWUGlu zBjZh{$&=am%QvmP9MW5KriwRcPx}PcZBOqw*cA2}UaOBg%J)_1$Z|QEvwP+3!@P}O zzh5+^#NezaUJ`BcRm;LXm_>$UmlR$y3ZF)}b9LS}gp{*Z}}&&(;F6>f7w8!cKwzA1=GcaR=Nmt$Z0ih`O2u4yCE~x#?7zjc9cq4iuDww zI-Bcdm#lKHt<_)o_Vw@5b2~jnTrZzAy}YMEHH-Os=%BL1Pj8%c@UZO9QvS6!rPe={kGiwHs`##yGOO;qjQ7*t zretS4+{@r2i|Lij7h5kvgTW$r&#XhyqbI4U?jWc`r`TjqcEy6MXj&kGn`FH2*E&2O$o1>`u%X|IbC$NY; zvAF8tyU{~u=SqVcyCpTsLvh20 zlS^lcM84aTa`&f4sHXO5zNB!6qGJyP3?v(>gpQl1v+Qr^(G=HSnU!|8w4}qTBah|f zF}7d1tNUuy8Ni-}CExiJa;NRy6~)EzMUa&P~`V>g;j<#fc-U`-?8Nbuv9?zR34g zB<()`@-ye=#r3>fc6;XUhlXJd+0OfSO!tl6$ywp>w09ZD(zjBk#rD6BEL>TpoUUcN zBXYwktG6~AL{m9h=WdKyb2svResfFci=+wDatuNy%g-+SGIv{|X6n`R4L3PuPOg}I zMPpywVk@y3_fF(K6O_>Ce!67#M3!}L>MS_Ur3>t`oZVzBlOm9i`SrG{z?3O_Ql#1B zSJ-O&ikvAdW!^Wj?e}-(z5L$mq-SZkhurkOAv&Kg;mPX2KIZH5t_3wtNV}r;^jBy0 zyvrZ_oA%6`%-d*EaZ^=4zHlx-@5W0%x&l@v#Uy`QC6LDw#B3Y;I9Ni)<9R@ZOOp4= zj2o6WOQsyLUz4XLQ)Vr5_TGDsHpam8!;cM%8GmKCY=h4 zd$sq>-x)!94Aw%T|7Itjkh;Kon`_tfHpR*RLAlqsEBkpQGXuj`PEhV;WD;S`#aH+M4F?rI0p6@^AYU>AArDZy5-W%Y0LXc6uK)l5 literal 0 HcmV?d00001 diff --git a/plugins.json b/plugins.json index 831af7a..db715b0 100644 --- a/plugins.json +++ b/plugins.json @@ -7,7 +7,7 @@ "description": "Machine Learning on Processed fNIRS Data.", "platforms": ["win_x64"], "min_app_version": "1.7.0", - "download_url": "https://git.research.dezeeuw.ca/tyler/flares-plugins/machine-learning-pack/machine_learning_pack_win_x64.zip" + "download_url": "https://git.research.dezeeuw.ca/tyler/flares-plugins/raw/branch/main/packages/machine_learning_pack_win_x64.zip" }, { "id": "theme-pack", @@ -17,6 +17,16 @@ "description": "Pure Python themes (cross-platform).", "min_app_version": "1.7.0", "platforms": ["darwin_arm64", "darwin_x64", "linux_x64"], - "download_url": "https://git.research.dezeeuw.ca/tyler/flares-plugins/theme-pack/theme_pack_multi.zip" + "download_url": "https://git.research.dezeeuw.ca/tyler/flares-plugins/raw/branch/main/packages/theme_pack_multi.zip" + }, + { + "id": "test-plugin", + "name": "Test Plugin", + "version": "1.0.0", + "author": "Tyler de Zeeuw", + "description": "Test Plugin.", + "min_app_version": "1.7.0", + "platforms": ["win_x64"], + "download_url": "https://git.research.dezeeuw.ca/tyler/flares-plugins/raw/branch/main/packages/test-plugin.zip" } ] \ No newline at end of file diff --git a/test-plugin/__init__.py b/test-plugin/__init__.py new file mode 100644 index 0000000..c5c24ff --- /dev/null +++ b/test-plugin/__init__.py @@ -0,0 +1,68 @@ +""" +Basic Test Plugin +Creates a widget window and registers submenu items under the Plugins menu. +""" + +from PySide6.QtGui import QAction +from PySide6.QtWidgets import QLabel, QMenu, QMessageBox, QPushButton, QVBoxLayout, QWidget + + +class PluginWidget(QWidget): + """Custom widget UI owned by the plugin.""" + + def __init__(self, parent: QWidget | None = None) -> None: + super().__init__(parent) + self.setWindowTitle("Test Plugin Window") + self.resize(350, 200) + + layout = QVBoxLayout(self) + + label = QLabel("Hello from the Test Plugin!", self) + btn_action = QPushButton("Click Me", self) + btn_action.clicked.connect(self._on_button_clicked) + + layout.addWidget(label) + layout.addWidget(btn_action) + + def _on_button_clicked(self) -> None: + QMessageBox.information(self, "Plugin Interactive", "Button inside the plugin QWidget was clicked!") + + +class Plugin: + """Plugin entry point contract loaded by the main application.""" + + def __init__(self, main_window: QWidget) -> None: + self.main_window = main_window + self.name = "Test Plugin" + self.widget_instance: PluginWidget | None = None + + def register_menu(self, plugin_menu: QMenu) -> None: + """ + Populates the plugin's dedicated submenu in the main menubar. + Called by the main app after creating the submenu header. + """ + open_action = QAction("Open Tool Window", self.main_window) + open_action.triggered.connect(self.show_widget) + + about_action = QAction("About Test Plugin", self.main_window) + about_action.triggered.connect(self.show_about) + + plugin_menu.addAction(open_action) + plugin_menu.addAction(about_action) + + def show_widget(self) -> None: + """Instantiates and displays the plugin's QWidget window.""" + if self.widget_instance is None or not self.widget_instance.isVisible(): + self.widget_instance = PluginWidget() + self.widget_instance.show() + else: + self.widget_instance.raise_() + self.widget_instance.activateWindow() + + def show_about(self) -> None: + """Secondary menu action example.""" + QMessageBox.about( + self.main_window, + "About Test Plugin", + "This is a basic test plugin demonstrating submenu registration and custom QWidget window spawning.", + ) \ No newline at end of file diff --git a/test-plugin/plugin.json b/test-plugin/plugin.json new file mode 100644 index 0000000..0e309e3 --- /dev/null +++ b/test-plugin/plugin.json @@ -0,0 +1,9 @@ +{ + "id": "test_plugin", + "name": "Test Plugin", + "version": "1.0.0", + "description": "A basic test plugin demonstrating menu registration and custom widgets.", + "author": "Your Name", + "min_app_version": "1.0.0", + "platforms": ["win_x64", "darwin_arm64", "darwin_x64", "linux_x64"] +} \ No newline at end of file