- Timestamp:
- Oct 24, 2018 8:15:35 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 7 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r75015 r75018 845 845 src/runtime/information/UIVMInformationDialog.h \ 846 846 src/runtime/guestctrl/UIGuestControlConsole.h \ 847 src/runtime/guestctrl/UIGuestControlDialog.h \ 847 848 src/runtime/guestctrl/UIGuestControlFileManager.h \ 848 849 src/runtime/guestctrl/UIGuestControlFileModel.h \ … … 993 994 src/runtime/information/UIVMInformationDialog.h \ 994 995 src/runtime/guestctrl/UIGuestControlConsole.h \ 996 src/runtime/guestctrl/UIGuestControlDialog.h \ 995 997 src/runtime/guestctrl/UIGuestControlFileManager.h \ 996 998 src/runtime/guestctrl/UIGuestControlFileModel.h \ … … 1542 1544 src/runtime/information/UIVMInformationDialog.cpp \ 1543 1545 src/runtime/guestctrl/UIGuestControlConsole.cpp \ 1546 src/runtime/guestctrl/UIGuestControlDialog.cpp \ 1544 1547 src/runtime/guestctrl/UIGuestControlFileManager.cpp \ 1545 1548 src/runtime/guestctrl/UIGuestControlFileModel.cpp \ … … 1714 1717 src/runtime/information/UIVMInformationDialog.cpp \ 1715 1718 src/runtime/guestctrl/UIGuestControlConsole.cpp \ 1719 src/runtime/guestctrl/UIGuestControlDialog.cpp \ 1716 1720 src/runtime/guestctrl/UIGuestControlFileManager.cpp \ 1717 1721 src/runtime/guestctrl/UIGuestControlFileModel.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r75016 r75018 546 546 switch (runtimeMenuMachineActionType) 547 547 { 548 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog: strResult = "SettingsDialog"; break; 549 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot: strResult = "TakeSnapshot"; break; 550 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog: strResult = "InformationDialog"; break; 551 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause: strResult = "Pause"; break; 552 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset: strResult = "Reset"; break; 553 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Detach: strResult = "Detach"; break; 554 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState: strResult = "SaveState"; break; 555 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown: strResult = "Shutdown"; break; 556 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff: strResult = "PowerOff"; break; 557 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing: strResult = "Nothing"; break; 558 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All: strResult = "All"; break; 548 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog: strResult = "SettingsDialog"; break; 549 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot: strResult = "TakeSnapshot"; break; 550 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog: strResult = "InformationDialog"; break; 551 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestControlDialog: strResult = "GuestControlDialog"; break; 552 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause: strResult = "Pause"; break; 553 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset: strResult = "Reset"; break; 554 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Detach: strResult = "Detach"; break; 555 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState: strResult = "SaveState"; break; 556 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown: strResult = "Shutdown"; break; 557 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff: strResult = "PowerOff"; break; 558 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing: strResult = "Nothing"; break; 559 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All: strResult = "All"; break; 559 560 default: 560 561 { … … 571 572 /* Here we have some fancy stuff allowing us 572 573 * to search through the keys using 'case-insensitive' rule: */ 573 QStringList keys; QList<UIExtraDataMetaDefs::RuntimeMenuMachineActionType> values; 574 keys << "SettingsDialog"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog; 575 keys << "TakeSnapshot"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot; 576 keys << "InformationDialog"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog; 577 keys << "Pause"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause; 578 keys << "Reset"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset; 579 keys << "Detach"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Detach; 580 keys << "SaveState"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState; 581 keys << "Shutdown"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown; 582 keys << "PowerOff"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff; 583 keys << "Nothing"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing; 584 keys << "All"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All; 574 QStringList keys; QList<UIExtraDataMetaDefs::RuntimeMenuMachineActionType> values; 575 keys << "SettingsDialog"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog; 576 keys << "TakeSnapshot"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot; 577 keys << "InformationDialog"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog; 578 keys << "GuestControlDialog"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestControlDialog; 579 keys << "Pause"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause; 580 keys << "Reset"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset; 581 keys << "Detach"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Detach; 582 keys << "SaveState"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState; 583 keys << "Shutdown"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown; 584 keys << "PowerOff"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff; 585 keys << "Nothing"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing; 586 keys << "All"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All; 585 587 /* Invalid type for unknown words: */ 586 588 if (!keys.contains(strRuntimeMenuMachineActionType, Qt::CaseInsensitive)) -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r75017 r75018 460 460 enum RuntimeMenuMachineActionType 461 461 { 462 RuntimeMenuMachineActionType_Invalid = 0, 463 RuntimeMenuMachineActionType_SettingsDialog = RT_BIT(0), 464 RuntimeMenuMachineActionType_TakeSnapshot = RT_BIT(1), 465 RuntimeMenuMachineActionType_InformationDialog = RT_BIT(2), 466 RuntimeMenuMachineActionType_Pause = RT_BIT(3), 467 RuntimeMenuMachineActionType_Reset = RT_BIT(4), 468 RuntimeMenuMachineActionType_Detach = RT_BIT(5), 469 RuntimeMenuMachineActionType_SaveState = RT_BIT(6), 470 RuntimeMenuMachineActionType_Shutdown = RT_BIT(7), 471 RuntimeMenuMachineActionType_PowerOff = RT_BIT(8), 472 RuntimeMenuMachineActionType_Nothing = RT_BIT(9), 473 RuntimeMenuMachineActionType_All = 0xFFFF 462 RuntimeMenuMachineActionType_Invalid = 0, 463 RuntimeMenuMachineActionType_SettingsDialog = RT_BIT(0), 464 RuntimeMenuMachineActionType_TakeSnapshot = RT_BIT(1), 465 RuntimeMenuMachineActionType_InformationDialog = RT_BIT(2), 466 RuntimeMenuMachineActionType_GuestControlDialog = RT_BIT(3), 467 RuntimeMenuMachineActionType_Pause = RT_BIT(4), 468 RuntimeMenuMachineActionType_Reset = RT_BIT(5), 469 RuntimeMenuMachineActionType_Detach = RT_BIT(6), 470 RuntimeMenuMachineActionType_SaveState = RT_BIT(7), 471 RuntimeMenuMachineActionType_Shutdown = RT_BIT(8), 472 RuntimeMenuMachineActionType_PowerOff = RT_BIT(9), 473 RuntimeMenuMachineActionType_Nothing = RT_BIT(10), 474 RuntimeMenuMachineActionType_All = 0xFFFF 474 475 }; 475 476 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp
r74942 r75018 230 230 }; 231 231 232 /** Simple action extension, used as 'Show Guest Control Dialog' action class. */ 233 class UIActionSimpleRuntimeShowGuestControlDialog : public UIActionSimple 234 { 235 Q_OBJECT; 236 237 public: 238 239 /** Constructs action passing @a pParent to the base-class. */ 240 UIActionSimpleRuntimeShowGuestControlDialog(UIActionPool *pParent) 241 : UIActionSimple(pParent, ":/session_info_16px.png", ":/session_info_disabled_16px.png", true) 242 {} 243 244 protected: 245 246 /** Returns action extra-data ID. */ 247 virtual int extraDataID() const /* override */ 248 { 249 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestControlDialog; 250 } 251 /** Returns action extra-data key. */ 252 virtual QString extraDataKey() const /* override */ 253 { 254 return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestControlDialog); 255 } 256 /** Returns whether action is allowed. */ 257 virtual bool isAllowed() const /* override */ 258 { 259 return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestControlDialog); 260 } 261 262 /** Returns shortcut extra-data ID. */ 263 virtual QString shortcutExtraDataID() const /* override */ 264 { 265 return QString("GuestControlDialog"); 266 } 267 268 /** Returns default shortcut. */ 269 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */ 270 { 271 return QKeySequence(); 272 } 273 274 /** Handles translation event. */ 275 virtual void retranslateUi() /* override */ 276 { 277 setName(QApplication::translate("UIActionPool", "Guest Control...")); 278 setStatusTip(QApplication::translate("UIActionPool", "Display the virtual machine guest control window")); 279 } 280 }; 281 232 282 /** Toggle action extension, used as 'Pause' action class. */ 233 283 class UIActionToggleRuntimePause : public UIActionToggle … … 3184 3234 m_pool[UIActionIndexRT_M_Machine_S_TakeSnapshot] = new UIActionSimpleRuntimePerformTakeSnapshot(this); 3185 3235 m_pool[UIActionIndexRT_M_Machine_S_ShowInformation] = new UIActionSimpleRuntimeShowInformationDialog(this); 3236 m_pool[UIActionIndexRT_M_Machine_S_ShowGuestControl] = new UIActionSimpleRuntimeShowGuestControlDialog(this); 3186 3237 m_pool[UIActionIndexRT_M_Machine_T_Pause] = new UIActionToggleRuntimePause(this); 3187 3238 m_pool[UIActionIndexRT_M_Machine_S_Reset] = new UIActionSimpleRuntimePerformReset(this); … … 3485 3536 /* 'Information Dialog' action: */ 3486 3537 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowInformation)) || fSeparator; 3538 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowGuestControl)) || fSeparator; 3487 3539 3488 3540 /* Separator: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.h
r74942 r75018 46 46 UIActionIndexRT_M_Machine_S_TakeSnapshot, 47 47 UIActionIndexRT_M_Machine_S_ShowInformation, 48 UIActionIndexRT_M_Machine_S_ShowGuestControl, 48 49 UIActionIndexRT_M_Machine_T_Pause, 49 50 UIActionIndexRT_M_Machine_S_Reset, -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r74942 r75018 66 66 # include "UIAddDiskEncryptionPasswordDialog.h" 67 67 # include "UIVMInformationDialog.h" 68 # include "UIGuestControlDialog.h" 68 69 # ifdef VBOX_WS_MAC 69 70 # include "DockIconPreview.h" … … 853 854 , m_fIsHidLedsSyncEnabled(false) 854 855 , m_pLogViewerDialog(0) 856 , m_pGuestControlDialog(0) 855 857 { 856 858 } … … 1108 1110 connect(actionPool()->action(UIActionIndexRT_M_Machine_S_ShowInformation), SIGNAL(triggered()), 1109 1111 this, SLOT(sltShowInformationDialog())); 1112 connect(actionPool()->action(UIActionIndexRT_M_Machine_S_ShowGuestControl), SIGNAL(triggered()), 1113 this, SLOT(sltShowGuestControlDialog())); 1110 1114 connect(actionPool()->action(UIActionIndexRT_M_Machine_T_Pause), SIGNAL(toggled(bool)), 1111 1115 this, SLOT(sltPause(bool))); … … 1777 1781 } 1778 1782 1783 void UIMachineLogic::sltShowGuestControlDialog() 1784 { 1785 if (machine().isNull() || !activeMachineWindow()) 1786 return; 1787 1788 /* Create a logviewer only if we don't have one already */ 1789 if (m_pGuestControlDialog) 1790 return; 1791 1792 QIManagerDialog *pGuestControlDialog; 1793 UIGuestControlDialogFactory dialogFactory(actionPool(), machine()); 1794 dialogFactory.prepare(pGuestControlDialog, activeMachineWindow()); 1795 if (pGuestControlDialog) 1796 { 1797 m_pGuestControlDialog = pGuestControlDialog; 1798 1799 /* Show instance: */ 1800 pGuestControlDialog->show(); 1801 pGuestControlDialog->setWindowState(pGuestControlDialog->windowState() & ~Qt::WindowMinimized); 1802 pGuestControlDialog->activateWindow(); 1803 connect(pGuestControlDialog, &QIManagerDialog::sigClose, 1804 this, &UIMachineLogic::sltCloseGuestControlWindow); 1805 } 1806 1807 } 1808 1779 1809 void UIMachineLogic::sltReset() 1780 1810 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r73976 r75018 274 274 void sltTakeSnapshot(); 275 275 void sltShowInformationDialog(); 276 void sltShowGuestControlDialog(); 276 277 void sltReset(); 277 278 void sltPause(bool fOn); … … 427 428 /** Holds the log viewer dialog instance. */ 428 429 QIManagerDialog *m_pLogViewerDialog; 430 QIManagerDialog *m_pGuestControlDialog; 429 431 430 432 /* Friend classes: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlDialog.cpp
r75010 r75018 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI VMLogViewerDialog class implementation.3 * VBox Qt GUI - UIGuestControlDialog class implementation. 4 4 */ 5 5 … … 36 36 # include "UIExtraDataManager.h" 37 37 # include "UIIconPool.h" 38 # include "UI VMLogViewerDialog.h"38 # include "UIGuestControlDialog.h" 39 39 # include "UIVMLogViewerWidget.h" 40 40 # include "VBoxGlobal.h" … … 47 47 48 48 /********************************************************************************************************************************* 49 * Class UI VMLogViewerDialogFactory implementation.*49 * Class UIGuestControlDialogFactory implementation. * 50 50 *********************************************************************************************************************************/ 51 51 52 UI VMLogViewerDialogFactory::UIVMLogViewerDialogFactory(UIActionPool *pActionPool /* = 0 */,52 UIGuestControlDialogFactory::UIGuestControlDialogFactory(UIActionPool *pActionPool /* = 0 */, 53 53 const CMachine &comMachine /* = CMachine() */) 54 54 : m_pActionPool(pActionPool) … … 57 57 } 58 58 59 void UI VMLogViewerDialogFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget)59 void UIGuestControlDialogFactory::create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) 60 60 { 61 pDialog = new UI VMLogViewerDialog(pCenterWidget, m_pActionPool, m_comMachine);61 pDialog = new UIGuestControlDialog(pCenterWidget, m_pActionPool, m_comMachine); 62 62 } 63 63 64 64 65 65 /********************************************************************************************************************************* 66 * Class UI VMLogViewerDialog implementation.*66 * Class UIGuestControlDialog implementation. * 67 67 *********************************************************************************************************************************/ 68 68 69 UI VMLogViewerDialog::UIVMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine)69 UIGuestControlDialog::UIGuestControlDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine) 70 70 : QIWithRetranslateUI<QIManagerDialog>(pCenterWidget) 71 71 , m_pActionPool(pActionPool) … … 74 74 } 75 75 76 void UI VMLogViewerDialog::retranslateUi()76 void UIGuestControlDialog::retranslateUi() 77 77 { 78 78 /* Translate window title: */ … … 86 86 } 87 87 88 void UI VMLogViewerDialog::configure()88 void UIGuestControlDialog::configure() 89 89 { 90 90 /* Apply window icons: */ … … 92 92 } 93 93 94 void UI VMLogViewerDialog::configureCentralWidget()94 void UIGuestControlDialog::configureCentralWidget() 95 95 { 96 96 /* Create widget: */ … … 105 105 #endif 106 106 connect(pWidget, &UIVMLogViewerWidget::sigSetCloseButtonShortCut, 107 this, &UI VMLogViewerDialog::sltSetCloseButtonShortCut);107 this, &UIGuestControlDialog::sltSetCloseButtonShortCut); 108 108 109 109 /* Add into layout: */ … … 112 112 } 113 113 114 void UI VMLogViewerDialog::finalize()114 void UIGuestControlDialog::finalize() 115 115 { 116 116 /* Apply language settings: */ … … 121 121 } 122 122 123 void UI VMLogViewerDialog::loadSettings()123 void UIGuestControlDialog::loadSettings() 124 124 { 125 125 /* Acquire widget: */ … … 152 152 } 153 153 154 void UI VMLogViewerDialog::saveSettings() const154 void UIGuestControlDialog::saveSettings() const 155 155 { 156 156 /* Save window geometry to extradata: */ … … 167 167 } 168 168 169 bool UI VMLogViewerDialog::shouldBeMaximized() const169 bool UIGuestControlDialog::shouldBeMaximized() const 170 170 { 171 171 return gEDataManager->logWindowShouldBeMaximized(); 172 172 } 173 173 174 void UI VMLogViewerDialog::sltSetCloseButtonShortCut(QKeySequence shortcut)174 void UIGuestControlDialog::sltSetCloseButtonShortCut(QKeySequence shortcut) 175 175 { 176 176 if (button(ButtonType_Close)) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlDialog.h
r75010 r75018 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI VMLogViewerDialog class declaration.3 * VBox Qt GUI - UIGuestControlDialog class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef ___UI VMLogViewerDialog_h___19 #define ___UI VMLogViewerDialog_h___18 #ifndef ___UIGuestControlDialog_h___ 19 #define ___UIGuestControlDialog_h___ 20 20 21 21 /* Qt includes: */ … … 36 36 class QVBoxLayout; 37 37 class UIActionPool; 38 class UI VMLogViewerDialog;38 class UIGuestControlDialog; 39 39 class CMachine; 40 40 41 41 42 42 /** QIManagerDialogFactory extension used as a factory for Log Viewer dialog. */ 43 class SHARED_LIBRARY_STUFF UI VMLogViewerDialogFactory : public QIManagerDialogFactory43 class SHARED_LIBRARY_STUFF UIGuestControlDialogFactory : public QIManagerDialogFactory 44 44 { 45 45 public: … … 48 48 * @param pActionPool Brings the action-pool reference. 49 49 * @param comMachine Brings the machine for which VM Log-Viewer is requested. */ 50 UI VMLogViewerDialogFactory(UIActionPool *pActionPool = 0, const CMachine &comMachine = CMachine());50 UIGuestControlDialogFactory(UIActionPool *pActionPool = 0, const CMachine &comMachine = CMachine()); 51 51 52 52 protected: … … 64 64 65 65 /** QIManagerDialog extension providing GUI with the dialog displaying machine logs. */ 66 class SHARED_LIBRARY_STUFF UI VMLogViewerDialog : public QIWithRetranslateUI<QIManagerDialog>66 class SHARED_LIBRARY_STUFF UIGuestControlDialog : public QIWithRetranslateUI<QIManagerDialog> 67 67 { 68 68 Q_OBJECT; … … 74 74 * @param pActionPool Brings the action-pool reference. 75 75 * @param comMachine Brings the machine reference. */ 76 UI VMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine);76 UIGuestControlDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const CMachine &comMachine); 77 77 78 78 protected: … … 119 119 120 120 121 #endif /* !___UI VMLogViewerDialog_h___ */121 #endif /* !___UIGuestControlDialog_h___ */
Note:
See TracChangeset
for help on using the changeset viewer.