- Timestamp:
- May 20, 2016 1:49:21 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp
r60599 r61101 913 913 }; 914 914 915 class UIActionSimpleDetach : public UIActionSimple 916 { 917 Q_OBJECT; 918 919 public: 920 921 UIActionSimpleDetach(UIActionPool *pParent) 922 : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png") {} 923 924 protected: 925 926 QString shortcutExtraDataID() const 927 { 928 return QString("DetachUIVM"); 929 } 930 931 void retranslateUi() 932 { 933 setName(QApplication::translate("UIActionPool", "&Detach GUI")); 934 setStatusTip(QApplication::translate("UIActionPool", "Detach the GUI from headless VM")); 935 } 936 }; 937 915 938 class UIActionSimpleSave : public UIActionSimple 916 939 { … … 1028 1051 m_pool[UIActionIndexST_M_Group_S_Reset] = new UIActionSimpleCommonReset(this); 1029 1052 m_pool[UIActionIndexST_M_Group_M_Close] = new UIActionMenuClose(this); 1053 m_pool[UIActionIndexST_M_Group_M_Close_S_Detach] = new UIActionSimpleDetach(this); 1030 1054 m_pool[UIActionIndexST_M_Group_M_Close_S_SaveState] = new UIActionSimpleSave(this); 1031 1055 m_pool[UIActionIndexST_M_Group_M_Close_S_Shutdown] = new UIActionSimpleACPIShutdown(this); … … 1053 1077 m_pool[UIActionIndexST_M_Machine_S_Reset] = new UIActionSimpleCommonReset(this); 1054 1078 m_pool[UIActionIndexST_M_Machine_M_Close] = new UIActionMenuClose(this); 1079 m_pool[UIActionIndexST_M_Machine_M_Close_S_Detach] = new UIActionSimpleDetach(this); 1055 1080 m_pool[UIActionIndexST_M_Machine_M_Close_S_SaveState] = new UIActionSimpleSave(this); 1056 1081 m_pool[UIActionIndexST_M_Machine_M_Close_S_Shutdown] = new UIActionSimpleACPIShutdown(this); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h
r60599 r61101 54 54 UIActionIndexST_M_Group_S_Reset, 55 55 UIActionIndexST_M_Group_M_Close, 56 UIActionIndexST_M_Group_M_Close_S_Detach, 56 57 UIActionIndexST_M_Group_M_Close_S_SaveState, 57 58 UIActionIndexST_M_Group_M_Close_S_Shutdown, … … 79 80 UIActionIndexST_M_Machine_S_Reset, 80 81 UIActionIndexST_M_Machine_M_Close, 82 UIActionIndexST_M_Machine_M_Close_S_Detach, 81 83 UIActionIndexST_M_Machine_M_Close_S_SaveState, 82 84 UIActionIndexST_M_Machine_M_Close_S_Shutdown, -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r60599 r61101 782 782 } 783 783 784 void UISelectorWindow::sltPerformDetachMachineUI() 785 { 786 /* Get selected items: */ 787 QList<UIVMItem*> items = currentItems(); 788 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 789 790 /* For each selected item: */ 791 foreach (UIVMItem *pItem, items) 792 { 793 /* Check if current item could be detached: */ 794 if (!isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Detach, QList<UIVMItem*>() << pItem)) 795 continue; 796 797 // TODO: Detach separate UI process.. 798 AssertFailed(); 799 } 800 } 801 784 802 void UISelectorWindow::sltPerformSaveMachineState() 785 803 { … … 1431 1449 1432 1450 /* Populate 'Group' / 'Close' menu: */ 1451 // pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Detach)); 1433 1452 pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_SaveState)); 1434 1453 pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Shutdown)); … … 1436 1455 1437 1456 /* Remember action list: */ 1438 m_groupActions << actionPool()->action(UIActionIndexST_M_Group_M_Close_S_SaveState) 1457 m_groupActions // << actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Detach) 1458 << actionPool()->action(UIActionIndexST_M_Group_M_Close_S_SaveState) 1439 1459 << actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Shutdown) 1440 1460 << actionPool()->action(UIActionIndexST_M_Group_M_Close_S_PowerOff); … … 1448 1468 1449 1469 /* Populate 'Machine' / 'Close' menu: */ 1470 // pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Detach)); 1450 1471 pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_SaveState)); 1451 1472 pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Shutdown)); … … 1453 1474 1454 1475 /* Remember action list: */ 1455 m_machineActions << actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_SaveState) 1476 m_machineActions // << actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Detach) 1477 << actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_SaveState) 1456 1478 << actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Shutdown) 1457 1479 << actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_PowerOff); … … 1590 1612 /* 'Group/Close' menu connections: */ 1591 1613 connect(actionPool()->action(UIActionIndexST_M_Group_M_Close)->menu(), SIGNAL(aboutToShow()), this, SLOT(sltGroupCloseMenuAboutToShow())); 1614 connect(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Detach), SIGNAL(triggered()), this, SLOT(sltPerformDetachMachineUI())); 1592 1615 connect(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_SaveState), SIGNAL(triggered()), this, SLOT(sltPerformSaveMachineState())); 1593 1616 connect(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Shutdown), SIGNAL(triggered()), this, SLOT(sltPerformShutdownMachine())); … … 1596 1619 /* 'Machine/Close' menu connections: */ 1597 1620 connect(actionPool()->action(UIActionIndexST_M_Machine_M_Close)->menu(), SIGNAL(aboutToShow()), this, SLOT(sltMachineCloseMenuAboutToShow())); 1621 connect(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Detach), SIGNAL(triggered()), this, SLOT(sltPerformDetachMachineUI())); 1598 1622 connect(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_SaveState), SIGNAL(triggered()), this, SLOT(sltPerformSaveMachineState())); 1599 1623 connect(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Shutdown), SIGNAL(triggered()), this, SLOT(sltPerformShutdownMachine())); … … 1783 1807 /* Enable/disable group-close actions: */ 1784 1808 actionPool()->action(UIActionIndexST_M_Group_M_Close)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_M_Close, items)); 1809 actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Detach)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_M_Close_S_Detach, items)); 1785 1810 actionPool()->action(UIActionIndexST_M_Group_M_Close_S_SaveState)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_M_Close_S_SaveState, items)); 1786 1811 actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Shutdown)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_M_Close_S_Shutdown, items)); … … 1789 1814 /* Enable/disable machine-close actions: */ 1790 1815 actionPool()->action(UIActionIndexST_M_Machine_M_Close)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Close, items)); 1816 actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Detach)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Detach, items)); 1791 1817 actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_SaveState)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_SaveState, items)); 1792 1818 actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Shutdown)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Shutdown, items)); … … 1939 1965 return isAtLeastOneItemStarted(items); 1940 1966 } 1967 case UIActionIndexST_M_Group_M_Close_S_Detach: 1968 case UIActionIndexST_M_Machine_M_Close_S_Detach: 1969 { 1970 return isActionEnabled(UIActionIndexST_M_Machine_M_Close, items); 1971 } 1941 1972 case UIActionIndexST_M_Group_M_Close_S_SaveState: 1942 1973 case UIActionIndexST_M_Machine_M_Close_S_SaveState: -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h
r60599 r61101 143 143 /** Handles call to reset machine. */ 144 144 void sltPerformResetMachine(); 145 /** Handles call to detach machine UI. */ 146 void sltPerformDetachMachineUI(); 145 147 /** Handles call to save machine state. */ 146 148 void sltPerformSaveMachineState();
Note:
See TracChangeset
for help on using the changeset viewer.