summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.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/mainwindow.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/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index ec39cc151..fb62f4de2 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -157,6 +157,8 @@ MainWindow::MainWindow() : QMainWindow(),
ui.menuFile->removeAction(ui.actionCloudstorageopen);
ui.menuFile->removeAction(ui.actionCloudstoragesave);
qDebug() << "disabled / made invisible the cloud storage stuff";
+#else
+ enableDisableCloudActions();
#endif
ui.mainErrorMessage->hide();
@@ -204,6 +206,14 @@ MainWindow::~MainWindow()
m_Instance = NULL;
}
+void MainWindow::enableDisableCloudActions()
+{
+#ifdef USE_LIBGIT23_API
+ ui.actionCloudstorageopen->setEnabled(prefs.cloud_verification_status == CS_VERIFIED);
+ ui.actionCloudstoragesave->setEnabled(prefs.cloud_verification_status == CS_VERIFIED);
+#endif
+}
+
PlannerDetails *MainWindow::plannerDetails() const {
return qobject_cast<PlannerDetails*>(applicationState["PlanDive"].bottomRight);
}