From 59ab849854bec7f61a527c4b6e5a1f063c57abb8 Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Thu, 26 Feb 2015 16:07:39 +0200 Subject: Creating a Notification widget in the Main Window. The main error message bar can be used to show exporting information and other notification. So a new Notification handler object is created in the main window that inherits that shows different type of notifications, ex. (Warning, Error and information) Also this class contains a QFutureWatcher object that is set to handle the QFuture variable returned from the exporting thread. this will allow the UI to be updated when the thread finishes execution. Signed-off-by: Gehad elrobey Signed-off-by: Dirk Hohndel --- qt-ui/mainwindow.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'qt-ui/mainwindow.cpp') diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 8dcb59c90..de98eb08f 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -1308,12 +1308,12 @@ int MainWindow::file_save(void) void MainWindow::showError(QString message) { - if (message.isEmpty()) - return; - ui.mainErrorMessage->setText(message); - ui.mainErrorMessage->setCloseButtonVisible(true); - ui.mainErrorMessage->setMessageType(KMessageWidget::Error); - ui.mainErrorMessage->animatedShow(); + ui.mainErrorMessage->showNotification(message, KMessageWidget::Error); +} + +NotificationWidget *MainWindow::getNotificationWidget() +{ + return ui.mainErrorMessage; } void MainWindow::setTitle(enum MainWindowTitleFormat format) -- cgit v1.2.3-70-g09d2