From 34e107558280e864bed62e72a710059d58747807 Mon Sep 17 00:00:00 2001 From: Max Paperno Date: Mon, 16 Jul 2018 17:39:22 -0400 Subject: [PATCH] [Companion][AppPreferencesDialog] If not ALLOW_NIGHTLY_BUILDS then either hide nightly channel option, or if user already has it selected then display a warning (in case they also have nightly installed in parallel). --- companion/src/apppreferencesdialog.cpp | 9 ++++++++- companion/src/apppreferencesdialog.ui | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/companion/src/apppreferencesdialog.cpp b/companion/src/apppreferencesdialog.cpp index 05737fed3..22b2523ad 100644 --- a/companion/src/apppreferencesdialog.cpp +++ b/companion/src/apppreferencesdialog.cpp @@ -170,10 +170,17 @@ void AppPreferencesDialog::initSettings() ui->snapshotPath->setDisabled(true); ui->snapshotPathButton->setDisabled(true); } + #if !defined(ALLOW_NIGHTLY_BUILDS) - // TODO should we gray out nightly builds here? + // remove nightly version option entirely unless it's the current one (because user might have nightly version also installed) + if (g.OpenTxBranch() != AppData::BRANCH_NIGHTLY_UNSTABLE) + ui->OpenTxBranch->removeItem(2); + // if it's already selected, add a warning message + else + ui->updatesLayout->addWidget(new QLabel("" % tr("Note: Nightly builds are not available in this version, Release/RC update channel will be used.") % "", this)); #endif ui->OpenTxBranch->setCurrentIndex(g.OpenTxBranch()); + ui->autoCheckCompanion->setChecked(g.autoCheckApp()); ui->autoCheckFirmware->setChecked(g.autoCheckFw()); ui->showSplash->setChecked(g.showSplash()); diff --git a/companion/src/apppreferencesdialog.ui b/companion/src/apppreferencesdialog.ui index 96f42a9b2..dd98f34ae 100644 --- a/companion/src/apppreferencesdialog.ui +++ b/companion/src/apppreferencesdialog.ui @@ -767,8 +767,8 @@ Mode 4: 6 - - + + Automatic check for OpenTX firmware updates @@ -778,7 +778,7 @@ Mode 4: - + Automatic check for Companion updates @@ -788,7 +788,7 @@ Mode 4: - +