summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2017-10-19 13:28:40 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-19 07:37:47 -0400
commite955099e6c6d168fd1e63b454644781e9d2b3dbc (patch)
treed496789b08fa8a57536d443af9514c8c13a6ad93 /desktop-widgets
parente9673938fb886a829e64ac595f96611dd14934fc (diff)
downloadsubsurface-e955099e6c6d168fd1e63b454644781e9d2b3dbc.tar.gz
Refuse to save an empty log to the clould
This should prevent the problem of a user accidentally "deleting" their dives in the cloud by hitting "save to cloud" in the wrong moment. Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 3408104de..44384bfb7 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -582,6 +582,10 @@ void MainWindow::on_actionCloudstorageopen_triggered()
void MainWindow::on_actionCloudstoragesave_triggered()
{
QString filename;
+ if (!dive_table.nr) {
+ getNotificationWidget()->showNotification(tr("Don't save an empty log to the cloud"), KMessageWidget::Error);
+ return;
+ }
if (getCloudURL(filename)) {
getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error);
return;