mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
refs #832, overlay messages may be overridden with pending confirmation dialogs
found during #832
This commit is contained in:
@@ -50,7 +50,7 @@ namespace BlackGui
|
||||
explicit COverlayMessages(const QString &headerText, int w, int h, QWidget *parent);
|
||||
|
||||
//! Destructor
|
||||
~COverlayMessages();
|
||||
virtual ~COverlayMessages();
|
||||
|
||||
//! Messages mode
|
||||
void setModeToMessages();
|
||||
@@ -75,15 +75,11 @@ namespace BlackGui
|
||||
|
||||
//! Show multiple messages with confirmation bar
|
||||
void showOverlayMessagesWithConfirmation(const BlackMisc::CStatusMessageList &messages,
|
||||
const QString &confirmationMessage,
|
||||
std::function<void()> okLambda,
|
||||
int defaultButton = QMessageBox::Cancel,
|
||||
int timeOutMs = -1);
|
||||
const QString &confirmationMessage,
|
||||
std::function<void()> okLambda,
|
||||
int defaultButton = QMessageBox::Cancel,
|
||||
int timeOutMs = -1);
|
||||
|
||||
//! Set the default confirmation button
|
||||
void setDefaultConfirmationButton(int button = QMessageBox::Cancel);
|
||||
|
||||
public slots:
|
||||
//! Show multiple messages
|
||||
void showOverlayMessages(const BlackMisc::CStatusMessageList &messages, int timeOutMs = -1);
|
||||
|
||||
@@ -105,6 +101,16 @@ namespace BlackGui
|
||||
//! Close button clicked
|
||||
void close();
|
||||
|
||||
//! Set the default confirmation button
|
||||
void setDefaultConfirmationButton(int button = QMessageBox::Cancel);
|
||||
|
||||
//! Is awaiting a conformation
|
||||
bool hasPendingConfirmation() const;
|
||||
|
||||
signals:
|
||||
//! Confirmation completed
|
||||
void confirmationCompleted();
|
||||
|
||||
protected:
|
||||
//! Show message
|
||||
void display(int timeOutMs = -1);
|
||||
@@ -126,8 +132,10 @@ namespace BlackGui
|
||||
QScopedPointer<Ui::COverlayMessages> ui;
|
||||
QString m_header;
|
||||
int m_lastConfirmation = QMessageBox::Cancel;
|
||||
bool m_awaitingConfirmation = false;
|
||||
std::function<void()> m_okLambda;
|
||||
QTimer m_autoCloseTimer { this };
|
||||
QList<std::function<void()>> m_pendingMessageCalls;
|
||||
|
||||
//! Init widget
|
||||
void init(int w, int h);
|
||||
|
||||
Reference in New Issue
Block a user