diff options
-rw-r--r-- | qt-ui/mainwindow.cpp | 10 | ||||
-rw-r--r-- | qt-ui/mainwindow.h | 1 | ||||
-rw-r--r-- | qt-ui/preferences.cpp | 10 |
3 files changed, 19 insertions, 2 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); } diff --git a/qt-ui/mainwindow.h b/qt-ui/mainwindow.h index 63a31e0cf..8469f5737 100644 --- a/qt-ui/mainwindow.h +++ b/qt-ui/mainwindow.h @@ -94,6 +94,7 @@ public: void showV2Dialog(); QUndoStack *undoStack; NotificationWidget *getNotificationWidget(); + void enableDisableCloudActions(); private slots: /* file menu action */ 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; }" : "" |