feat: native Qt start panel + kindred:// URL scheme #169

Merged
forbes merged 2 commits from feat/native-start-panel-167 into main 2026-02-10 16:38:51 +00:00
3 changed files with 23 additions and 6 deletions

View File

@@ -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

View File

@@ -1700,10 +1700,27 @@ void MainWindow::processMessages(const QList<QString>& msg)
try {
WaitCursor wc;
std::list<std::string> 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);