From e728560a45801567d9bd4527593c6bdda7ec097a Mon Sep 17 00:00:00 2001 From: elecpower Date: Sun, 2 Jan 2022 08:54:48 +1100 Subject: [PATCH] Add default internal module to radio profile --- companion/src/apppreferencesdialog.cpp | 7 + companion/src/apppreferencesdialog.ui | 736 +++++++++++++------------ companion/src/storage/appdata.h | 1 + 3 files changed, 381 insertions(+), 363 deletions(-) diff --git a/companion/src/apppreferencesdialog.cpp b/companion/src/apppreferencesdialog.cpp index 99f0bb90f..2a676e667 100644 --- a/companion/src/apppreferencesdialog.cpp +++ b/companion/src/apppreferencesdialog.cpp @@ -28,6 +28,10 @@ #include "joystick.h" #include "joystickdialog.h" #endif +#include "moduledata.h" +#include "compounditemmodels.h" + +#include AppPreferencesDialog::AppPreferencesDialog(QWidget * parent) : QDialog(parent), @@ -97,6 +101,7 @@ void AppPreferencesDialog::accept() g.jsSupport(false); g.jsCtrl(0); } + profile.defaultInternalModule(ui->defaultInternalModuleCB->currentData().toInt()); profile.channelOrder(ui->channelorderCB->currentIndex()); profile.defaultMode(ui->stickmodeCB->currentIndex()); profile.renameFwFiles(ui->renameFirmware->isChecked()); @@ -256,6 +261,8 @@ void AppPreferencesDialog::initSettings() } #endif // Profile Tab Inits + ui->defaultInternalModuleCB->setModel(ModuleData::internalModuleItemModel()); + ui->defaultInternalModuleCB->setCurrentIndex(ui->defaultInternalModuleCB->findData(profile.defaultInternalModule())); ui->channelorderCB->setCurrentIndex(profile.channelOrder()); ui->stickmodeCB->setCurrentIndex(profile.defaultMode()); ui->renameFirmware->setChecked(profile.renameFwFiles()); diff --git a/companion/src/apppreferencesdialog.ui b/companion/src/apppreferencesdialog.ui index a3156efa3..888d6d1c6 100644 --- a/companion/src/apppreferencesdialog.ui +++ b/companion/src/apppreferencesdialog.ui @@ -51,178 +51,21 @@ Radio Profile - - - + + + - - 0 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 5 - - - 4 - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 6 - - - - - - 0 - 0 - - - - - 75 - true - - - - Splash Screen - - - - - - - true - - - true - - - - - - - Select Image - - - - - - - - 0 - 0 - - - - - 128 - 64 - - - - - 212 - 64 - - - - QFrame::StyledPanel - - - QFrame::Plain - - - 1 - - - - - - true - - - - - - - Clear Image - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - - - - - - - - + 0 0 - Offer to write FW to Tx after download + Default Stick Mode - - - - - 0 - 0 - - - - Qt::Horizontal - - - - + @@ -358,88 +201,27 @@ - - - - true + + + + If set it will override the application general setting + + + false - - - - - 0 - 0 - - - - Build Options - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - + + 0 0 - - Append version number to FW file name - - - - - Select Folder - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Profile Name - - - - - - - - - - - 0 - 0 - - - - The profile specific folder, if set, will override general Backup folder - - - Backup folder - - - - + true @@ -455,39 +237,17 @@ - - - - - 0 - 0 - - - - - 75 - true - + + + + The profile specific folder, if set, will override general Backup folder - Other Settings + Select Folder - - - - - 0 - 0 - - - - Default Stick Mode - - - - + @@ -541,61 +301,61 @@ Mode 4: - - - - - 0 - 0 - + + + + true - Default Channel Order - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - if set, will override general backup enable - - - Enable automatic backup before writing firmware - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - - - - - If set it will override the application general setting + false + + + + + + + true + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Profile Name + + + + + + + + 0 + 0 + + + + Append version number to FW file name + + + @@ -612,16 +372,6 @@ Mode 4: - - - - The profile specific folder, if set, will override general Backup folder - - - Select Folder - - - @@ -635,6 +385,136 @@ Mode 4: + + + + + 0 + 0 + + + + The profile specific folder, if set, will override general Backup folder + + + Backup folder + + + + + + + + 0 + 0 + + + + Default Channel Order + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Default Int. Module + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + Offer to write FW to Tx after download + + + + + + + + 0 + 0 + + + + Build Options + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + 0 + 0 + + + + Menu Language + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Select Folder + + + + + + + Qt::Vertical + + + + 20 + 5 + + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + @@ -658,58 +538,188 @@ Mode 4: - - - - - 0 - 0 - - - - Menu Language - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - true - - - - - - false - - - - - - - Qt::Vertical - - - - 20 - 5 - - - - - - + + 0 0 + + if set, will override general backup enable + + + Enable automatic backup before writing firmware + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + + 0 + 0 + + + + + 75 + true + + + + Splash Screen + + + + + + + true + + + true + + + + + + + Select Image + + + + + + + + 0 + 0 + + + + + 128 + 64 + + + + + 212 + 64 + + + + QFrame::StyledPanel + + + QFrame::Plain + + + 1 + + + + + + true + + + + + + + Clear Image + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + + + + + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 5 + + + 4 + + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Other Settings + + + + + + diff --git a/companion/src/storage/appdata.h b/companion/src/storage/appdata.h index 9741aa96d..53ffb71d9 100644 --- a/companion/src/storage/appdata.h +++ b/companion/src/storage/appdata.h @@ -380,6 +380,7 @@ class Profile: public CompStoreObj PROPERTYSTR(sdPath) PROPERTYSTR(pBackupDir) + PROPERTY (int, defaultInternalModule, 0) PROPERTY4(int, channelOrder, "default_channel_order", 0) PROPERTY4(int, defaultMode, "default_mode", 1) PROPERTY (int, volumeGain, 10)