Changeset 77584 in vbox
- Timestamp:
- Mar 6, 2019 3:28:19 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r77457 r77584 274 274 if "$(KBUILD_TYPE)" != "release" || defined(VBOX_GUI_WITH_EXTRADATA_MANAGER_UI) 275 275 VBoxGlobal_DEFS += VBOX_GUI_WITH_EXTRADATA_MANAGER_UI 276 endif277 if "$(KBUILD_TYPE)" != "release" || defined(VBOX_GUI_WITH_GUEST_CONTROL_UI)278 VBoxGlobal_DEFS += VBOX_GUI_WITH_GUEST_CONTROL_UI279 276 endif 280 277 ifndef VBOX_WITHOUT_LESS_VIRTUALBOX_INCLUDING -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp
r76606 r77584 274 274 }; 275 275 276 /** Simple action extension, used as 'Show Guest Process Control Dialog' action class. */277 class UIActionSimpleRuntimeShowGuestProcessControlDialog : public UIActionSimple278 {279 Q_OBJECT;280 281 public:282 283 /** Constructs action passing @a pParent to the base-class. */284 UIActionSimpleRuntimeShowGuestProcessControlDialog(UIActionPool *pParent)285 : UIActionSimple(pParent, ":/session_info_16px.png", ":/session_info_disabled_16px.png", true)286 {}287 288 protected:289 290 /** Returns action extra-data ID. */291 virtual int extraDataID() const /* override */292 {293 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestProcessControlDialog;294 }295 /** Returns action extra-data key. */296 virtual QString extraDataKey() const /* override */297 {298 return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestProcessControlDialog);299 }300 /** Returns whether action is allowed. */301 virtual bool isAllowed() const /* override */302 {303 return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestProcessControlDialog);304 }305 306 /** Returns shortcut extra-data ID. */307 virtual QString shortcutExtraDataID() const /* override */308 {309 return QString("GuestProcessControlDialog");310 }311 312 /** Returns default shortcut. */313 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */314 {315 return QKeySequence();316 }317 318 /** Handles translation event. */319 virtual void retranslateUi() /* override */320 {321 setName(QApplication::translate("UIActionPool", "Guest Process Control..."));322 setStatusTip(QApplication::translate("UIActionPool", "Display the virtual machine guest process control window"));323 }324 };325 326 327 276 /** Toggle action extension, used as 'Pause' action class. */ 328 277 class UIActionToggleRuntimePause : public UIActionToggle … … 3318 3267 m_pool[UIActionIndexRT_M_Machine_S_ShowInformation] = new UIActionSimpleRuntimeShowInformationDialog(this); 3319 3268 m_pool[UIActionIndexRT_M_Machine_S_ShowFileManager] = new UIActionSimpleRuntimeShowFileManagerDialog(this); 3320 m_pool[UIActionIndexRT_M_Machine_S_ShowGuestProcessControl] = new UIActionSimpleRuntimeShowGuestProcessControlDialog(this);3321 3269 m_pool[UIActionIndexRT_M_Machine_T_Pause] = new UIActionToggleRuntimePause(this); 3322 3270 m_pool[UIActionIndexRT_M_Machine_S_Reset] = new UIActionSimpleRuntimePerformReset(this); … … 3627 3575 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowInformation)) || fSeparator; 3628 3576 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowFileManager)) || fSeparator; 3629 #ifdef VBOX_GUI_WITH_GUEST_CONTROL_UI 3630 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowGuestProcessControl)) || fSeparator; 3631 #endif 3577 3632 3578 /* Separator: */ 3633 3579 if (fSeparator) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.h
r76581 r77584 47 47 UIActionIndexRT_M_Machine_S_ShowInformation, 48 48 UIActionIndexRT_M_Machine_S_ShowFileManager, 49 UIActionIndexRT_M_Machine_S_ShowGuestProcessControl,50 49 UIActionIndexRT_M_Machine_T_Pause, 51 50 UIActionIndexRT_M_Machine_S_Reset, -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestControlTreeItem.cpp
r76606 r77584 219 219 220 220 qRegisterMetaType<CGuestProcess>(); 221 qRegisterMetaType<CGuestSessionStateChangedEvent>(); 221 222 connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigGuestSessionStatedChanged, 222 223 this, &UIGuestSessionTreeItem::sltGuestSessionUpdated); … … 308 309 if (!m_comGuestSession.isOk()) 309 310 return; 310 setText(0, QString(" Session Id:%1").arg(m_comGuestSession.GetId()));311 setText(1, QString(" Session Name:%1").arg(m_comGuestSession.GetName()));312 setText(2, QString(" Session Status:%1").arg(sessionStatusString(m_comGuestSession.GetStatus())));311 setText(0, QString("%1").arg(m_comGuestSession.GetId())); 312 setText(1, QString("%1").arg(m_comGuestSession.GetName())); 313 setText(2, QString("%1").arg(sessionStatusString(m_comGuestSession.GetStatus()))); 313 314 } 314 315 … … 393 394 return m_comGuestProcess; 394 395 } 395 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlDialog.cpp
r76606 r77584 83 83 { 84 84 /* Create widget: */ 85 UIGuestProcessControlWidget *pWidget = new UIGuestProcessControlWidget(EmbedTo_Dialog, m_ pActionPool, m_comGuest, this);85 UIGuestProcessControlWidget *pWidget = new UIGuestProcessControlWidget(EmbedTo_Dialog, m_comGuest, this); 86 86 87 87 if (pWidget) … … 93 93 //setWidgetToolbar(pWidget->toolbar()); 94 94 #endif 95 // connect(pWidget, &UIGuestControlWidget::sigSetCloseButtonShortCut,96 // this, &UIGuestControlWidget::sltSetCloseButtonShortCut);97 98 95 /* Add into layout: */ 99 96 centralWidget()->layout()->addWidget(pWidget); -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlWidget.cpp
r77528 r77584 24 24 /* GUI includes: */ 25 25 #include "QITreeWidget.h" 26 #include "UIActionPool.h"27 26 #include "UIExtraDataManager.h" 28 27 #include "UIGuestControlConsole.h" … … 31 30 #include "UIGuestProcessControlWidget.h" 32 31 #include "UIToolBar.h" 32 #include "UIIconPool.h" 33 33 #include "UIVMInformationDialog.h" 34 34 #include "VBoxGlobal.h" … … 103 103 QAction *pExpandAllAction = menu->addAction(tr("Expand All")); 104 104 if (pExpandAllAction) 105 { 106 pExpandAllAction->setIcon(UIIconPool::iconSet(":/expand_all_16px.png")); 105 107 connect(pExpandAllAction, &QAction::triggered, 106 108 this, &UIGuestControlTreeWidget::sltExpandAll); 109 } 110 107 111 QAction *pCollapseAllAction = menu->addAction(tr("Collapse All")); 108 112 if (pCollapseAllAction) 113 { 114 pCollapseAllAction->setIcon(UIIconPool::iconSet(":/collapse_all_16px.png")); 109 115 connect(pCollapseAllAction, &QAction::triggered, 110 116 this, &UIGuestControlTreeWidget::sltCollapseAll); 111 117 } 112 118 menu->exec(pEvent->globalPos()); 113 119 … … 160 166 }; 161 167 162 UIGuestProcessControlWidget::UIGuestProcessControlWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,163 const CGuest &comGuest,QWidget *pParent, bool fShowToolbar /* = false */)168 UIGuestProcessControlWidget::UIGuestProcessControlWidget(EmbedTo enmEmbedding, const CGuest &comGuest, 169 QWidget *pParent, bool fShowToolbar /* = false */) 164 170 :QIWithRetranslateUI<QWidget>(pParent) 165 171 , m_comGuest(comGuest) … … 170 176 , m_pControlInterface(0) 171 177 , m_enmEmbedding(enmEmbedding) 172 , m_pActionPool(pActionPool)173 178 , m_pToolBar(0) 174 179 , m_pQtListener(0) 175 180 , m_fShowToolbar(fShowToolbar) 181 , m_fDeleteAfterSessionUnregister(false) 176 182 { 177 183 prepareListener(); … … 181 187 initGuestSessionTree(); 182 188 loadSettings(); 189 retranslateUi(); 183 190 } 184 191 … … 190 197 void UIGuestProcessControlWidget::retranslateUi() 191 198 { 199 if (m_pTreeWidget) 200 { 201 QStringList labels; 202 labels << tr("Session ID") << tr("Session Name") << tr("Session Status"); 203 m_pTreeWidget->setHeaderLabels(labels); 204 } 192 205 } 193 206 … … 221 234 m_pSplitter->addWidget(m_pTreeWidget); 222 235 m_pTreeWidget->setColumnCount(3); 223 QStringList labels; 224 labels << "" << "" << ""; 225 226 m_pTreeWidget->setHeaderLabels(labels); 227 } 236 } 237 238 /* Disable the CLI for now (and maybe forever): */ 239 #ifdef WITH_GUEST_CONTROL_CLI 228 240 m_pConsole = new UIGuestControlConsole; 241 #endif 242 229 243 if (m_pConsole) 230 244 { … … 254 268 connect(m_pControlInterface, &UIGuestControlInterface::sigOutputString, 255 269 this, &UIGuestProcessControlWidget::sltConsoleOutputReceived); 256 connect(m_pConsole, &UIGuestControlConsole::commandEntered, 257 this, &UIGuestProcessControlWidget::sltConsoleCommandEntered); 270 if (m_pConsole) 271 connect(m_pConsole, &UIGuestControlConsole::commandEntered, 272 this, &UIGuestProcessControlWidget::sltConsoleCommandEntered); 258 273 259 274 if (m_pTreeWidget) … … 451 466 UIGuestSessionTreeItem *selectedItem = NULL; 452 467 453 454 468 for (int i = 0; i < m_pTreeWidget->topLevelItemCount(); ++i) 455 469 { … … 463 477 } 464 478 } 465 delete selectedItem; 479 if (m_fDeleteAfterSessionUnregister) 480 delete selectedItem; 466 481 } 467 482 -
trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlWidget.h
r76581 r77584 39 39 class QVBoxLayout; 40 40 class QSplitter; 41 class UIActionPool;42 41 class UIGuestControlConsole; 43 42 class UIGuestControlInterface; … … 54 53 public: 55 54 56 UIGuestProcessControlWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool, 57 const CGuest &comGuest, QWidget *pParent, bool fShowToolbar = false); 55 UIGuestProcessControlWidget(EmbedTo enmEmbedding, const CGuest &comGuest, QWidget *pParent, bool fShowToolbar = false); 58 56 ~UIGuestProcessControlWidget(); 59 57 … … 95 93 UIGuestControlInterface *m_pControlInterface; 96 94 const EmbedTo m_enmEmbedding; 97 UIActionPool *m_pActionPool;98 95 UIToolBar *m_pToolBar; 99 96 … … 103 100 CEventListener m_comEventListener; 104 101 const bool m_fShowToolbar; 102 /** When true we delete the corresponding tree item as soon as the guest session is unregistered. */ 103 bool m_fDeleteAfterSessionUnregister; 105 104 }; 106 105 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r76606 r77584 1100 1100 connect(actionPool()->action(UIActionIndexRT_M_Machine_S_ShowFileManager), SIGNAL(triggered()), 1101 1101 this, SLOT(sltShowFileManagerDialog())); 1102 connect(actionPool()->action(UIActionIndexRT_M_Machine_S_ShowGuestProcessControl), SIGNAL(triggered()),1103 this, SLOT(sltShowGuestProcessControlDialog()));1104 1102 connect(actionPool()->action(UIActionIndexRT_M_Machine_T_Pause), SIGNAL(toggled(bool)), 1105 1103 this, SLOT(sltPause(bool))); … … 1808 1806 } 1809 1807 1810 void UIMachineLogic::sltShowGuestProcessControlDialog()1811 {1812 if (machine().isNull() || !activeMachineWindow())1813 return;1814 1815 /* Create a logviewer only if we don't have one already */1816 if (m_pProcessControlDialog)1817 return;1818 1819 QIManagerDialog *pProcessControlDialog;1820 UIGuestProcessControlDialogFactory dialogFactory(actionPool(), console().GetGuest(), machine().GetName());1821 dialogFactory.prepare(pProcessControlDialog, activeMachineWindow());1822 if (pProcessControlDialog)1823 {1824 m_pProcessControlDialog = pProcessControlDialog;1825 1826 /* Show instance: */1827 pProcessControlDialog->show();1828 pProcessControlDialog->setWindowState(pProcessControlDialog->windowState() & ~Qt::WindowMinimized);1829 pProcessControlDialog->activateWindow();1830 connect(pProcessControlDialog, &QIManagerDialog::sigClose,1831 this, &UIMachineLogic::sltCloseGuestProcessControlDialog);1832 }1833 }1834 1835 void UIMachineLogic::sltCloseGuestProcessControlDialog()1836 {1837 QIManagerDialog* pDialog = qobject_cast<QIManagerDialog*>(sender());1838 if (m_pProcessControlDialog != pDialog || !pDialog)1839 return;1840 1841 /* Set the m_pLogViewerDialog to NULL before closing the dialog. or we will have redundant deletes*/1842 m_pProcessControlDialog = 0;1843 pDialog->close();1844 UIGuestProcessControlDialogFactory().cleanup(pDialog);1845 }1846 1847 1808 void UIMachineLogic::sltReset() 1848 1809 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r76581 r77584 279 279 void sltShowFileManagerDialog(); 280 280 void sltCloseFileManagerDialog(); 281 void sltShowGuestProcessControlDialog();282 void sltCloseGuestProcessControlDialog();283 281 void sltReset(); 284 282 void sltPause(bool fOn); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
r77535 r77584 36 36 #include "UIInformationConfiguration.h" 37 37 #include "UIInformationRuntime.h" 38 #include "UIGuestProcessControlWidget.h" 38 39 #include "UIMachine.h" 39 40 … … 110 111 m_pTabWidget->setTabText(0, tr("Configuration &Details")); 111 112 m_pTabWidget->setTabText(1, tr("&Runtime Information")); 113 m_pTabWidget->setTabText(2, tr("Guest Control &Session Information")); 112 114 } 113 115 … … 237 239 m_pTabWidget->addTab(m_tabs.value(1), QString()); 238 240 } 241 242 UIGuestProcessControlWidget *pGuestProcessControlWidget = 243 new UIGuestProcessControlWidget(EmbedTo_Dialog, m_pMachineWindow->console().GetGuest(), this, false /* fShowToolbar */); 244 245 if (pGuestProcessControlWidget) 246 { 247 m_tabs.insert(2, pGuestProcessControlWidget); 248 m_pTabWidget->addTab(m_tabs.value(2), QString()); 249 } 250 239 251 /* Set Runtime Information tab as default: */ 240 252 m_pTabWidget->setCurrentIndex(1);
Note:
See TracChangeset
for help on using the changeset viewer.