summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-30 13:09:31 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-30 13:29:06 -0700
commit430f5b77c583e5c29a5299740763ddfc9a098570 (patch)
treed8f1c1e4e12f966ac7b63e0ce5373b7703e6cdc2 /desktop-widgets/mainwindow.cpp
parent677bbb77d90c7e3e60cd7de39488107d7cbb65d9 (diff)
downloadsubsurface-430f5b77c583e5c29a5299740763ddfc9a098570.tar.gz
Add menu entry to remove the offline state
If an attempt to contact the cloud storage fails, Subsurface switches into offline mode. This allows us to go back online again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r--desktop-widgets/mainwindow.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 22c57e2fc..868545600 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -387,6 +387,7 @@ void MainWindow::enableDisableCloudActions()
{
ui.actionCloudstorageopen->setEnabled(prefs.cloud_verification_status == CS_VERIFIED);
ui.actionCloudstoragesave->setEnabled(prefs.cloud_verification_status == CS_VERIFIED);
+ ui.actionTake_cloud_storage_online->setEnabled(prefs.cloud_verification_status == CS_VERIFIED && prefs.git_local_only);
}
PlannerDetails *MainWindow::plannerDetails() const {
@@ -595,6 +596,12 @@ void MainWindow::on_actionCloudstoragesave_triggered()
mark_divelist_changed(false);
}
+void MainWindow::on_actionTake_cloud_storage_online_triggered()
+{
+ prefs.git_local_only = false;
+ ui.actionTake_cloud_storage_online->setEnabled(false);
+}
+
void learnImageDirs(QStringList dirnames)
{
QList<QFuture<void> > futures;
@@ -1681,10 +1688,12 @@ QString MainWindow::displayedFilename(QString fullFilename)
if (fullFilename.contains(prefs.cloud_git_url)) {
QString email = fileName.left(fileName.indexOf('['));
- if (prefs.git_local_only)
+ if (prefs.git_local_only) {
+ ui.actionTake_cloud_storage_online->setEnabled(true);
return tr("[local cache for] %1").arg(email);
- else
+ } else {
return tr("[cloud storage for] %1").arg(email);
+ }
} else {
return fileName;
}