VirtualBox

Changeset 69002 in vbox for trunk/src/VBox/Main/src-all


Ignore:
Timestamp:
Oct 6, 2017 12:49:53 PM (7 years ago)
Author:
vboxsync
Message:

bugref:8674. Added 2 new events into the Progress - "percentage changed" and "task completed".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/ProgressImpl.cpp

    r67242 r69002  
    4242#include "AutoCaller.h"
    4343
     44#include "VBoxEvents.h"
    4445
    4546Progress::Progress()
     
    168169
    169170    HRESULT rc = S_OK;
     171    rc = unconst(pEventSource).createObject();
     172    if (FAILED(rc)) throw rc;
     173
     174    rc = pEventSource->init();
     175    if (FAILED(rc)) throw rc;
    170176
    171177//    rc = Progress::init(
     
    475481        RTSemEventMultiSignal(mCompletedSem);
    476482
     483    fireProgressTaskCompletedEvent(pEventSource, mId.toUtf16().raw());
     484
    477485    return S_OK;
    478486}
     
    563571            vrc = VERR_CANCELLED;
    564572        }
     573        ULONG actualPercent = 0;
     574        pThis->getPercent(&actualPercent);
     575        fireProgressPercentageChangedEvent(pThis->pEventSource, pThis->mId.toUtf16().raw(), actualPercent);
    565576    }
    566577    /* else ignored */
     
    813824    m_ulOperationPercent = aPercent;
    814825
     826    ULONG actualPercent = 0;
     827    getPercent(&actualPercent);
     828    fireProgressPercentageChangedEvent(pEventSource, mId.toUtf16().raw(), actualPercent);
     829
    815830    return S_OK;
    816831}
     
    847862    if (mWaitersCount > 0)
    848863        RTSemEventMultiSignal(mCompletedSem);
     864
     865    ULONG actualPercent = 0;
     866    getPercent(&actualPercent);
     867    fireProgressPercentageChangedEvent(pEventSource, mId.toUtf16().raw(), actualPercent);
    849868
    850869    return S_OK;
     
    10751094}
    10761095
     1096HRESULT Progress::getEventSource(ComPtr<IEventSource> &aEventSource)
     1097{
     1098    /* event source is const, no need to lock */
     1099    pEventSource.queryInterfaceTo(aEventSource.asOutParam());
     1100    return S_OK;
     1101}
    10771102
    10781103// private internal helpers
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