mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-05 00:21:29 +00:00
a25f54e3c2
Up to now, errors produced by threads were not directly shown in the MainWindow. Code running in the GUI thread had to manually show the errors. This can be simplified by using Qt's queued connection as message passing facility. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
35 lines
694 B
C++
35 lines
694 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef NOTIFICATIONWIDGET_H
|
|
#define NOTIFICATIONWIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QFutureWatcher>
|
|
|
|
#include "desktop-widgets/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();
|
|
QString getNotificationText();
|
|
|
|
public
|
|
slots:
|
|
void showError(QString message);
|
|
private:
|
|
QFutureWatcher<void> future_watcher;
|
|
|
|
private
|
|
slots:
|
|
void finish();
|
|
};
|
|
|
|
#endif // NOTIFICATIONWIDGET_H
|