chore(cpn): radio profile settings default options ui (#7308)
This commit is contained in:
@@ -335,10 +335,6 @@ void AppPreferencesDialog::initSettings()
|
|||||||
ui->externalModuleSizeCB->setCurrentIndex(ui->externalModuleSizeCB->findData(profile.externalModuleSize()));
|
ui->externalModuleSizeCB->setCurrentIndex(ui->externalModuleSizeCB->findData(profile.externalModuleSize()));
|
||||||
panelItemModels->getItemModel(FIM_TEMPLATESETUP)->setFilterFlags(Boards::isAir() ? GeneralSettings::RadioTypeContextAir :
|
panelItemModels->getItemModel(FIM_TEMPLATESETUP)->setFilterFlags(Boards::isAir() ? GeneralSettings::RadioTypeContextAir :
|
||||||
GeneralSettings::RadioTypeContextSurface);
|
GeneralSettings::RadioTypeContextSurface);
|
||||||
ui->channelorderCB->setModel(panelItemModels->getItemModel(FIM_TEMPLATESETUP));
|
|
||||||
ui->channelorderCB->setCurrentIndex(ui->channelorderCB->findData(profile.channelOrder()));
|
|
||||||
ui->stickmodeCB->setModel(GeneralSettings::stickModeItemModel());
|
|
||||||
ui->stickmodeCB->setCurrentIndex(ui->stickmodeCB->findData(profile.defaultMode()));
|
|
||||||
ui->sdPath->setText(profile.sdPath());
|
ui->sdPath->setText(profile.sdPath());
|
||||||
|
|
||||||
ui->profileBackupPath->setText(profile.pBackupDir());
|
ui->profileBackupPath->setText(profile.pBackupDir());
|
||||||
@@ -358,28 +354,36 @@ void AppPreferencesDialog::initSettings()
|
|||||||
ui->profileBackupEnable->setEnabled(false);
|
ui->profileBackupEnable->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Boards::isSurface()) {
|
|
||||||
ui->stickmodeLabel->hide();
|
|
||||||
ui->stickmodeCB->hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->profileNameLE->setText(profile.name());
|
ui->profileNameLE->setText(profile.name());
|
||||||
|
|
||||||
QString hwSettings;
|
QString hwSettings;
|
||||||
|
|
||||||
if (profile.generalSettings().isEmpty()) {
|
if (profile.generalSettings().isEmpty()) {
|
||||||
hwSettings = tr("EMPTY: No radio settings stored in profile");
|
hwSettings = tr("No backup available for this profile");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QString str = profile.timeStamp();
|
QString str = profile.timeStamp();
|
||||||
if (str.isEmpty())
|
if (str.isEmpty())
|
||||||
hwSettings = tr("AVAILABLE: Radio settings of unknown age");
|
hwSettings = tr("Backup available of unknown age");
|
||||||
else
|
else
|
||||||
hwSettings = tr("AVAILABLE: Radio settings stored %1").arg(str);
|
hwSettings = tr("Backup available dated %1").arg(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->stickmodeCB->setModel(GeneralSettings::stickModeItemModel());
|
||||||
|
ui->stickmodeCB->setCurrentIndex(ui->stickmodeCB->findData(profile.defaultMode()));
|
||||||
|
|
||||||
|
if (Boards::isSurface()) {
|
||||||
|
ui->stickmodeLabel->hide();
|
||||||
|
ui->stickmodeCB->hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->channelorderCB->setModel(panelItemModels->getItemModel(FIM_TEMPLATESETUP));
|
||||||
|
ui->channelorderCB->setCurrentIndex(ui->channelorderCB->findData(profile.channelOrder()));
|
||||||
|
|
||||||
ui->chkUseSavedSettingsProfile->setChecked(profile.useSavedSettings());
|
ui->chkUseSavedSettingsProfile->setChecked(profile.useSavedSettings());
|
||||||
ui->lblGeneralSettings->setText(hwSettings);
|
ui->lblGeneralSettings->setText(hwSettings);
|
||||||
|
on_chkUseSavedSettingsProfile_stateChanged();
|
||||||
|
|
||||||
ui->chkPromptSDSync->setChecked(profile.runSDSync());
|
ui->chkPromptSDSync->setChecked(profile.runSDSync());
|
||||||
ui->lblRadioColorSample->setPalette(QPalette(profile.radioSimCaseColor()));
|
ui->lblRadioColorSample->setPalette(QPalette(profile.radioSimCaseColor()));
|
||||||
ui->chkSimBtnClickedUseOSTheme->setChecked(profile.simBtnClickedUseOSTheme());
|
ui->chkSimBtnClickedUseOSTheme->setChecked(profile.simBtnClickedUseOSTheme());
|
||||||
@@ -919,6 +923,7 @@ void AppPreferencesDialog::onProfileBackupPathEditingFinished()
|
|||||||
ui->profileBackupEnable->setEnabled(false);
|
ui->profileBackupEnable->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppPreferencesDialog::on_chkSimBtnClickedUseOSTheme_stateChanged()
|
void AppPreferencesDialog::on_chkSimBtnClickedUseOSTheme_stateChanged()
|
||||||
{
|
{
|
||||||
if (ui->chkSimBtnClickedUseOSTheme->isChecked()) {
|
if (ui->chkSimBtnClickedUseOSTheme->isChecked()) {
|
||||||
@@ -937,3 +942,18 @@ void AppPreferencesDialog::on_btnSimBtnClickedColor_clicked()
|
|||||||
ui->lblSimBtnClickedColorSample->setPalette(QPalette(color));
|
ui->lblSimBtnClickedColorSample->setPalette(QPalette(color));
|
||||||
ui->lblSimBtnClickedColorSample->repaint();
|
ui->lblSimBtnClickedColorSample->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AppPreferencesDialog::on_chkUseSavedSettingsProfile_stateChanged()
|
||||||
|
{
|
||||||
|
if (ui->chkUseSavedSettingsProfile->isChecked() && !g.currentProfile().generalSettings().isEmpty()) {
|
||||||
|
ui->stickmodeLabel->setEnabled(false);
|
||||||
|
ui->stickmodeCB->setEnabled(false);
|
||||||
|
ui->channelorderLabel->setEnabled(false);
|
||||||
|
ui->channelorderCB->setEnabled(false);
|
||||||
|
} else {
|
||||||
|
ui->stickmodeLabel->setEnabled(true);
|
||||||
|
ui->stickmodeCB->setEnabled(true);
|
||||||
|
ui->channelorderLabel->setEnabled(true);
|
||||||
|
ui->channelorderCB->setEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ class AppPreferencesDialog : public QDialog
|
|||||||
void on_btnSimBtnClickedColor_clicked();
|
void on_btnSimBtnClickedColor_clicked();
|
||||||
void onBackupPathEditingFinished();
|
void onBackupPathEditingFinished();
|
||||||
void onProfileBackupPathEditingFinished();
|
void onProfileBackupPathEditingFinished();
|
||||||
|
void on_chkUseSavedSettingsProfile_stateChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initSettings();
|
void initSettings();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user