summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-16 12:42:17 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-16 14:09:37 -0700
commitbd11988f74d2fcc7873df691e06a1279d7fd3228 (patch)
tree616e9462420776362a68f0e5f733c248adb89ede /qt-ui
parent226e9a7e85ef1cf148daa61a54039ebfa060f4cb (diff)
downloadsubsurface-bd11988f74d2fcc7873df691e06a1279d7fd3228.tar.gz
Cloud storage: warn the user if we are not online
This isn't perfect, but at least tells the user if we weren't able to connect and are working just off the local cache. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp6
-rw-r--r--qt-ui/mainwindow.cpp10
2 files changed, 14 insertions, 2 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 5cbf182d7..3f72fc11a 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -237,7 +237,11 @@ void MainTab::enableGeoLookupEdition()
{
ui.waitingSpinner->stop();
ui.addDiveSite->show();
- MainWindow::instance()->getNotificationWidget()->hideNotification();
+ // if we showed an informational text about loading the files, hide it, but don't
+ // hide the message area if it contains other warnings
+ if (MainWindow::instance()->getNotificationWidget()->getNotificationText() ==
+ tr("Please Wait, Importing your files..."))
+ MainWindow::instance()->getNotificationWidget()->hideNotification();
}
void MainTab::disableGeoLookupEdition()
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 4e35ad9ee..16a58b321 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -1515,6 +1515,7 @@ void MainWindow::showV2Dialog()
void MainWindow::loadFiles(const QStringList fileNames)
{
+ bool showWarning = false;
if (fileNames.isEmpty())
return;
@@ -1529,6 +1530,12 @@ void MainWindow::loadFiles(const QStringList fileNames)
if (!error) {
set_filename(fileNamePtr.data(), true);
setTitle(MWTF_FILENAME);
+ // if there were any messages, show them
+ QString warning = get_error_string();
+ if (!warning.isEmpty()) {
+ showWarning = true;
+ getNotificationWidget()->showNotification(warning , KMessageWidget::Information);
+ }
} else {
if (!v2_question_shown && abort_read_of_old_file) {
v2_question_shown = true;
@@ -1541,7 +1548,8 @@ void MainWindow::loadFiles(const QStringList fileNames)
failedParses.append(fileNames.at(i));
}
}
- getNotificationWidget()->hideNotification();
+ if (!showWarning)
+ getNotificationWidget()->hideNotification();
process_dives(false, false);
addRecentFile(fileNames);
removeRecentFile(failedParses);