feat: native Qt start panel + kindred:// URL scheme (#167)
Some checks failed
Build and Test / build (pull_request) Has been cancelled
Some checks failed
Build and Test / build (pull_request) Has been cancelled
Replace QWebEngineView-based start page with a rich native Qt panel. QWebEngineView (PySide6.QtWebEngineWidgets) is not available on conda-forge for Qt6, so the start page was always falling back to a bare offline widget. Start panel (silo_start.py): - Database Items list with search from Silo REST API - Recent Files from FreeCAD preferences - Real-time Activity Feed via SSE (SiloEventListener) - Context menu: Open in Create, Open in Browser, Copy Part Number - 'Open in Browser' button via QDesktopServices - Catppuccin Mocha dark theme kindred:// URL scheme: - Desktop file registers x-scheme-handler/kindred MIME type - MainWindow::processMessages() dispatches kindred:// URLs to Python - handle_kindred_url() in silo_commands.py opens items by part number - InitGui.py handles kindred:// URLs on cold start via QTimer Closes #167
This commit is contained in:
Submodule mods/silo updated: 7cf5867a7a...85bfb17854
@@ -2,12 +2,12 @@
|
|||||||
Name=Kindred Create
|
Name=Kindred Create
|
||||||
GenericName=CAD Application
|
GenericName=CAD Application
|
||||||
Comment=Parametric 3D CAD modeler based on FreeCAD
|
Comment=Parametric 3D CAD modeler based on FreeCAD
|
||||||
Exec=kindred-create %F
|
Exec=kindred-create %U
|
||||||
Icon=kindred-create
|
Icon=kindred-create
|
||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=Graphics;Science;Engineering;
|
Categories=Graphics;Science;Engineering;
|
||||||
MimeType=application/x-extension-fcstd;
|
MimeType=application/x-extension-fcstd;x-scheme-handler/kindred;
|
||||||
Keywords=CAD;3D;modeling;engineering;design;parametric;
|
Keywords=CAD;3D;modeling;engineering;design;parametric;
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
StartupWMClass=KindredCreate
|
StartupWMClass=KindredCreate
|
||||||
|
|||||||
@@ -1700,10 +1700,27 @@ void MainWindow::processMessages(const QList<QString>& msg)
|
|||||||
try {
|
try {
|
||||||
WaitCursor wc;
|
WaitCursor wc;
|
||||||
std::list<std::string> files;
|
std::list<std::string> files;
|
||||||
QString action = QStringLiteral("OpenFile:");
|
QString openFileAction = QStringLiteral("OpenFile:");
|
||||||
|
QString kindredScheme = QStringLiteral("kindred://");
|
||||||
for (const auto& it : msg) {
|
for (const auto& it : msg) {
|
||||||
if (it.startsWith(action)) {
|
if (it.startsWith(openFileAction)) {
|
||||||
files.emplace_back(it.mid(action.size()).toStdString());
|
QString payload = it.mid(openFileAction.size());
|
||||||
|
if (payload.startsWith(kindredScheme)) {
|
||||||
|
// Dispatch kindred:// URLs to the Python handler
|
||||||
|
std::string urlStr = payload.toStdString();
|
||||||
|
std::string script = "try:\n"
|
||||||
|
" from silo_commands import handle_kindred_url\n"
|
||||||
|
" handle_kindred_url('"
|
||||||
|
+ urlStr
|
||||||
|
+ "')\n"
|
||||||
|
"except Exception as e:\n"
|
||||||
|
" FreeCAD.Console.PrintError("
|
||||||
|
"'Kindred URL handler error: ' + str(e) + '\\n')\n";
|
||||||
|
Base::Interpreter().runString(script.c_str());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
files.emplace_back(payload.toStdString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
files = App::Application::processFiles(files);
|
files = App::Application::processFiles(files);
|
||||||
|
|||||||
Reference in New Issue
Block a user