summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2014-03-14 10:35:09 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-14 10:49:56 -0700
commitec33a95ad04099d428275de2c6b36e7098cc943e (patch)
tree7790a74518823ea8c636e9658ad9f96eccb0294c /qt-ui
parentb5d0cfd557aa94a423e19663339439301ab1a5ae (diff)
downloadsubsurface-ec33a95ad04099d428275de2c6b36e7098cc943e.tar.gz
show the error string in the GUI rather than stderr
This makes the error string just be an internal "membuffer", which the GUI can fetch and show when errors occur. The error string keeps accumulating until somebody retrieves it with "get_error_string()". This should make any write errors actually show up to the user. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/mainwindow.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 671f39cf7..44b02b125 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -899,8 +899,10 @@ int MainWindow::file_save_as(void)
if (ui.InfoWidget->isEditing())
ui.InfoWidget->acceptChanges();
- if (save_dives(filename.toUtf8().data()))
+ if (save_dives(filename.toUtf8().data())) {
+ showError(get_error_string());
return -1;
+ }
set_filename(filename.toUtf8().data(), true);
setTitle(MWTF_FILENAME);
@@ -927,8 +929,10 @@ int MainWindow::file_save(void)
if (!current_def_dir.exists())
current_def_dir.mkpath(current_def_dir.absolutePath());
}
- if (save_dives(existing_filename))
+ if (save_dives(existing_filename)) {
+ showError(get_error_string());
return -1;
+ }
mark_divelist_changed(false);
addRecentFile(QStringList() << QString(existing_filename));
return 0;