- Timestamp:
- Feb 16, 2018 12:46:20 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r71005 r71037 378 378 src/runtime/information/guestctrl/UIGuestControlConsole.h \ 379 379 src/runtime/information/guestctrl/UIGuestControlInterface.h \ 380 src/runtime/information/guestctrl/UIGuestSessionsEventHandler.h \381 380 src/runtime/information/guestctrl/UIGuestSessionTreeItem.h \ 382 381 src/runtime/information/guestctrl/UIInformationGuestSession.h \ … … 566 565 src/runtime/UIIndicatorsPool.cpp \ 567 566 src/runtime/UIStatusBarEditorWindow.cpp \ 568 src/runtime/information/guestctrl/UIGuestSessionsEventHandler.cpp \569 567 src/selector/UIActionPoolSelector.cpp \ 570 568 src/selector/UIDesktopPane.cpp \ … … 710 708 src/runtime/information/guestctrl/UIGuestControlInterface.cpp \ 711 709 src/runtime/information/guestctrl/UIInformationGuestSession.cpp \ 712 src/runtime/information/guestctrl/UIGuestSessionsEventHandler.cpp \713 710 src/runtime/information/guestctrl/UIGuestSessionTreeItem.cpp \ 714 711 src/runtime/normal/UIKeyboardHandlerNormal.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r70899 r71037 243 243 } 244 244 245 UIInformationGuestSession *pGuestSessionWidget = 246 new UIInformationGuestSession(this, m_pMachineWindow->console()); 247 if (pGuestSessionWidget) 248 { 249 m_tabs.insert(2, pGuestSessionWidget); 250 m_pTabWidget->addTab(m_tabs.value(2), QString()); 251 } 252 245 if(m_pMachineWindow->console().isOk()) 246 { 247 UIInformationGuestSession *pGuestSessionWidget = 248 new UIInformationGuestSession(this, m_pMachineWindow->console().GetGuest()); 249 if (pGuestSessionWidget) 250 { 251 m_tabs.insert(2, pGuestSessionWidget); 252 m_pTabWidget->addTab(m_tabs.value(2), QString()); 253 } 254 } 253 255 /* Set Runtime Information tab as default: */ 254 256 m_pTabWidget->setCurrentIndex(1); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIGuestSessionTreeItem.cpp
r71025 r71037 22 22 /* GUI includes: */ 23 23 # include "UIGuestSessionTreeItem.h" 24 # include "UIGuestSessionsEventHandler.h"25 24 # include "VBoxGlobal.h" 26 25 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIInformationGuestSession.cpp
r71025 r71037 27 27 /* GUI includes: */ 28 28 # include "QITreeWidget.h" 29 # include "UIExtraDataManager.h" 29 30 # include "UIGuestControlConsole.h" 30 31 # include "UIGuestControlInterface.h" 31 32 # include "UIGuestSessionTreeItem.h" 32 # include "UIGuestSessionsEventHandler.h"33 33 # include "UIInformationGuestSession.h" 34 34 35 # include "VBoxGlobal.h" 35 36 36 37 /* COM includes: */ 37 38 # include "CGuest.h" 39 # include "CEventSource.h" 38 40 39 41 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 40 42 41 UIInformationGuestSession::UIInformationGuestSession(QWidget *pParent, const C Console &console)43 UIInformationGuestSession::UIInformationGuestSession(QWidget *pParent, const CGuest &comGuest) 42 44 : QWidget(pParent) 43 , m_com Console(console)45 , m_comGuest(comGuest) 44 46 , m_pMainLayout(0) 45 47 , m_pSplitter(0) 46 , m_pGuestSessionsEventHandler(0)47 48 , m_pTreeWidget(0) 48 49 , m_pConsole(0) 49 50 , m_pControlInterface(0) 50 { 51 , m_pQtListener(0) 52 { 53 prepareListener(); 51 54 prepareObjects(); 52 55 prepareConnections(); 53 54 // if(m_pControlInterface)55 // m_pControlInterface->unitTest();56 56 } 57 57 58 58 void UIInformationGuestSession::prepareObjects() 59 59 { 60 m_pGuestSessionsEventHandler = new UIGuestSessionsEventHandler(this, m_comConsole.GetGuest()); 61 m_pControlInterface = new UIGuestControlInterface(this, m_comConsole.GetGuest()); 60 m_pControlInterface = new UIGuestControlInterface(this, m_comGuest); 62 61 63 62 /* Create layout: */ … … 101 100 if (!m_pTreeWidget) 102 101 return; 103 if (!m_pGuestSessionsEventHandler)104 return;105 102 106 103 m_pTreeWidget->clear(); 107 104 QVector<QITreeWidgetItem> treeItemVector; 108 m_pGuestSessionsEventHandler->populateGuestSessionsTree(m_pTreeWidget);109 105 update(); 110 106 } … … 116 112 connect(m_pConsole, &UIGuestControlConsole::commandEntered, 117 113 this, &UIInformationGuestSession::sltConsoleCommandEntered); 118 connect(m_pGuestSessionsEventHandler, &UIGuestSessionsEventHandler::sigGuestSessionsUpdated, 119 this, &UIInformationGuestSession::sltGuestSessionsUpdated); 114 if(m_pQtListener) 115 { 116 connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigGuestSessionRegistered, 117 this, &UIInformationGuestSession::sltGuestSessionRegistered, Qt::DirectConnection); 118 connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigGuestSessionUnregistered, 119 this, &UIInformationGuestSession::sltGuestSessionUnregistered, Qt::DirectConnection); 120 } 120 121 } 121 122 … … 140 141 } 141 142 } 143 144 void UIInformationGuestSession::prepareListener() 145 { 146 /* Create event listener instance: */ 147 m_pQtListener.createObject(); 148 m_pQtListener->init(new UIMainEventListener, this); 149 m_comEventListener = CEventListener(m_pQtListener); 150 151 /* Get CProgress event source: */ 152 CEventSource comEventSource = m_comGuest.GetEventSource(); 153 AssertWrapperOk(comEventSource); 154 155 /* Enumerate all the required event-types: */ 156 QVector<KVBoxEventType> eventTypes; 157 eventTypes << KVBoxEventType_OnGuestSessionRegistered; 158 159 160 /* Register event listener for CProgress event source: */ 161 comEventSource.RegisterListener(m_comEventListener, eventTypes, 162 gEDataManager->eventHandlingType() == EventHandlingType_Active ? TRUE : FALSE); 163 AssertWrapperOk(comEventSource); 164 165 /* If event listener registered as passive one: */ 166 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 167 { 168 /* Register event sources in their listeners as well: */ 169 m_pQtListener->getWrapped()->registerSource(comEventSource, m_comEventListener); 170 } 171 } 172 173 void UIInformationGuestSession::cleanupListener() 174 { 175 /* If event listener registered as passive one: */ 176 if (gEDataManager->eventHandlingType() == EventHandlingType_Passive) 177 { 178 /* Unregister everything: */ 179 m_pQtListener->getWrapped()->unregisterSources(); 180 } 181 182 /* Make sure VBoxSVC is available: */ 183 if (!vboxGlobal().isVBoxSVCAvailable()) 184 return; 185 186 /* Get CProgress event source: */ 187 CEventSource comEventSource = m_comGuest.GetEventSource(); 188 AssertWrapperOk(comEventSource); 189 190 /* Unregister event listener for CProgress event source: */ 191 comEventSource.UnregisterListener(m_comEventListener); 192 } 193 194 195 void UIInformationGuestSession::sltGuestSessionRegistered(CGuestSession guestSession) 196 { 197 if (!guestSession.isOk()) 198 return; 199 //printf("sltGuestSessionRegistered \n"); 200 // addGuestSession(guestSession); 201 // emit sigGuestSessionUpdated(); 202 } 203 204 void UIInformationGuestSession::sltGuestSessionUnregistered(CGuestSession guestSession) 205 { 206 if (!guestSession.isOk()) 207 return; 208 // removeGuestSession(guestSession); 209 // emit sigGuestSessionUpdated(); 210 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/guestctrl/UIInformationGuestSession.h
r71025 r71037 24 24 /* COM includes: */ 25 25 #include "COMEnums.h" 26 #include "CConsole.h" 26 #include "CGuest.h" 27 #include "CEventListener.h" 28 29 /* GUI includes: */ 30 #include "UIMainEventListener.h" 27 31 28 32 /* Forward declarations: */ … … 33 37 class UIGuestControlInterface; 34 38 class UIGuestSessionsEventHandler; 39 40 35 41 36 42 /** QWidget extension … … 44 50 public: 45 51 46 UIInformationGuestSession(QWidget *pParent, const C Console &console);52 UIInformationGuestSession(QWidget *pParent, const CGuest &comGuest); 47 53 48 54 private slots: … … 52 58 void sltConsoleOutputReceived(const QString &strOutput); 53 59 60 void sltGuestSessionRegistered(CGuestSession guestSession); 61 void sltGuestSessionUnregistered(CGuestSession guestSession); 62 54 63 private: 55 64 56 65 void prepareObjects(); 57 66 void prepareConnections(); 67 void prepareListener(); 58 68 void updateTreeWidget(); 59 60 C Console m_comConsole;69 void cleanupListener(); 70 CGuest m_comGuest; 61 71 QVBoxLayout *m_pMainLayout; 62 72 QSplitter *m_pSplitter; 63 UIGuestSessionsEventHandler *m_pGuestSessionsEventHandler;64 73 QITreeWidget *m_pTreeWidget; 65 74 UIGuestControlConsole *m_pConsole; 66 75 UIGuestControlInterface *m_pControlInterface; 76 77 /** Holds the Qt event listener instance. */ 78 ComObjPtr<UIMainEventListenerImpl> m_pQtListener; 79 /** Holds the COM event listener instance. */ 80 CEventListener m_comEventListener; 67 81 }; 68 82
Note:
See TracChangeset
for help on using the changeset viewer.