VirtualBox

Changeset 92293 in vbox for trunk/src


Ignore:
Timestamp:
Nov 9, 2021 1:58:00 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148139
Message:

FE/Qt: bugref:10067: UINotificationObject: Provide UINotificationObject interface with API to check whether object is done with its service.

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

Legend:

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

    r92284 r92293  
    6767}
    6868
     69bool UINotificationSimple::isDone() const
     70{
     71    return true;
     72}
     73
    6974QString UINotificationSimple::name() const
    7075{
     
    111116UINotificationProgress::UINotificationProgress()
    112117    : m_pTask(0)
    113     , m_fFinished(false)
    114118    , m_uPercent(0)
     119    , m_fDone(false)
    115120{
    116121}
     
    122127}
    123128
    124 bool UINotificationProgress::isFinished() const
    125 {
    126     return m_fFinished;
    127 }
    128 
    129129ulong UINotificationProgress::percent() const
    130130{
     
    145145{
    146146    return true;
     147}
     148
     149bool UINotificationProgress::isDone() const
     150{
     151    return m_fDone;
    147152}
    148153
     
    192197void UINotificationProgress::sltHandleProgressFinished()
    193198{
    194     m_fFinished = true;
    195199    m_uPercent = 100;
     200    m_fDone = true;
    196201    emit sigProgressFinished();
    197202
     
    212217UINotificationDownloader::UINotificationDownloader()
    213218    : m_pDownloader(0)
     219    , m_uPercent(0)
     220    , m_fDone(false)
    214221{
    215222}
     
    234241{
    235242    return true;
     243}
     244
     245bool UINotificationDownloader::isDone() const
     246{
     247    return m_fDone;
    236248}
    237249
     
    292304    m_pDownloader = 0;
    293305    m_strError = strError;
     306    m_fDone = true;
    294307    emit sigProgressFailed();
    295308}
     
    299312    delete m_pDownloader;
    300313    m_pDownloader = 0;
     314    m_fDone = true;
    301315    emit sigProgressCanceled();
    302316}
     
    306320    delete m_pDownloader;
    307321    m_pDownloader = 0;
     322    m_fDone = true;
    308323    emit sigProgressFinished();
    309324}
     
    326341}
    327342
     343QString UINotificationNewVersionChecker::error() const
     344{
     345    return m_strError;
     346}
     347
     348bool UINotificationNewVersionChecker::isCritical() const
     349{
     350    return m_pChecker ? m_pChecker->isItForcedCall() : true;
     351}
     352
    328353bool UINotificationNewVersionChecker::isDone() const
    329354{
    330355    return m_fDone;
    331 }
    332 
    333 QString UINotificationNewVersionChecker::error() const
    334 {
    335     return m_strError;
    336 }
    337 
    338 bool UINotificationNewVersionChecker::isCritical() const
    339 {
    340     return m_pChecker ? m_pChecker->isItForcedCall() : true;
    341356}
    342357
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObject.h

    r91843 r92293  
    5656    /** Returns whether object is critical. */
    5757    virtual bool isCritical() const = 0;
     58    /** Returns whether object is done. */
     59    virtual bool isDone() const = 0;
    5860    /** Returns object name. */
    5961    virtual QString name() const = 0;
     
    9698    /** Returns whether object is critical. */
    9799    virtual bool isCritical() const /* override */;
     100    /** Returns whether object is done. */
     101    virtual bool isDone() const /* override */;
    98102    /** Returns object name. */
    99103    virtual QString name() const /* override final */;
     
    149153    virtual CProgress createProgress(COMResult &comResult) = 0;
    150154
    151     /** Returns whether progress is finished. */
    152     bool isFinished() const;
    153155    /** Returns current progress percentage value. */
    154156    ulong percent() const;
     
    160162    /** Returns whether object is critical. */
    161163    virtual bool isCritical() const /* override */;
     164    /** Returns whether object is done. */
     165    virtual bool isDone() const /* override */;
    162166    /** Returns object internal name. */
    163167    virtual QString internalName() const /* override final */;
     
    185189    UINotificationProgressTask *m_pTask;
    186190
    187     /** Holds whether progress is finished. */
    188     bool   m_fFinished;
    189191    /** Holds the last cached progress percentage value. */
    190192    ulong  m_uPercent;
     193    /** Holds whether current progress is done. */
     194    bool   m_fDone;
    191195};
    192196
     
    228232    /** Returns whether object is critical. */
    229233    virtual bool isCritical() const /* override */;
     234    /** Returns whether object is done. */
     235    virtual bool isDone() const /* override */;
    230236    /** Returns object internal name. */
    231237    virtual QString internalName() const /* override final */;
     
    262268    /** Holds the error message is any. */
    263269    QString  m_strError;
     270    /** Holds whether current progress is done. */
     271    bool     m_fDone;
    264272};
    265273
     
    288296    virtual UINewVersionChecker *createChecker() = 0;
    289297
    290     /** Returns whether current progress is done. */
    291     bool isDone() const;
    292298    /** Returns error-message if any. */
    293299    QString error() const;
     
    295301    /** Returns whether object is critical. */
    296302    virtual bool isCritical() const /* override */;
     303    /** Returns whether object is done. */
     304    virtual bool isDone() const /* override */;
    297305    /** Returns object internal name. */
    298306    virtual QString internalName() const /* override final */;
     
    322330    UINewVersionChecker *m_pChecker;
    323331
     332    /** Holds the error message is any. */
     333    QString  m_strError;
    324334    /** Holds whether current progress is done. */
    325335    bool     m_fDone;
    326     /** Holds the error message is any. */
    327     QString  m_strError;
    328336};
    329337#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
Note: See TracChangeset for help on using the changeset viewer.

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