mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
677bbb77d9
commit
430f5b77c5
3 changed files with 20 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -106,6 +106,7 @@ slots:
|
|||
void on_actionClose_triggered();
|
||||
void on_actionCloudstorageopen_triggered();
|
||||
void on_actionCloudstoragesave_triggered();
|
||||
void on_actionTake_cloud_storage_online_triggered();
|
||||
void on_actionPrint_triggered();
|
||||
void on_actionPreferences_triggered();
|
||||
void on_actionQuit_triggered();
|
||||
|
|
|
@ -62,10 +62,11 @@
|
|||
</property>
|
||||
<addaction name="actionNew"/>
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="actionCloudstorageopen"/>
|
||||
<addaction name="actionSave"/>
|
||||
<addaction name="actionCloudstoragesave"/>
|
||||
<addaction name="actionSaveAs"/>
|
||||
<addaction name="actionCloudstorageopen"/>
|
||||
<addaction name="actionCloudstoragesave"/>
|
||||
<addaction name="actionTake_cloud_storage_online"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionClose"/>
|
||||
<addaction name="actionExport"/>
|
||||
|
@ -745,6 +746,11 @@
|
|||
<string>Add GPS location here</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionTake_cloud_storage_online">
|
||||
<property name="text">
|
||||
<string>Take cloud storage online</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
Loading…
Add table
Reference in a new issue