subsurface/qt-ui/notificationwidget.h
Gehad elrobey 59ab849854 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
<NotificationWidget> that inherits <KMessageWidget> 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 <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-27 06:31:06 +01:00

31 lines
587 B
C++

#ifndef NOTIFICATIONWIDGET_H
#define NOTIFICATIONWIDGET_H
#include <QWidget>
#include <QFutureWatcher>
#include <kmessagewidget.h>
namespace Ui {
class NotificationWidget;
}
class NotificationWidget : public KMessageWidget {
Q_OBJECT
public:
explicit NotificationWidget(QWidget *parent = 0);
void setFuture(const QFuture<void> &future);
void showNotification(QString message, KMessageWidget::MessageType type);
void hideNotification();
~NotificationWidget();
private:
QFutureWatcher<void> *future_watcher;
private
slots:
void finish();
};
#endif // NOTIFICATIONWIDGET_H