feat(cpn): Enhancements to update component runtime options (#2324)

* enh(cpn): Save update component asset options and manage in app settings

* Add option to delete decompress folders independent of delete download folder

* Fix sdsync to point to last update folder

* Update options dlg to allow choosing release channel and saving settings as defaults

* Rename params

* Asset options dialog shared between settings and update run. Add to Save as defaults
This commit is contained in:
Neil Horne
2022-09-26 08:55:16 +10:00
committed by GitHub
parent 30c54b48c9
commit 3563e917c6
31 changed files with 1016 additions and 555 deletions
+24 -11
View File
@@ -27,20 +27,33 @@ UpdateMultiProtocol::UpdateMultiProtocol(QWidget * parent) :
setName(tr("Multiprotocol"));
setRepo(QString(GITHUB_API_REPOS).append("/pascallanger/DIY-Multiprotocol-TX-Module"));
setResultsPerPage(50); // GitHub REST API default 30
}
void UpdateMultiProtocol::initAssetSettings()
{
if (!isValidSettingsIndex())
return;
g.component[settingsIndex()].initAllAssets();
{
UpdateParameters::AssetParams &ap = dfltParams->addAsset();
ap.filterType = UpdateParameters::UFT_Startswith;
ap.filter = "MultiLuaScripts";
ap.maxExpected = 1;
ap.flags = dfltParams->data.flags | UPDFLG_Locked | UPDFLG_CopyStructure;
ComponentAssetData &cad = g.component[settingsIndex()].asset[0];
cad.desc("scripts");
cad.processes(UPDFLG_Common_Asset);
cad.flags(cad.processes() | UPDFLG_CopyStructure);
cad.filterType(UpdateParameters::UFT_Startswith);
cad.filter("MultiLuaScripts");
cad.maxExpected(1);
}
{
UpdateParameters::AssetParams &ap = dfltParams->addAsset();
ap.filterType = UpdateParameters::UFT_Expression;
ap.filter = "^mm-stm-serial-.*\\.bin$";
ap.flags = (dfltParams->data.flags | UPDFLG_CopyFiles) &~ UPDFLG_Decompress;
ap.destSubDir = "FIRMWARE";
ComponentAssetData &cad = g.component[settingsIndex()].asset[1];
cad.desc("binaries");
cad.processes(UPDFLG_Common_Asset &~ UPDFLG_Decompress);
cad.flags(cad.processes() | UPDFLG_CopyFiles);
cad.filterType(UpdateParameters::UFT_Expression);
cad.filter("^mm-stm-serial-.*\\.bin$");
cad.destSubDir("FIRMWARE");
}
qDebug() << "Asset settings initialised";
}