diff --git a/mods/silo b/mods/silo index 7cf5867a7a..85bfb17854 160000 --- a/mods/silo +++ b/mods/silo @@ -1 +1 @@ -Subproject commit 7cf5867a7ac16375fbffc69aeba8af436dec7523 +Subproject commit 85bfb178541b04ff4c2854cd2fd3ef1723345ba5 diff --git a/resources/kindred-create.desktop b/resources/kindred-create.desktop index c3b942a39d..6432edaf03 100644 --- a/resources/kindred-create.desktop +++ b/resources/kindred-create.desktop @@ -2,12 +2,12 @@ Name=Kindred Create GenericName=CAD Application Comment=Parametric 3D CAD modeler based on FreeCAD -Exec=kindred-create %F +Exec=kindred-create %U Icon=kindred-create Terminal=false Type=Application 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; StartupNotify=true StartupWMClass=KindredCreate diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index b942f71d7c..c72d1288f4 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1700,10 +1700,27 @@ void MainWindow::processMessages(const QList& msg) try { WaitCursor wc; std::list files; - QString action = QStringLiteral("OpenFile:"); + QString openFileAction = QStringLiteral("OpenFile:"); + QString kindredScheme = QStringLiteral("kindred://"); for (const auto& it : msg) { - if (it.startsWith(action)) { - files.emplace_back(it.mid(action.size()).toStdString()); + if (it.startsWith(openFileAction)) { + 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);