diff options
author | Gehad elrobey <gehadelrobey@gmail.com> | 2015-02-27 02:57:56 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-27 06:31:10 +0100 |
commit | f61b59d961a5188dde3121ce83af055421fa82b0 (patch) | |
tree | d1384932b02029f6e31acb94616e037efb9315f4 /qt-ui/mainwindow.cpp | |
parent | 59ab849854bec7f61a527c4b6e5a1f063c57abb8 (diff) | |
download | subsurface-f61b59d961a5188dde3121ce83af055421fa82b0.tar.gz |
Change the references to ShowError to the new notification object.
Showing an Error message is better called from the Notification Object,
So for consistency old references to showError is replaced by calling
the notification object.
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index de98eb08f..41669933b 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -246,7 +246,7 @@ MainWindow *MainWindow::instance() // this gets called after we download dives from a divecomputer void MainWindow::refreshDisplay(bool doRecreateDiveList) { - showError(get_error_string()); + getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error); information()->reload(); TankInfoModel::instance()->update(); globe()->reload(); @@ -1266,11 +1266,11 @@ int MainWindow::file_save_as(void) information()->acceptChanges(); if (save_dives(filename.toUtf8().data())) { - showError(get_error_string()); + getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error); return -1; } - showError(get_error_string()); + getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error); set_filename(filename.toUtf8().data(), true); setTitle(MWTF_FILENAME); mark_divelist_changed(false); @@ -1297,20 +1297,15 @@ int MainWindow::file_save(void) current_def_dir.mkpath(current_def_dir.absolutePath()); } if (save_dives(existing_filename)) { - showError(get_error_string()); + getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error); return -1; } - showError(get_error_string()); + getNotificationWidget()->showNotification(get_error_string(), KMessageWidget::Error); mark_divelist_changed(false); addRecentFile(QStringList() << QString(existing_filename)); return 0; } -void MainWindow::showError(QString message) -{ - ui.mainErrorMessage->showNotification(message, KMessageWidget::Error); -} - NotificationWidget *MainWindow::getNotificationWidget() { return ui.mainErrorMessage; |