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.
This commit is contained in:
Submodule mods/silo updated: bce7d5a181...2a86a79ca2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user