From 36a88d0959d132b3e2abc771bcc7df11610c17b6 Mon Sep 17 00:00:00 2001 From: forbes Date: Sat, 31 Jan 2026 14:36:51 -0600 Subject: [PATCH] Add Silo auth dock widget, update silo submodule Wire up the new Silo authentication dock panel in InitGui.py: - _setup_silo_auth_panel() creates the Database Auth dock widget - Tabified with the existing Database Activity panel on the right dock - Deferred to 4500ms to ensure activity panel exists first - Widget reference pinned on the dock panel to prevent GC Update silo submodule to include auth widget, login flow, token management, enhanced settings dialog, and silo-auth.svg icon. --- mods/silo | 2 +- src/Mod/Create/InitGui.py | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/mods/silo b/mods/silo index bce7d5a181..2a86a79ca2 160000 --- a/mods/silo +++ b/mods/silo @@ -1 +1 @@ -Subproject commit bce7d5a1815ad9fcb989fc72252b6eb45f59e8e4 +Subproject commit 2a86a79ca20dfc3d55e5d72ee0f22a0f793a75a2 diff --git a/src/Mod/Create/InitGui.py b/src/Mod/Create/InitGui.py index 3ebaaa0cd6..90cbc47ce6 100644 --- a/src/Mod/Create/InitGui.py +++ b/src/Mod/Create/InitGui.py @@ -140,6 +140,41 @@ def _setup_silo_activity_panel(): FreeCAD.Console.PrintLog(f"Create: Silo activity panel skipped: {e}\n") +def _setup_silo_auth_panel(): + """Show a dock widget with Silo authentication status and login.""" + try: + from PySide import QtCore, QtWidgets + + mw = FreeCADGui.getMainWindow() + if mw is None: + return + + # Don't create duplicate panels + if mw.findChild(QtWidgets.QDockWidget, "SiloDatabaseAuth"): + return + + panel = QtWidgets.QDockWidget("Database Auth", mw) + panel.setObjectName("SiloDatabaseAuth") + + import silo_commands + + auth_widget = silo_commands.SiloAuthDockWidget() + panel.setWidget(auth_widget.widget) + # Keep a reference so the timer and callbacks are not garbage-collected + panel._auth_widget = auth_widget + + mw.addDockWidget(QtCore.Qt.RightDockWidgetArea, panel) + + # Tabify with the activity panel so they share the same dock area + activity_panel = mw.findChild(QtWidgets.QDockWidget, "SiloDatabaseActivity") + if activity_panel: + mw.tabifyDockWidget(activity_panel, panel) + panel.raise_() + + except Exception as e: + FreeCAD.Console.PrintLog(f"Create: Silo auth panel skipped: {e}\n") + + # Defer enhancements until the GUI event loop is running try: from PySide.QtCore import QTimer @@ -147,5 +182,6 @@ try: QTimer.singleShot(2000, _setup_silo_menu) QTimer.singleShot(3000, _check_silo_first_start) QTimer.singleShot(4000, _setup_silo_activity_panel) + QTimer.singleShot(4500, _setup_silo_auth_panel) except Exception: pass