MCPcopy Create free account
hub / github.com/BruceDevices/firmware / setStartupApp

Function setStartupApp

src/core/settings.cpp:1222–1248  ·  view source on GitHub ↗

** Function: setStartupApp ** Handles Menu to set startup app **********************************************************************/

Source from the content-addressed store, hash-verified

1220** Handles Menu to set startup app
1221**********************************************************************/
1222void setStartupApp() {
1223 int idx = 0;
1224 if (bruceConfig.startupApp == "") idx = 0;
1225
1226 options = {
1227 {"None", [=]() { bruceConfig.setStartupApp(""); }, bruceConfig.startupApp == ""}
1228 };
1229
1230 int index = 0;
1231 for (String appName : startupApp.getAppNames()) {
1232 index++;
1233 if (bruceConfig.startupApp == appName) idx = index;
1234
1235 options.push_back({appName.c_str(), [=]() {
1236 bruceConfig.setStartupApp(appName);
1237#if !defined(LITE_VERSION) && !defined(DISABLE_INTERPRETER)
1238 if (appName == "JS Interpreter") {
1239 options = getScriptsOptionsList("", true);
1240 loopOptions(options, MENU_TYPE_SUBMENU, "Startup Script");
1241 }
1242#endif
1243 }});
1244 }
1245
1246 loopOptions(options, idx);
1247 options.clear();
1248}
1249
1250/*********************************************************************
1251** Function: setGpsBaudrateMenu

Callers 1

systemMenuMethod · 0.85

Calls 5

getScriptsOptionsListFunction · 0.85
setStartupAppMethod · 0.80
getAppNamesMethod · 0.80
loopOptionsFunction · 0.70
clearMethod · 0.45

Tested by

no test coverage detected