diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 6a2a35ab0..3bd6f60c3 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1410,6 +1410,21 @@ void Application::LoadParameters(void) try { if (_pcUserParamMngr->LoadOrCreateDocument(mConfig["UserParameter"].c_str()) && !(mConfig["Verbose"] == "Strict")) { + // The user parameter file doesn't exist. When an alternative parameter file is offered + // this will be used. + std::map::iterator it = mConfig.find("UserParameterTemplate"); + if (it != mConfig.end()) { + QString path = QString::fromUtf8(it->second.c_str()); + if (QDir(path).isRelative()) { + QString home = QString::fromUtf8(mConfig["AppHomePath"].c_str()); + path = QFileInfo(QDir(home), path).absoluteFilePath(); + } + QFileInfo fi(path); + if (fi.exists()) { + _pcUserParamMngr->LoadDocument(path.toUtf8().constData()); + } + } + // Configuration file optional when using as Python module if (!Py_IsInitialized()) { Console().Warning(" User settings not existing, write initial one\n"); diff --git a/src/App/Branding.cpp b/src/App/Branding.cpp index 4bbe5dc1a..173ba0f46 100644 --- a/src/App/Branding.cpp +++ b/src/App/Branding.cpp @@ -60,6 +60,7 @@ Branding::Branding() filter.push_back("ExeName"); filter.push_back("ExeVendor"); filter.push_back("NavigationStyle"); + filter.push_back("UserParameterTemplate"); } bool Branding::readFile(const QString& fn)