VirtualBox

Ignore:
Timestamp:
Sep 17, 2020 1:19:41 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140404
Message:

FE/Qt: bugref:9653: UIVirtualBoxEventHandler: Split VirtualBox/VirtualBoxClient aggregated event handler to two separate, one per each of sources.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r86152 r86154  
    808808        src/globals/UITextTable.h \
    809809        src/globals/UIVirtualBoxEventHandler.h \
     810        src/globals/UIVirtualBoxClientEventHandler.h \
    810811        src/globals/VBoxUtils.h \
    811812        src/logviewer/UIVMLogPage.h \
     
    986987        src/globals/UIThreadPool.cpp \
    987988        src/globals/UIVirtualBoxEventHandler.cpp \
     989        src/globals/UIVirtualBoxClientEventHandler.cpp \
    988990        src/logviewer/UIVMLogViewerFilterPanel.cpp \
    989991        src/logviewer/UIVMLogViewerSearchPanel.cpp \
     
    13231325        src/globals/UIVersion.cpp \
    13241326        src/globals/UIVirtualBoxEventHandler.cpp \
     1327        src/globals/UIVirtualBoxClientEventHandler.cpp \
    13251328        src/logviewer/UIVMLogPage.cpp \
    13261329        src/logviewer/UIVMLogViewerBookmarksPanel.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r85821 r86154  
    7878#include "UIIconPool.h"
    7979#include "UIVirtualBoxEventHandler.h"
     80#include "UIVirtualBoxClientEventHandler.h"
    8081#include "UIDesktopWidgetWatchdog.h"
    8182#include "UIVisoCreator.h"
     
    41104111
    41114112    /* Watch for the VBoxSVC availability changes: */
    4112     connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigVBoxSVCAvailabilityChange,
     4113    connect(gVBoxClientEvents, &UIVirtualBoxClientEventHandler::sigVBoxSVCAvailabilityChange,
    41134114            this, &UICommon::sltHandleVBoxSVCAvailabilityChange);
    41144115
     
    45744575    m_meCleanupProtectionToken.unlock();
    45754576
    4576     /* Destroy the global (VirtualBox) Main event handler
    4577      * which is used in both Selector and Runtime UI. */
     4577    /* Destroy the global (VirtualBox and VirtualBoxClient) Main event
     4578     * handlers which are used in both Manager and Runtime UIs. */
    45784579    UIVirtualBoxEventHandler::destroy();
     4580    UIVirtualBoxClientEventHandler::destroy();
    45794581
    45804582    /* Destroy the extra-data manager finally after everything
     
    46964698                /* Recreate Main event listeners: */
    46974699                UIVirtualBoxEventHandler::destroy();
     4700                UIVirtualBoxClientEventHandler::destroy();
    46984701                UIExtraDataManager::destroy();
    46994702                UIExtraDataManager::instance();
    47004703                UIVirtualBoxEventHandler::instance();
     4704                UIVirtualBoxClientEventHandler::instance();
    47014705                /* Ask UIStarter to restart UI: */
    47024706                emit sigAskToRestartUI();
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxClientEventHandler.cpp

    r86152 r86154  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVirtualBoxEventHandler class implementation.
     3 * VBox Qt GUI - UIVirtualBoxClientEventHandler class implementation.
    44 */
    55
     
    2020#include "UIExtraDataManager.h"
    2121#include "UIMainEventListener.h"
    22 #include "UIVirtualBoxEventHandler.h"
     22#include "UIVirtualBoxClientEventHandler.h"
    2323
    2424/* COM includes: */
    2525#include "CEventListener.h"
    2626#include "CEventSource.h"
    27 #include "CVirtualBox.h"
    2827#include "CVirtualBoxClient.h"
    2928
    3029
    31 /** Private QObject extension
    32   * providing UIVirtualBoxEventHandler with the CVirtualBoxClient and CVirtualBox event-sources. */
    33 class UIVirtualBoxEventHandlerProxy : public QObject
     30/** Private QObject extension providing UIVirtualBoxClientEventHandler with CVirtualBoxClient event-source. */
     31class UIVirtualBoxClientEventHandlerProxy : public QObject
    3432{
    3533    Q_OBJECT;
     
    4038    void sigVBoxSVCAvailabilityChange(bool fAvailable);
    4139
    42     /** Notifies about @a state change event for the machine with @a uId. */
    43     void sigMachineStateChange(const QUuid &uId, const KMachineState state);
    44     /** Notifies about data change event for the machine with @a uId. */
    45     void sigMachineDataChange(const QUuid &uId);
    46     /** Notifies about machine with @a uId was @a fRegistered. */
    47     void sigMachineRegistered(const QUuid &uId, const bool fRegistered);
    48     /** Notifies about @a state change event for the session of the machine with @a uId. */
    49     void sigSessionStateChange(const QUuid &uId, const KSessionState state);
    50     /** Notifies about snapshot with @a uSnapshotId was taken for the machine with @a uId. */
    51     void sigSnapshotTake(const QUuid &uId, const QUuid &uSnapshotId);
    52     /** Notifies about snapshot with @a uSnapshotId was deleted for the machine with @a uId. */
    53     void sigSnapshotDelete(const QUuid &uId, const QUuid &uSnapshotId);
    54     /** Notifies about snapshot with @a uSnapshotId was changed for the machine with @a uId. */
    55     void sigSnapshotChange(const QUuid &uId, const QUuid &uSnapshotId);
    56     /** Notifies about snapshot with @a uSnapshotId was restored for the machine with @a uId. */
    57     void sigSnapshotRestore(const QUuid &uId, const QUuid &uSnapshotId);
    58     /** Notifies about request to uninstall cloud provider with @a uId. */
    59     void sigCloudProviderUninstall(const QUuid &uId);
    60     /** Notifies about cloud provider list changed. */
    61     void sigCloudProviderListChanged();
    62 
    63     /** Notifies about storage controller change.
    64       * @param  uMachineId         Brings the ID of machine corresponding controller belongs to.
    65       * @param  strControllerName  Brings the name of controller this event is related to. */
    66     void sigStorageControllerChange(const QUuid &uMachineId, const QString &strControllerName);
    67     /** Notifies about storage device change.
    68       * @param  comAttachment  Brings corresponding attachment.
    69       * @param  fRemoved       Brings whether medium is removed or added.
    70       * @param  fSilent        Brings whether this change has gone silent for guest. */
    71     void sigStorageDeviceChange(CMediumAttachment comAttachment, bool fRemoved, bool fSilent);
    72     /** Notifies about storage medium @a comAttachment state change. */
    73     void sigMediumChange(CMediumAttachment comAttachment);
    74     /** Notifies about storage @a comMedium config change. */
    75     void sigMediumConfigChange(CMedium comMedium);
    76     /** Notifies about storage medium is (un)registered.
    77       * @param  uMediumId      Brings corresponding medium ID.
    78       * @param  enmMediumType  Brings corresponding medium type.
    79       * @param  fRegistered    Brings whether medium is registered or unregistered. */
    80     void sigMediumRegistered(const QUuid &uMediumId, KDeviceType enmMediumType, bool fRegistered);
    81 
    8240public:
    8341
    8442    /** Constructs event proxy object on the basis of passed @a pParent. */
    85     UIVirtualBoxEventHandlerProxy(QObject *pParent);
     43    UIVirtualBoxClientEventHandlerProxy(QObject *pParent);
    8644    /** Destructs event proxy object. */
    87     ~UIVirtualBoxEventHandlerProxy();
     45    ~UIVirtualBoxClientEventHandlerProxy();
    8846
    8947protected:
     
    11977
    12078/*********************************************************************************************************************************
    121 *   Class UIVirtualBoxEventHandlerProxy implementation.                                                                          *
     79*   Class UIVirtualBoxClientEventHandlerProxy implementation.                                                                    *
    12280*********************************************************************************************************************************/
    12381
    124 UIVirtualBoxEventHandlerProxy::UIVirtualBoxEventHandlerProxy(QObject *pParent)
     82UIVirtualBoxClientEventHandlerProxy::UIVirtualBoxClientEventHandlerProxy(QObject *pParent)
    12583    : QObject(pParent)
    12684{
     
    12987}
    13088
    131 UIVirtualBoxEventHandlerProxy::~UIVirtualBoxEventHandlerProxy()
     89UIVirtualBoxClientEventHandlerProxy::~UIVirtualBoxClientEventHandlerProxy()
    13290{
    13391    /* Cleanup: */
     
    13593}
    13694
    137 void UIVirtualBoxEventHandlerProxy::prepare()
     95void UIVirtualBoxClientEventHandlerProxy::prepare()
    13896{
    13997    /* Prepare: */
     
    142100}
    143101
    144 void UIVirtualBoxEventHandlerProxy::prepareListener()
     102void UIVirtualBoxClientEventHandlerProxy::prepareListener()
    145103{
    146104    /* Create Main event listener instance: */
     
    153111    AssertWrapperOk(comVBoxClient);
    154112    /* Get VirtualBoxClient event source: */
    155     CEventSource comEventSourceVBoxClient = comVBoxClient.GetEventSource();
    156     AssertWrapperOk(comEventSourceVBoxClient);
    157 
    158     /* Get VirtualBox: */
    159     const CVirtualBox comVBox = uiCommon().virtualBox();
    160     AssertWrapperOk(comVBox);
    161     /* Get VirtualBox event source: */
    162     CEventSource comEventSourceVBox = comVBox.GetEventSource();
    163     AssertWrapperOk(comEventSourceVBox);
    164 
    165     /* Create event source aggregator: */
    166     m_comEventSource = comEventSourceVBoxClient.CreateAggregator(QVector<CEventSource>()
    167                                                                  << comEventSourceVBoxClient
    168                                                                  << comEventSourceVBox);
     113    m_comEventSource = comVBoxClient.GetEventSource();
     114    AssertWrapperOk(m_comEventSource);
    169115
    170116    /* Enumerate all the required event-types: */
    171117    QVector<KVBoxEventType> eventTypes;
    172118    eventTypes
    173         /* For VirtualBoxClient: */
    174         << KVBoxEventType_OnVBoxSVCAvailabilityChanged
    175         /* For VirtualBox: */
    176         << KVBoxEventType_OnMachineStateChanged
    177         << KVBoxEventType_OnMachineDataChanged
    178         << KVBoxEventType_OnMachineRegistered
    179         << KVBoxEventType_OnSessionStateChanged
    180         << KVBoxEventType_OnSnapshotTaken
    181         << KVBoxEventType_OnSnapshotDeleted
    182         << KVBoxEventType_OnSnapshotChanged
    183         << KVBoxEventType_OnSnapshotRestored
    184         << KVBoxEventType_OnCloudProviderListChanged
    185         << KVBoxEventType_OnCloudProviderUninstall
    186         << KVBoxEventType_OnStorageControllerChanged
    187         << KVBoxEventType_OnStorageDeviceChanged
    188         << KVBoxEventType_OnMediumChanged
    189         << KVBoxEventType_OnMediumConfigChanged
    190         << KVBoxEventType_OnMediumRegistered;
     119        << KVBoxEventType_OnVBoxSVCAvailabilityChanged;
    191120
    192121    /* Register event listener for event source aggregator: */
     
    203132}
    204133
    205 void UIVirtualBoxEventHandlerProxy::prepareConnections()
     134void UIVirtualBoxClientEventHandlerProxy::prepareConnections()
    206135{
    207136    /* Create direct (sync) connections for signals of main event listener.
     
    210139            this, SIGNAL(sigVBoxSVCAvailabilityChange(bool)),
    211140            Qt::DirectConnection);
    212     connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineStateChange(QUuid, KMachineState)),
    213             this, SIGNAL(sigMachineStateChange(QUuid, KMachineState)),
    214             Qt::DirectConnection);
    215     connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineDataChange(QUuid)),
    216             this, SIGNAL(sigMachineDataChange(QUuid)),
    217             Qt::DirectConnection);
    218     connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineRegistered(QUuid, bool)),
    219             this, SIGNAL(sigMachineRegistered(QUuid, bool)),
    220             Qt::DirectConnection);
    221     connect(m_pQtListener->getWrapped(), SIGNAL(sigSessionStateChange(QUuid, KSessionState)),
    222             this, SIGNAL(sigSessionStateChange(QUuid, KSessionState)),
    223             Qt::DirectConnection);
    224     connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotTake(QUuid, QUuid)),
    225             this, SIGNAL(sigSnapshotTake(QUuid, QUuid)),
    226             Qt::DirectConnection);
    227     connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotDelete(QUuid, QUuid)),
    228             this, SIGNAL(sigSnapshotDelete(QUuid, QUuid)),
    229             Qt::DirectConnection);
    230     connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotChange(QUuid, QUuid)),
    231             this, SIGNAL(sigSnapshotChange(QUuid, QUuid)),
    232             Qt::DirectConnection);
    233     connect(m_pQtListener->getWrapped(), SIGNAL(sigSnapshotRestore(QUuid, QUuid)),
    234             this, SIGNAL(sigSnapshotRestore(QUuid, QUuid)),
    235             Qt::DirectConnection);
    236     connect(m_pQtListener->getWrapped(), SIGNAL(sigCloudProviderListChanged()),
    237             this, SIGNAL(sigCloudProviderListChanged()),
    238             Qt::DirectConnection);
    239     connect(m_pQtListener->getWrapped(), SIGNAL(sigCloudProviderUninstall(QUuid)),
    240             this, SIGNAL(sigCloudProviderUninstall(QUuid)),
    241             Qt::DirectConnection);
    242     connect(m_pQtListener->getWrapped(), SIGNAL(sigStorageControllerChange(QUuid, QString)),
    243             this, SIGNAL(sigStorageControllerChange(QUuid, QString)),
    244             Qt::DirectConnection);
    245     connect(m_pQtListener->getWrapped(), SIGNAL(sigStorageDeviceChange(CMediumAttachment, bool, bool)),
    246             this, SIGNAL(sigStorageDeviceChange(CMediumAttachment, bool, bool)),
    247             Qt::DirectConnection);
    248     connect(m_pQtListener->getWrapped(), SIGNAL(sigMediumChange(CMediumAttachment)),
    249             this, SIGNAL(sigMediumChange(CMediumAttachment)),
    250             Qt::DirectConnection);
    251     connect(m_pQtListener->getWrapped(), SIGNAL(sigMediumConfigChange(CMedium)),
    252             this, SIGNAL(sigMediumConfigChange(CMedium)),
    253             Qt::DirectConnection);
    254     connect(m_pQtListener->getWrapped(), SIGNAL(sigMediumRegistered(QUuid, KDeviceType, bool)),
    255             this, SIGNAL(sigMediumRegistered(QUuid, KDeviceType, bool)),
    256             Qt::DirectConnection);
    257 }
    258 
    259 void UIVirtualBoxEventHandlerProxy::cleanupConnections()
     141}
     142
     143void UIVirtualBoxClientEventHandlerProxy::cleanupConnections()
    260144{
    261145    /* Nothing for now. */
    262146}
    263147
    264 void UIVirtualBoxEventHandlerProxy::cleanupListener()
     148void UIVirtualBoxClientEventHandlerProxy::cleanupListener()
    265149{
    266150    /* If event listener registered as passive one: */
     
    276160}
    277161
    278 void UIVirtualBoxEventHandlerProxy::cleanup()
     162void UIVirtualBoxClientEventHandlerProxy::cleanup()
    279163{
    280164    /* Cleanup: */
     
    285169
    286170/*********************************************************************************************************************************
    287 *   Class UIVirtualBoxEventHandler implementation.                                                                               *
     171*   Class UIVirtualBoxClientEventHandler implementation.                                                                         *
    288172*********************************************************************************************************************************/
    289173
    290174/* static */
    291 UIVirtualBoxEventHandler *UIVirtualBoxEventHandler::s_pInstance = 0;
     175UIVirtualBoxClientEventHandler *UIVirtualBoxClientEventHandler::s_pInstance = 0;
    292176
    293177/* static */
    294 UIVirtualBoxEventHandler *UIVirtualBoxEventHandler::instance()
     178UIVirtualBoxClientEventHandler *UIVirtualBoxClientEventHandler::instance()
    295179{
    296180    if (!s_pInstance)
    297         s_pInstance = new UIVirtualBoxEventHandler;
     181        s_pInstance = new UIVirtualBoxClientEventHandler;
    298182    return s_pInstance;
    299183}
    300184
    301185/* static */
    302 void UIVirtualBoxEventHandler::destroy()
     186void UIVirtualBoxClientEventHandler::destroy()
    303187{
    304188    if (s_pInstance)
     
    309193}
    310194
    311 UIVirtualBoxEventHandler::UIVirtualBoxEventHandler()
    312     : m_pProxy(new UIVirtualBoxEventHandlerProxy(this))
     195UIVirtualBoxClientEventHandler::UIVirtualBoxClientEventHandler()
     196    : m_pProxy(new UIVirtualBoxClientEventHandlerProxy(this))
    313197{
    314198    /* Prepare: */
     
    316200}
    317201
    318 void UIVirtualBoxEventHandler::prepare()
     202void UIVirtualBoxClientEventHandler::prepare()
    319203{
    320204    /* Prepare connections: */
     
    322206}
    323207
    324 void UIVirtualBoxEventHandler::prepareConnections()
     208void UIVirtualBoxClientEventHandler::prepareConnections()
    325209{
    326210    /* Create queued (async) connections for signals of event proxy object.
     
    329213            this, SIGNAL(sigVBoxSVCAvailabilityChange(bool)),
    330214            Qt::QueuedConnection);
    331     connect(m_pProxy, SIGNAL(sigMachineStateChange(QUuid, KMachineState)),
    332             this, SIGNAL(sigMachineStateChange(QUuid, KMachineState)),
    333             Qt::QueuedConnection);
    334     connect(m_pProxy, SIGNAL(sigMachineDataChange(QUuid)),
    335             this, SIGNAL(sigMachineDataChange(QUuid)),
    336             Qt::QueuedConnection);
    337     connect(m_pProxy, SIGNAL(sigMachineRegistered(QUuid, bool)),
    338             this, SIGNAL(sigMachineRegistered(QUuid, bool)),
    339             Qt::QueuedConnection);
    340     connect(m_pProxy, SIGNAL(sigSessionStateChange(QUuid, KSessionState)),
    341             this, SIGNAL(sigSessionStateChange(QUuid, KSessionState)),
    342             Qt::QueuedConnection);
    343     connect(m_pProxy, SIGNAL(sigSnapshotTake(QUuid, QUuid)),
    344             this, SIGNAL(sigSnapshotTake(QUuid, QUuid)),
    345             Qt::QueuedConnection);
    346     connect(m_pProxy, SIGNAL(sigSnapshotDelete(QUuid, QUuid)),
    347             this, SIGNAL(sigSnapshotDelete(QUuid, QUuid)),
    348             Qt::QueuedConnection);
    349     connect(m_pProxy, SIGNAL(sigSnapshotChange(QUuid, QUuid)),
    350             this, SIGNAL(sigSnapshotChange(QUuid, QUuid)),
    351             Qt::QueuedConnection);
    352     connect(m_pProxy, SIGNAL(sigSnapshotRestore(QUuid, QUuid)),
    353             this, SIGNAL(sigSnapshotRestore(QUuid, QUuid)),
    354             Qt::QueuedConnection);
    355     connect(m_pProxy, SIGNAL(sigCloudProviderListChanged()),
    356             this, SIGNAL(sigCloudProviderListChanged()),
    357             Qt::QueuedConnection);
    358     connect(m_pProxy, SIGNAL(sigCloudProviderUninstall(QUuid)),
    359             this, SIGNAL(sigCloudProviderUninstall(QUuid)),
    360             Qt::BlockingQueuedConnection);
    361     connect(m_pProxy, SIGNAL(sigStorageControllerChange(QUuid, QString)),
    362             this, SIGNAL(sigStorageControllerChange(QUuid, QString)),
    363             Qt::QueuedConnection);
    364     connect(m_pProxy, SIGNAL(sigStorageDeviceChange(CMediumAttachment, bool, bool)),
    365             this, SIGNAL(sigStorageDeviceChange(CMediumAttachment, bool, bool)),
    366             Qt::QueuedConnection);
    367     connect(m_pProxy, SIGNAL(sigMediumChange(CMediumAttachment)),
    368             this, SIGNAL(sigMediumChange(CMediumAttachment)),
    369             Qt::QueuedConnection);
    370     connect(m_pProxy, SIGNAL(sigMediumConfigChange(CMedium)),
    371             this, SIGNAL(sigMediumConfigChange(CMedium)),
    372             Qt::QueuedConnection);
    373     connect(m_pProxy, SIGNAL(sigMediumRegistered(QUuid, KDeviceType, bool)),
    374             this, SIGNAL(sigMediumRegistered(QUuid, KDeviceType, bool)),
    375             Qt::QueuedConnection);
    376 }
    377 
    378 
    379 #include "UIVirtualBoxEventHandler.moc"
    380 
     215}
     216
     217
     218#include "UIVirtualBoxClientEventHandler.moc"
     219
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxClientEventHandler.h

    r86152 r86154  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVirtualBoxEventHandler class declaration.
     3 * VBox Qt GUI - UIVirtualBoxClientEventHandler class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef FEQT_INCLUDED_SRC_globals_UIVirtualBoxEventHandler_h
    19 #define FEQT_INCLUDED_SRC_globals_UIVirtualBoxEventHandler_h
     18#ifndef FEQT_INCLUDED_SRC_globals_UIVirtualBoxClientEventHandler_h
     19#define FEQT_INCLUDED_SRC_globals_UIVirtualBoxClientEventHandler_h
    2020#ifndef RT_WITHOUT_PRAGMA_ONCE
    2121# pragma once
     
    3434
    3535/* Forward declarations: */
    36 class UIVirtualBoxEventHandlerProxy;
     36class UIVirtualBoxClientEventHandlerProxy;
    3737
    38 /** Singleton QObject extension
    39   * providing GUI with the CVirtualBoxClient and CVirtualBox event-sources. */
    40 class SHARED_LIBRARY_STUFF UIVirtualBoxEventHandler : public QObject
     38/** Singleton QObject extension providing GUI with CVirtualBoxClient event-source. */
     39class SHARED_LIBRARY_STUFF UIVirtualBoxClientEventHandler : public QObject
    4140{
    4241    Q_OBJECT;
     
    4746    void sigVBoxSVCAvailabilityChange(bool fAvailable);
    4847
    49     /** Notifies about @a state change event for the machine with @a uId. */
    50     void sigMachineStateChange(const QUuid &uId, const KMachineState state);
    51     /** Notifies about data change event for the machine with @a uId. */
    52     void sigMachineDataChange(const QUuid &uId);
    53     /** Notifies about machine with @a uId was @a fRegistered. */
    54     void sigMachineRegistered(const QUuid &uId, const bool fRegistered);
    55     /** Notifies about @a state change event for the session of the machine with @a uId. */
    56     void sigSessionStateChange(const QUuid &uId, const KSessionState state);
    57     /** Notifies about snapshot with @a uSnapshotId was taken for the machine with @a uId. */
    58     void sigSnapshotTake(const QUuid &uId, const QUuid &uSnapshotId);
    59     /** Notifies about snapshot with @a uSnapshotId was deleted for the machine with @a uId. */
    60     void sigSnapshotDelete(const QUuid &uId, const QUuid &uSnapshotId);
    61     /** Notifies about snapshot with @a uSnapshotId was changed for the machine with @a uId. */
    62     void sigSnapshotChange(const QUuid &uId, const QUuid &uSnapshotId);
    63     /** Notifies about snapshot with @a uSnapshotId was restored for the machine with @a uId. */
    64     void sigSnapshotRestore(const QUuid &uId, const QUuid &uSnapshotId);
    65     /** Notifies about request to uninstall cloud provider with @a uId. */
    66     void sigCloudProviderUninstall(const QUuid &uId);
    67     /** Notifies about cloud provider list changed. */
    68     void sigCloudProviderListChanged();
    69 
    70     /** Notifies about storage controller change.
    71       * @param  uMachineId         Brings the ID of machine corresponding controller belongs to.
    72       * @param  strControllerName  Brings the name of controller this event is related to. */
    73     void sigStorageControllerChange(const QUuid &uMachineId, const QString &strControllerName);
    74     /** Notifies about storage device change.
    75       * @param  comAttachment  Brings corresponding attachment.
    76       * @param  fRemoved       Brings whether medium is removed or added.
    77       * @param  fSilent        Brings whether this change has gone silent for guest. */
    78     void sigStorageDeviceChange(CMediumAttachment comAttachment, bool fRemoved, bool fSilent);
    79     /** Notifies about storage medium @a comAttachment state change. */
    80     void sigMediumChange(CMediumAttachment comAttachment);
    81     /** Notifies about storage @a comMedium config change. */
    82     void sigMediumConfigChange(CMedium comMedium);
    83     /** Notifies about storage medium is (un)registered.
    84       * @param  uMediumId      Brings corresponding medium ID.
    85       * @param  enmMediumType  Brings corresponding medium type.
    86       * @param  fRegistered    Brings whether medium is registered or unregistered. */
    87     void sigMediumRegistered(const QUuid &uMediumId, KDeviceType enmMediumType, bool fRegistered);
    88 
    8948public:
    9049
    9150    /** Returns singleton instance. */
    92     static UIVirtualBoxEventHandler *instance();
     51    static UIVirtualBoxClientEventHandler *instance();
    9352    /** Destroys singleton instance. */
    9453    static void destroy();
     
    9655protected:
    9756
    98     /** Constructs VirtualBox event handler. */
    99     UIVirtualBoxEventHandler();
     57    /** Constructs VirtualBoxClient event handler. */
     58    UIVirtualBoxClientEventHandler();
    10059
    10160    /** Prepares all. */
     
    10766
    10867    /** Holds the singleton instance. */
    109     static UIVirtualBoxEventHandler *s_pInstance;
     68    static UIVirtualBoxClientEventHandler *s_pInstance;
    11069
    111     /** Holds the VirtualBox event proxy instance. */
    112     UIVirtualBoxEventHandlerProxy *m_pProxy;
     70    /** Holds the VirtualBoxClient event proxy instance. */
     71    UIVirtualBoxClientEventHandlerProxy *m_pProxy;
    11372};
    11473
    115 /** Singleton VirtualBox Event Handler 'official' name. */
    116 #define gVBoxEvents UIVirtualBoxEventHandler::instance()
     74/** Singleton VirtualBoxClient Event Handler 'official' name. */
     75#define gVBoxClientEvents UIVirtualBoxClientEventHandler::instance()
    11776
    118 #endif /* !FEQT_INCLUDED_SRC_globals_UIVirtualBoxEventHandler_h */
     77#endif /* !FEQT_INCLUDED_SRC_globals_UIVirtualBoxClientEventHandler_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.cpp

    r86077 r86154  
    2626#include "CEventSource.h"
    2727#include "CVirtualBox.h"
    28 #include "CVirtualBoxClient.h"
    29 
    30 
    31 /** Private QObject extension
    32   * providing UIVirtualBoxEventHandler with the CVirtualBoxClient and CVirtualBox event-sources. */
     28
     29
     30/** Private QObject extension providing UIVirtualBoxEventHandler with CVirtualBox event-source. */
    3331class UIVirtualBoxEventHandlerProxy : public QObject
    3432{
     
    3634
    3735signals:
    38 
    39     /** Notifies about the VBoxSVC become @a fAvailable. */
    40     void sigVBoxSVCAvailabilityChange(bool fAvailable);
    4136
    4237    /** Notifies about @a state change event for the machine with @a uId. */
     
    149144    m_comEventListener = CEventListener(m_pQtListener);
    150145
    151     /* Get VirtualBoxClient: */
    152     const CVirtualBoxClient comVBoxClient = uiCommon().virtualBoxClient();
    153     AssertWrapperOk(comVBoxClient);
    154     /* Get VirtualBoxClient event source: */
    155     CEventSource comEventSourceVBoxClient = comVBoxClient.GetEventSource();
    156     AssertWrapperOk(comEventSourceVBoxClient);
    157 
    158146    /* Get VirtualBox: */
    159147    const CVirtualBox comVBox = uiCommon().virtualBox();
    160148    AssertWrapperOk(comVBox);
    161149    /* Get VirtualBox event source: */
    162     CEventSource comEventSourceVBox = comVBox.GetEventSource();
    163     AssertWrapperOk(comEventSourceVBox);
    164 
    165     /* Create event source aggregator: */
    166     m_comEventSource = comEventSourceVBoxClient.CreateAggregator(QVector<CEventSource>()
    167                                                                  << comEventSourceVBoxClient
    168                                                                  << comEventSourceVBox);
     150    m_comEventSource = comVBox.GetEventSource();
     151    AssertWrapperOk(m_comEventSource);
    169152
    170153    /* Enumerate all the required event-types: */
    171154    QVector<KVBoxEventType> eventTypes;
    172155    eventTypes
    173         /* For VirtualBoxClient: */
    174         << KVBoxEventType_OnVBoxSVCAvailabilityChanged
    175         /* For VirtualBox: */
    176156        << KVBoxEventType_OnMachineStateChanged
    177157        << KVBoxEventType_OnMachineDataChanged
     
    207187    /* Create direct (sync) connections for signals of main event listener.
    208188     * Keep in mind that the abstract Qt4 connection notation should be used here. */
    209     connect(m_pQtListener->getWrapped(), SIGNAL(sigVBoxSVCAvailabilityChange(bool)),
    210             this, SIGNAL(sigVBoxSVCAvailabilityChange(bool)),
    211             Qt::DirectConnection);
    212189    connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineStateChange(QUuid, KMachineState)),
    213190            this, SIGNAL(sigMachineStateChange(QUuid, KMachineState)),
     
    326303    /* Create queued (async) connections for signals of event proxy object.
    327304     * Keep in mind that the abstract Qt4 connection notation should be used here. */
    328     connect(m_pProxy, SIGNAL(sigVBoxSVCAvailabilityChange(bool)),
    329             this, SIGNAL(sigVBoxSVCAvailabilityChange(bool)),
    330             Qt::QueuedConnection);
    331305    connect(m_pProxy, SIGNAL(sigMachineStateChange(QUuid, KMachineState)),
    332306            this, SIGNAL(sigMachineStateChange(QUuid, KMachineState)),
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.h

    r86077 r86154  
    3636class UIVirtualBoxEventHandlerProxy;
    3737
    38 /** Singleton QObject extension
    39   * providing GUI with the CVirtualBoxClient and CVirtualBox event-sources. */
     38/** Singleton QObject extension providing GUI with CVirtualBox event-source. */
    4039class SHARED_LIBRARY_STUFF UIVirtualBoxEventHandler : public QObject
    4140{
     
    4342
    4443signals:
    45 
    46     /** Notifies about the VBoxSVC become @a fAvailable. */
    47     void sigVBoxSVCAvailabilityChange(bool fAvailable);
    4844
    4945    /** Notifies about @a state change event for the machine with @a uId. */
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