Changeset 41484 in vbox
- Timestamp:
- May 29, 2012 3:15:39 PM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r41122 r41484 60 60 /* Common variables: */ 61 61 , m_pMenuPool(0) 62 , m_machineState( KMachineState_Null)63 #if defined(Q_WS_WIN)62 , m_machineState(session().GetMachine().GetState()) 63 #ifdef Q_WS_WIN 64 64 , m_alphaCursor(0) 65 #endif 65 #endif /* Q_WS_WIN */ 66 66 /* Common flags: */ 67 67 , m_fIsFirstTimeStarted(false) … … 89 89 , m_fIsHidingHostPointer(true) 90 90 { 91 /* Explicit initialize the console event handler */ 92 UIConsoleEventHandler::instance(this); 93 94 /* Add console event connections */ 95 connect(gConsoleEvents, SIGNAL(sigMousePointerShapeChange(bool, bool, QPoint, QSize, QVector<uint8_t>)), 96 this, SLOT(sltMousePointerShapeChange(bool, bool, QPoint, QSize, QVector<uint8_t>))); 97 98 connect(gConsoleEvents, SIGNAL(sigMouseCapabilityChange(bool, bool, bool)), 99 this, SLOT(sltMouseCapabilityChange(bool, bool, bool))); 100 101 connect(gConsoleEvents, SIGNAL(sigKeyboardLedsChangeEvent(bool, bool, bool)), 102 this, SLOT(sltKeyboardLedsChangeEvent(bool, bool, bool))); 103 104 connect(gConsoleEvents, SIGNAL(sigStateChange(KMachineState)), 105 this, SLOT(sltStateChange(KMachineState))); 106 107 connect(gConsoleEvents, SIGNAL(sigAdditionsChange()), 108 this, SLOT(sltAdditionsChange())); 109 110 connect(gConsoleEvents, SIGNAL(sigVRDEChange()), 111 this, SLOT(sltVRDEChange())); 112 113 connect(gConsoleEvents, SIGNAL(sigNetworkAdapterChange(CNetworkAdapter)), 114 this, SIGNAL(sigNetworkAdapterChange(CNetworkAdapter))); 115 116 connect(gConsoleEvents, SIGNAL(sigMediumChange(CMediumAttachment)), 117 this, SIGNAL(sigMediumChange(CMediumAttachment))); 118 119 connect(gConsoleEvents, SIGNAL(sigUSBControllerChange()), 120 this, SIGNAL(sigUSBControllerChange())); 121 122 connect(gConsoleEvents, SIGNAL(sigUSBDeviceStateChange(CUSBDevice, bool, CVirtualBoxErrorInfo)), 123 this, SIGNAL(sigUSBDeviceStateChange(CUSBDevice, bool, CVirtualBoxErrorInfo))); 124 125 connect(gConsoleEvents, SIGNAL(sigSharedFolderChange()), 126 this, SIGNAL(sigSharedFolderChange())); 127 128 connect(gConsoleEvents, SIGNAL(sigRuntimeError(bool, QString, QString)), 129 this, SIGNAL(sigRuntimeError(bool, QString, QString))); 130 131 #ifdef Q_WS_MAC 132 connect(gConsoleEvents, SIGNAL(sigShowWindow()), 133 this, SIGNAL(sigShowWindows()), 134 Qt::QueuedConnection); 135 #endif /* Q_WS_MAC */ 136 137 connect(gConsoleEvents, SIGNAL(sigCPUExecutionCapChange()), 138 this, SIGNAL(sigCPUExecutionCapChange())); 139 140 connect(gConsoleEvents, SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)), 141 this, SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect))); 91 /* Prepare console event-handlers: */ 92 prepareConsoleEventHandlers(); 142 93 143 94 /* Prepare framebuffers: */ 144 95 prepareFramebuffers(); 145 96 146 /* Prepare main 97 /* Prepare main-menu: */ 147 98 prepareMenuPool(); 148 99 149 /* Load uisessionsettings: */100 /* Load settings: */ 150 101 loadSessionSettings(); 151 102 … … 161 112 UISession::~UISession() 162 113 { 163 /* Save uisessionsettings: */114 /* Save settings: */ 164 115 saveSessionSettings(); 165 116 166 /* Cleanup main 117 /* Cleanup main-menu: */ 167 118 cleanupMenuPool(); 168 119 … … 170 121 cleanupFramebuffers(); 171 122 172 /* Destroy the console event handler*/173 UIConsoleEventHandler::destroy();174 175 #if defined(Q_WS_WIN)123 /* Cleanup console event-handlers: */ 124 cleanupConsoleEventHandlers(); 125 126 #ifdef Q_WS_WIN 176 127 /* Destroy alpha cursor: */ 177 128 if (m_alphaCursor) 178 129 DestroyIcon(m_alphaCursor); 179 #endif 130 #endif /* Q_WS_WIN */ 180 131 } 181 132 … … 313 264 } 314 265 266 UIMachineLogic* UISession::machineLogic() const 267 { 268 return uimachine()->machineLogic(); 269 } 270 315 271 QWidget* UISession::mainMachineWindow() const 316 272 { 317 return uimachine()->machineLogic()->mainMachineWindow(); 318 } 319 320 UIMachineLogic* UISession::machineLogic() const 321 { 322 return uimachine()->machineLogic(); 273 return machineLogic()->mainMachineWindow(); 323 274 } 324 275 … … 349 300 bool UISession::setPause(bool fOn) 350 301 { 351 /* Commenting it out as isPaused() could reflect352 * quite obsolete state due to synchronization: */353 //if (isPaused() == fOn)354 // return true;355 356 302 CConsole console = session().GetConsole(); 357 303 … … 655 601 } 656 602 603 void UISession::prepareConsoleEventHandlers() 604 { 605 /* Initialize console event-handler: */ 606 UIConsoleEventHandler::instance(this); 607 608 /* Add console event connections: */ 609 connect(gConsoleEvents, SIGNAL(sigMousePointerShapeChange(bool, bool, QPoint, QSize, QVector<uint8_t>)), 610 this, SLOT(sltMousePointerShapeChange(bool, bool, QPoint, QSize, QVector<uint8_t>))); 611 612 connect(gConsoleEvents, SIGNAL(sigMouseCapabilityChange(bool, bool, bool)), 613 this, SLOT(sltMouseCapabilityChange(bool, bool, bool))); 614 615 connect(gConsoleEvents, SIGNAL(sigKeyboardLedsChangeEvent(bool, bool, bool)), 616 this, SLOT(sltKeyboardLedsChangeEvent(bool, bool, bool))); 617 618 connect(gConsoleEvents, SIGNAL(sigStateChange(KMachineState)), 619 this, SLOT(sltStateChange(KMachineState))); 620 621 connect(gConsoleEvents, SIGNAL(sigAdditionsChange()), 622 this, SLOT(sltAdditionsChange())); 623 624 connect(gConsoleEvents, SIGNAL(sigVRDEChange()), 625 this, SLOT(sltVRDEChange())); 626 627 connect(gConsoleEvents, SIGNAL(sigNetworkAdapterChange(CNetworkAdapter)), 628 this, SIGNAL(sigNetworkAdapterChange(CNetworkAdapter))); 629 630 connect(gConsoleEvents, SIGNAL(sigMediumChange(CMediumAttachment)), 631 this, SIGNAL(sigMediumChange(CMediumAttachment))); 632 633 connect(gConsoleEvents, SIGNAL(sigUSBControllerChange()), 634 this, SIGNAL(sigUSBControllerChange())); 635 636 connect(gConsoleEvents, SIGNAL(sigUSBDeviceStateChange(CUSBDevice, bool, CVirtualBoxErrorInfo)), 637 this, SIGNAL(sigUSBDeviceStateChange(CUSBDevice, bool, CVirtualBoxErrorInfo))); 638 639 connect(gConsoleEvents, SIGNAL(sigSharedFolderChange()), 640 this, SIGNAL(sigSharedFolderChange())); 641 642 connect(gConsoleEvents, SIGNAL(sigRuntimeError(bool, QString, QString)), 643 this, SIGNAL(sigRuntimeError(bool, QString, QString))); 644 645 #ifdef Q_WS_MAC 646 connect(gConsoleEvents, SIGNAL(sigShowWindow()), 647 this, SIGNAL(sigShowWindows()), Qt::QueuedConnection); 648 #endif /* Q_WS_MAC */ 649 650 connect(gConsoleEvents, SIGNAL(sigCPUExecutionCapChange()), 651 this, SIGNAL(sigCPUExecutionCapChange())); 652 653 connect(gConsoleEvents, SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect)), 654 this, SIGNAL(sigGuestMonitorChange(KGuestMonitorChangedEventType, ulong, QRect))); 655 } 656 657 657 void UISession::prepareFramebuffers() 658 658 { … … 749 749 } 750 750 m_frameBufferVector.clear(); 751 } 752 753 void UISession::cleanupConsoleEventHandlers() 754 { 755 /* Destroy console event-handler: */ 756 UIConsoleEventHandler::destroy(); 751 757 } 752 758 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r41051 r41484 88 88 CSession& session() { return m_session; } 89 89 KMachineState machineState() const { return m_machineState; } 90 UIMachineLogic* machineLogic() const; 90 91 QWidget* mainMachineWindow() const; 91 UIMachineLogic* machineLogic() const;92 92 QMenu* newMenu(UIMainMenuType fOptions = UIMainMenuType_All); 93 93 QMenuBar* newMenuBar(UIMainMenuType fOptions = UIMainMenuType_All); … … 201 201 202 202 /* Prepare helpers: */ 203 void prepareConsoleEventHandlers(); 203 204 void prepareFramebuffers(); 204 205 void prepareMenuPool(); … … 209 210 void cleanupMenuPool(); 210 211 void cleanupFramebuffers(); 212 void cleanupConsoleEventHandlers(); 211 213 212 214 /* Common helpers: */
Note:
See TracChangeset
for help on using the changeset viewer.