summaryrefslogtreecommitdiffstats
path: root/qt-ui/preferences.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-14 15:42:28 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-14 15:42:28 -0700
commit60f4b37fabd96a2f7f1d3cb1a8e1885895deb1c2 (patch)
tree3ba806fe15cdaf7851c2199ab156bf36422db55a /qt-ui/preferences.cpp
parent60bd4288c7ca30846604926e59178e07febda040 (diff)
downloadsubsurface-60f4b37fabd96a2f7f1d3cb1a8e1885895deb1c2.tar.gz
Cloud storage: only offer cloud storage related options when verified
If we don't have verified cloud credentials disable the menu options and disallow the use of cloud storage as default data file. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/preferences.cpp')
-rw-r--r--qt-ui/preferences.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index 7ed807f3b..e7aa7020b 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -109,10 +109,16 @@ void PreferencesDialog::cloudPinNeeded()
ui.cloud_storage_pin->setVisible(prefs.cloud_verification_status == CS_NEED_TO_VERIFY);
ui.cloud_storage_pin_label->setEnabled(prefs.cloud_verification_status == CS_NEED_TO_VERIFY);
ui.cloud_storage_pin_label->setVisible(prefs.cloud_verification_status == CS_NEED_TO_VERIFY);
- if (prefs.cloud_verification_status == CS_VERIFIED)
+ if (prefs.cloud_verification_status == CS_VERIFIED) {
ui.cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage (credentials verified)"));
- else
+ ui.cloudDefaultFile->setEnabled(true);
+ } else {
ui.cloudStorageGroupBox->setTitle(tr("Subsurface cloud storage"));
+ if (ui.cloudDefaultFile->isChecked())
+ ui.noDefaultFile->setChecked(true);
+ ui.cloudDefaultFile->setEnabled(false);
+ }
+ MainWindow::instance()->enableDisableCloudActions();
}
#define DANGER_GF (gf > 100) ? "* { color: red; }" : ""