summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-26 15:50:19 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-26 15:50:53 +0200
commitf088aa4c8b17112855ec86f96a4bac02deb31238 (patch)
tree0da555f1d80c42a698975bc2f62499c548a8437e /desktop-widgets
parenteccd4b993a7cc47e96ddab486197570c38f21701 (diff)
downloadsubsurface-f088aa4c8b17112855ec86f96a4bac02deb31238.tar.gz
desktop UI: always show errors when reported
Instead of waiting for a manual call to showError(), simply use the new callback to always immediately show the error in the notification widget. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index accf0b267..7a99611bf 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -86,6 +86,15 @@ extern "C" int updateProgress(const char *text)
MainWindow *MainWindow::m_Instance = NULL;
+extern "C" void showErrorFromC()
+{
+ MainWindow *mainwindow = MainWindow::instance();
+ if (mainwindow) {
+ mainwindow->getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error);
+ }
+}
+
+
MainWindow::MainWindow() : QMainWindow(),
actionNextDive(0),
actionPreviousDive(0),
@@ -244,6 +253,7 @@ MainWindow::MainWindow() : QMainWindow(),
setupSocialNetworkMenu();
set_git_update_cb(&updateProgress);
+ set_error_cb(&showErrorFromC);
// Toolbar Connections related to the Profile Update
SettingsObjectWrapper *sWrapper = SettingsObjectWrapper::instance();