forked from qt-creator/qt-creator
InfoBar: Introduce suppression support
This facilitates a consistent mechanism for not repeating messages Change-Id: I5a766f104d7da8b3f5000c9814b5e4aff335a764 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
e763eec4ad
commit
aa0dc33d32
@@ -98,6 +98,24 @@ bool InfoBar::containsInfo(Id id) const
|
||||
return false;
|
||||
}
|
||||
|
||||
// Remove and suppress id
|
||||
void InfoBar::suppressInfo(Id id)
|
||||
{
|
||||
removeInfo(id);
|
||||
m_suppressed << id;
|
||||
}
|
||||
|
||||
// Info can not be added more than once, or if it is suppressed
|
||||
bool InfoBar::canInfoBeAdded(Id id) const
|
||||
{
|
||||
return !containsInfo(id) && !m_suppressed.contains(id);
|
||||
}
|
||||
|
||||
void InfoBar::enableInfo(Id id)
|
||||
{
|
||||
m_suppressed.remove(id);
|
||||
}
|
||||
|
||||
void InfoBar::clear()
|
||||
{
|
||||
if (!m_infoBarEntries.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user