VirtualBox

Changeset 90600 in vbox


Ignore:
Timestamp:
Aug 10, 2021 3:13:39 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Open notification-center on object append only if it's critical.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.cpp

    r90566 r90600  
    171171QUuid UINotificationCenter::append(UINotificationObject *pObject)
    172172{
    173     /* Open if not yet: */
    174     if (!m_pOpenButton->isChecked())
     173    AssertPtrReturn(m_pModel, QUuid());
     174    const QUuid uId = m_pModel->appendObject(pObject);
     175
     176    /* Open if object is critical and center isn't opened yet: */
     177    if (!m_pOpenButton->isChecked() && pObject->isCritical())
    175178        m_pOpenButton->animateClick();
    176179
    177     AssertPtrReturn(m_pModel, QUuid());
    178     return m_pModel->appendObject(pObject);
     180    return uId;
    179181}
    180182
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObject.cpp

    r90591 r90600  
    6969}
    7070
     71bool UINotificationProgress::isCritical() const
     72{
     73    return true;
     74}
     75
    7176void UINotificationProgress::handle()
    7277{
     
    135140}
    136141
     142bool UINotificationDownloader::isCritical() const
     143{
     144    return true;
     145}
     146
    137147void UINotificationDownloader::handle()
    138148{
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObject.h

    r90590 r90600  
    5353    UINotificationObject();
    5454
     55    /** Returns whether object is critical. */
     56    virtual bool isCritical() const = 0;
    5557    /** Returns object name. */
    5658    virtual QString name() const = 0;
     
    98100    QString error() const;
    99101
     102    /** Returns whether object is critical. */
     103    virtual bool isCritical() const;
    100104    /** Handles notification-object being added. */
    101105    virtual void handle() /* override final */;
     
    161165    QString error() const;
    162166
     167    /** Returns whether object is critical. */
     168    virtual bool isCritical() const;
    163169    /** Handles notification-object being added. */
    164170    virtual void handle() /* override final */;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette