VirtualBox

Changeset 90254 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 20, 2021 10:54:00 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Extend UIProgressTask with progress change handler/signal so that listeners could handle it too.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIProgressTask.cpp

    r90253 r90254  
    8181        {
    8282            /* Setup connections: */
     83            connect(m_pProgressObject.data(), &UIProgressObject::sigProgressChange,
     84                    this, &UIProgressTask::sltHandleProgressChange);
    8385            connect(m_pProgressObject.data(), &UIProgressObject::sigProgressEventHandlingFinished,
    8486                    this, &UIProgressTask::sltHandleProgressEventHandlingFinished);
     
    9496    if (m_pProgressObject)
    9597        m_pProgressObject->cancel();
     98}
     99
     100void UIProgressTask::sltHandleProgressChange(ulong /*uOperations*/, QString /*strOperation*/,
     101                                             ulong /*uOperation*/, ulong uPercent)
     102{
     103    /* Notify external listeners: */
     104    emit sigProgressChange(uPercent);
    96105}
    97106
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIProgressTask.h

    r90253 r90254  
    4646    /** Notifies listeners about progress has started. */
    4747    void sigProgressStarted();
     48    /** Notifies listeners about progress has changed.
     49      * @param  uPercent  Brings the progress percentage. */
     50    void sigProgressChange(ulong uPercent);
    4851    /** Notifies listeners about progress has finished. */
    4952    void sigProgressFinished();
     
    8588private slots:
    8689
     90    /** Handles progress change.
     91      * @param  iOperations   Brings the number of operations CProgress have.
     92      * @param  strOperation  Brings the description of the current CProgress operation.
     93      * @param  iOperation    Brings the index of the current CProgress operation.
     94      * @param  iPercent      Brings the percentage of the current CProgress operation. */
     95    void sltHandleProgressChange(ulong uOperations, QString strOperation,
     96                                 ulong uOperation, ulong uPercent);
    8797    /** Handles progress event handling finished signal. */
    8898    void sltHandleProgressEventHandlingFinished();
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