[GUI] Add autoload option to Workbench preferences page (#4957)

* Add autoload option to Workbench preferences page

* Address bugs identified in the forum.

* Add forward declaration of QCheckBox
This commit is contained in:
Chris Hennes
2021-08-10 20:33:03 -05:00
committed by GitHub
parent 273a7d5e3f
commit e2e7733d09
4 changed files with 163 additions and 80 deletions

View File

@@ -2173,6 +2173,21 @@ void Application::runApplication(void)
SoDebugError::setHandlerCallback( messageHandlerCoin, 0 );
#endif
// Now run the background autoload, for workbenches that should be loaded at startup, but not
// displayed to the user immediately
std::string autoloadCSV = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")->
GetASCII("BackgroundAutoloadModules", "");
// Tokenize the comma-separated list and load the requested workbenches if they exist in this installation
std::vector<std::string> backgroundAutoloadedModules;
std::stringstream stream(autoloadCSV);
std::string workbench;
while (std::getline(stream, workbench, ','))
if (wb.contains(QString::fromLatin1(workbench.c_str())))
app.activateWorkbench(workbench.c_str());
// Reactivate the startup workbench
app.activateWorkbench(start.c_str());
Instance->d->startingUp = false;