diff options
| author | Amaury Pouly <amaury.pouly@gmail.com> | 2014-10-07 14:30:24 +0200 |
|---|---|---|
| committer | Amaury Pouly <amaury.pouly@gmail.com> | 2014-12-15 22:53:49 +0100 |
| commit | 7749c4d0e960b3e4f92194bd8f63ed70cc9bcb31 (patch) | |
| tree | c07aa089a1da33c861ed6338f65f85918795ded6 /utils/regtools/qeditor/utils.cpp | |
| parent | cef5e1018e6e4c4d2aa8422e789bc0d79d310e52 (diff) | |
| download | rockbox-7749c4d0e960b3e4f92194bd8f63ed70cc9bcb31.zip rockbox-7749c4d0e960b3e4f92194bd8f63ed70cc9bcb31.tar.gz rockbox-7749c4d0e960b3e4f92194bd8f63ed70cc9bcb31.tar.bz2 rockbox-7749c4d0e960b3e4f92194bd8f63ed70cc9bcb31.tar.xz | |
qeditor: message widget now supports IDs, useful to clear messages
Change-Id: Ibe0a8909128469a71a25415761860e06fc9f1e67
Reviewed-on: http://gerrit.rockbox.org/1006
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
Diffstat (limited to 'utils/regtools/qeditor/utils.cpp')
| -rw-r--r-- | utils/regtools/qeditor/utils.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/utils/regtools/qeditor/utils.cpp b/utils/regtools/qeditor/utils.cpp index 4f408b4..effd79e 100644 --- a/utils/regtools/qeditor/utils.cpp +++ b/utils/regtools/qeditor/utils.cpp @@ -998,6 +998,8 @@ MessageWidget::MessageWidget(QWidget *parent) layout->addWidget(m_text, 1); layout->addWidget(m_close, 0); + m_id = 0; + connect(m_close, SIGNAL(clicked(bool)), this, SLOT(OnClose(bool))); hide(); @@ -1042,12 +1044,19 @@ void MessageWidget::UpdateType() .arg(border.name())); } -void MessageWidget::SetMessage(MessageType type, const QString& msg) +int MessageWidget::SetMessage(MessageType type, const QString& msg) { m_type = type; m_text->setText(msg); UpdateType(); show(); + return ++m_id; +} + +void MessageWidget::HideMessage(int id) +{ + if(m_id == id) + OnClose(true); } void MessageWidget::OnClose(bool clicked) |