Changeset 86154 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Sep 17, 2020 1:19:41 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 140404
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r86152 r86154 808 808 src/globals/UITextTable.h \ 809 809 src/globals/UIVirtualBoxEventHandler.h \ 810 src/globals/UIVirtualBoxClientEventHandler.h \ 810 811 src/globals/VBoxUtils.h \ 811 812 src/logviewer/UIVMLogPage.h \ … … 986 987 src/globals/UIThreadPool.cpp \ 987 988 src/globals/UIVirtualBoxEventHandler.cpp \ 989 src/globals/UIVirtualBoxClientEventHandler.cpp \ 988 990 src/logviewer/UIVMLogViewerFilterPanel.cpp \ 989 991 src/logviewer/UIVMLogViewerSearchPanel.cpp \ … … 1323 1325 src/globals/UIVersion.cpp \ 1324 1326 src/globals/UIVirtualBoxEventHandler.cpp \ 1327 src/globals/UIVirtualBoxClientEventHandler.cpp \ 1325 1328 src/logviewer/UIVMLogPage.cpp \ 1326 1329 src/logviewer/UIVMLogViewerBookmarksPanel.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r85821 r86154 78 78 #include "UIIconPool.h" 79 79 #include "UIVirtualBoxEventHandler.h" 80 #include "UIVirtualBoxClientEventHandler.h" 80 81 #include "UIDesktopWidgetWatchdog.h" 81 82 #include "UIVisoCreator.h" … … 4110 4111 4111 4112 /* Watch for the VBoxSVC availability changes: */ 4112 connect(gVBox Events, &UIVirtualBoxEventHandler::sigVBoxSVCAvailabilityChange,4113 connect(gVBoxClientEvents, &UIVirtualBoxClientEventHandler::sigVBoxSVCAvailabilityChange, 4113 4114 this, &UICommon::sltHandleVBoxSVCAvailabilityChange); 4114 4115 … … 4574 4575 m_meCleanupProtectionToken.unlock(); 4575 4576 4576 /* Destroy the global (VirtualBox ) Main event handler4577 * 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. */ 4578 4579 UIVirtualBoxEventHandler::destroy(); 4580 UIVirtualBoxClientEventHandler::destroy(); 4579 4581 4580 4582 /* Destroy the extra-data manager finally after everything … … 4696 4698 /* Recreate Main event listeners: */ 4697 4699 UIVirtualBoxEventHandler::destroy(); 4700 UIVirtualBoxClientEventHandler::destroy(); 4698 4701 UIExtraDataManager::destroy(); 4699 4702 UIExtraDataManager::instance(); 4700 4703 UIVirtualBoxEventHandler::instance(); 4704 UIVirtualBoxClientEventHandler::instance(); 4701 4705 /* Ask UIStarter to restart UI: */ 4702 4706 emit sigAskToRestartUI(); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxClientEventHandler.cpp
r86152 r86154 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIVirtualBox EventHandler class implementation.3 * VBox Qt GUI - UIVirtualBoxClientEventHandler class implementation. 4 4 */ 5 5 … … 20 20 #include "UIExtraDataManager.h" 21 21 #include "UIMainEventListener.h" 22 #include "UIVirtualBox EventHandler.h"22 #include "UIVirtualBoxClientEventHandler.h" 23 23 24 24 /* COM includes: */ 25 25 #include "CEventListener.h" 26 26 #include "CEventSource.h" 27 #include "CVirtualBox.h"28 27 #include "CVirtualBoxClient.h" 29 28 30 29 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. */ 31 class UIVirtualBoxClientEventHandlerProxy : public QObject 34 32 { 35 33 Q_OBJECT; … … 40 38 void sigVBoxSVCAvailabilityChange(bool fAvailable); 41 39 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 82 40 public: 83 41 84 42 /** Constructs event proxy object on the basis of passed @a pParent. */ 85 UIVirtualBox EventHandlerProxy(QObject *pParent);43 UIVirtualBoxClientEventHandlerProxy(QObject *pParent); 86 44 /** Destructs event proxy object. */ 87 ~UIVirtualBox EventHandlerProxy();45 ~UIVirtualBoxClientEventHandlerProxy(); 88 46 89 47 protected: … … 119 77 120 78 /********************************************************************************************************************************* 121 * Class UIVirtualBox EventHandlerProxy implementation.*79 * Class UIVirtualBoxClientEventHandlerProxy implementation. * 122 80 *********************************************************************************************************************************/ 123 81 124 UIVirtualBox EventHandlerProxy::UIVirtualBoxEventHandlerProxy(QObject *pParent)82 UIVirtualBoxClientEventHandlerProxy::UIVirtualBoxClientEventHandlerProxy(QObject *pParent) 125 83 : QObject(pParent) 126 84 { … … 129 87 } 130 88 131 UIVirtualBox EventHandlerProxy::~UIVirtualBoxEventHandlerProxy()89 UIVirtualBoxClientEventHandlerProxy::~UIVirtualBoxClientEventHandlerProxy() 132 90 { 133 91 /* Cleanup: */ … … 135 93 } 136 94 137 void UIVirtualBox EventHandlerProxy::prepare()95 void UIVirtualBoxClientEventHandlerProxy::prepare() 138 96 { 139 97 /* Prepare: */ … … 142 100 } 143 101 144 void UIVirtualBox EventHandlerProxy::prepareListener()102 void UIVirtualBoxClientEventHandlerProxy::prepareListener() 145 103 { 146 104 /* Create Main event listener instance: */ … … 153 111 AssertWrapperOk(comVBoxClient); 154 112 /* 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); 169 115 170 116 /* Enumerate all the required event-types: */ 171 117 QVector<KVBoxEventType> eventTypes; 172 118 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; 191 120 192 121 /* Register event listener for event source aggregator: */ … … 203 132 } 204 133 205 void UIVirtualBox EventHandlerProxy::prepareConnections()134 void UIVirtualBoxClientEventHandlerProxy::prepareConnections() 206 135 { 207 136 /* Create direct (sync) connections for signals of main event listener. … … 210 139 this, SIGNAL(sigVBoxSVCAvailabilityChange(bool)), 211 140 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 143 void UIVirtualBoxClientEventHandlerProxy::cleanupConnections() 260 144 { 261 145 /* Nothing for now. */ 262 146 } 263 147 264 void UIVirtualBox EventHandlerProxy::cleanupListener()148 void UIVirtualBoxClientEventHandlerProxy::cleanupListener() 265 149 { 266 150 /* If event listener registered as passive one: */ … … 276 160 } 277 161 278 void UIVirtualBox EventHandlerProxy::cleanup()162 void UIVirtualBoxClientEventHandlerProxy::cleanup() 279 163 { 280 164 /* Cleanup: */ … … 285 169 286 170 /********************************************************************************************************************************* 287 * Class UIVirtualBox EventHandler implementation.*171 * Class UIVirtualBoxClientEventHandler implementation. * 288 172 *********************************************************************************************************************************/ 289 173 290 174 /* static */ 291 UIVirtualBox EventHandler *UIVirtualBoxEventHandler::s_pInstance = 0;175 UIVirtualBoxClientEventHandler *UIVirtualBoxClientEventHandler::s_pInstance = 0; 292 176 293 177 /* static */ 294 UIVirtualBox EventHandler *UIVirtualBoxEventHandler::instance()178 UIVirtualBoxClientEventHandler *UIVirtualBoxClientEventHandler::instance() 295 179 { 296 180 if (!s_pInstance) 297 s_pInstance = new UIVirtualBox EventHandler;181 s_pInstance = new UIVirtualBoxClientEventHandler; 298 182 return s_pInstance; 299 183 } 300 184 301 185 /* static */ 302 void UIVirtualBox EventHandler::destroy()186 void UIVirtualBoxClientEventHandler::destroy() 303 187 { 304 188 if (s_pInstance) … … 309 193 } 310 194 311 UIVirtualBox EventHandler::UIVirtualBoxEventHandler()312 : m_pProxy(new UIVirtualBox EventHandlerProxy(this))195 UIVirtualBoxClientEventHandler::UIVirtualBoxClientEventHandler() 196 : m_pProxy(new UIVirtualBoxClientEventHandlerProxy(this)) 313 197 { 314 198 /* Prepare: */ … … 316 200 } 317 201 318 void UIVirtualBox EventHandler::prepare()202 void UIVirtualBoxClientEventHandler::prepare() 319 203 { 320 204 /* Prepare connections: */ … … 322 206 } 323 207 324 void UIVirtualBox EventHandler::prepareConnections()208 void UIVirtualBoxClientEventHandler::prepareConnections() 325 209 { 326 210 /* Create queued (async) connections for signals of event proxy object. … … 329 213 this, SIGNAL(sigVBoxSVCAvailabilityChange(bool)), 330 214 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 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIVirtualBox EventHandler class declaration.3 * VBox Qt GUI - UIVirtualBoxClientEventHandler class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_globals_UIVirtualBox EventHandler_h19 #define FEQT_INCLUDED_SRC_globals_UIVirtualBox EventHandler_h18 #ifndef FEQT_INCLUDED_SRC_globals_UIVirtualBoxClientEventHandler_h 19 #define FEQT_INCLUDED_SRC_globals_UIVirtualBoxClientEventHandler_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 34 34 35 35 /* Forward declarations: */ 36 class UIVirtualBox EventHandlerProxy;36 class UIVirtualBoxClientEventHandlerProxy; 37 37 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. */ 39 class SHARED_LIBRARY_STUFF UIVirtualBoxClientEventHandler : public QObject 41 40 { 42 41 Q_OBJECT; … … 47 46 void sigVBoxSVCAvailabilityChange(bool fAvailable); 48 47 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 89 48 public: 90 49 91 50 /** Returns singleton instance. */ 92 static UIVirtualBox EventHandler *instance();51 static UIVirtualBoxClientEventHandler *instance(); 93 52 /** Destroys singleton instance. */ 94 53 static void destroy(); … … 96 55 protected: 97 56 98 /** Constructs VirtualBox event handler. */99 UIVirtualBox EventHandler();57 /** Constructs VirtualBoxClient event handler. */ 58 UIVirtualBoxClientEventHandler(); 100 59 101 60 /** Prepares all. */ … … 107 66 108 67 /** Holds the singleton instance. */ 109 static UIVirtualBox EventHandler *s_pInstance;68 static UIVirtualBoxClientEventHandler *s_pInstance; 110 69 111 /** Holds the VirtualBox event proxy instance. */112 UIVirtualBox EventHandlerProxy *m_pProxy;70 /** Holds the VirtualBoxClient event proxy instance. */ 71 UIVirtualBoxClientEventHandlerProxy *m_pProxy; 113 72 }; 114 73 115 /** Singleton VirtualBox Event Handler 'official' name. */116 #define gVBox Events UIVirtualBoxEventHandler::instance()74 /** Singleton VirtualBoxClient Event Handler 'official' name. */ 75 #define gVBoxClientEvents UIVirtualBoxClientEventHandler::instance() 117 76 118 #endif /* !FEQT_INCLUDED_SRC_globals_UIVirtualBox EventHandler_h */77 #endif /* !FEQT_INCLUDED_SRC_globals_UIVirtualBoxClientEventHandler_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.cpp
r86077 r86154 26 26 #include "CEventSource.h" 27 27 #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. */ 33 31 class UIVirtualBoxEventHandlerProxy : public QObject 34 32 { … … 36 34 37 35 signals: 38 39 /** Notifies about the VBoxSVC become @a fAvailable. */40 void sigVBoxSVCAvailabilityChange(bool fAvailable);41 36 42 37 /** Notifies about @a state change event for the machine with @a uId. */ … … 149 144 m_comEventListener = CEventListener(m_pQtListener); 150 145 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 158 146 /* Get VirtualBox: */ 159 147 const CVirtualBox comVBox = uiCommon().virtualBox(); 160 148 AssertWrapperOk(comVBox); 161 149 /* 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); 169 152 170 153 /* Enumerate all the required event-types: */ 171 154 QVector<KVBoxEventType> eventTypes; 172 155 eventTypes 173 /* For VirtualBoxClient: */174 << KVBoxEventType_OnVBoxSVCAvailabilityChanged175 /* For VirtualBox: */176 156 << KVBoxEventType_OnMachineStateChanged 177 157 << KVBoxEventType_OnMachineDataChanged … … 207 187 /* Create direct (sync) connections for signals of main event listener. 208 188 * 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);212 189 connect(m_pQtListener->getWrapped(), SIGNAL(sigMachineStateChange(QUuid, KMachineState)), 213 190 this, SIGNAL(sigMachineStateChange(QUuid, KMachineState)), … … 326 303 /* Create queued (async) connections for signals of event proxy object. 327 304 * 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);331 305 connect(m_pProxy, SIGNAL(sigMachineStateChange(QUuid, KMachineState)), 332 306 this, SIGNAL(sigMachineStateChange(QUuid, KMachineState)), -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVirtualBoxEventHandler.h
r86077 r86154 36 36 class UIVirtualBoxEventHandlerProxy; 37 37 38 /** Singleton QObject extension 39 * providing GUI with the CVirtualBoxClient and CVirtualBox event-sources. */ 38 /** Singleton QObject extension providing GUI with CVirtualBox event-source. */ 40 39 class SHARED_LIBRARY_STUFF UIVirtualBoxEventHandler : public QObject 41 40 { … … 43 42 44 43 signals: 45 46 /** Notifies about the VBoxSVC become @a fAvailable. */47 void sigVBoxSVCAvailabilityChange(bool fAvailable);48 44 49 45 /** Notifies about @a state change event for the machine with @a uId. */
Note:
See TracChangeset
for help on using the changeset viewer.