VirtualBox

Changeset 61101 in vbox for trunk/src


Ignore:
Timestamp:
May 20, 2016 1:49:21 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: ​​​​​​​​​​bugref:7791: Selector UI: Commit hidden (for now) Detach GUI action of the Machine/Group Close sub-menu. Will be enabled later when the feature itself become possible.

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  
    913913};
    914914
     915class UIActionSimpleDetach : public UIActionSimple
     916{
     917    Q_OBJECT;
     918
     919public:
     920
     921    UIActionSimpleDetach(UIActionPool *pParent)
     922        : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png") {}
     923
     924protected:
     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
    915938class UIActionSimpleSave : public UIActionSimple
    916939{
     
    10281051    m_pool[UIActionIndexST_M_Group_S_Reset] = new UIActionSimpleCommonReset(this);
    10291052    m_pool[UIActionIndexST_M_Group_M_Close] = new UIActionMenuClose(this);
     1053    m_pool[UIActionIndexST_M_Group_M_Close_S_Detach] = new UIActionSimpleDetach(this);
    10301054    m_pool[UIActionIndexST_M_Group_M_Close_S_SaveState] = new UIActionSimpleSave(this);
    10311055    m_pool[UIActionIndexST_M_Group_M_Close_S_Shutdown] = new UIActionSimpleACPIShutdown(this);
     
    10531077    m_pool[UIActionIndexST_M_Machine_S_Reset] = new UIActionSimpleCommonReset(this);
    10541078    m_pool[UIActionIndexST_M_Machine_M_Close] = new UIActionMenuClose(this);
     1079    m_pool[UIActionIndexST_M_Machine_M_Close_S_Detach] = new UIActionSimpleDetach(this);
    10551080    m_pool[UIActionIndexST_M_Machine_M_Close_S_SaveState] = new UIActionSimpleSave(this);
    10561081    m_pool[UIActionIndexST_M_Machine_M_Close_S_Shutdown] = new UIActionSimpleACPIShutdown(this);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h

    r60599 r61101  
    5454    UIActionIndexST_M_Group_S_Reset,
    5555    UIActionIndexST_M_Group_M_Close,
     56    UIActionIndexST_M_Group_M_Close_S_Detach,
    5657    UIActionIndexST_M_Group_M_Close_S_SaveState,
    5758    UIActionIndexST_M_Group_M_Close_S_Shutdown,
     
    7980    UIActionIndexST_M_Machine_S_Reset,
    8081    UIActionIndexST_M_Machine_M_Close,
     82    UIActionIndexST_M_Machine_M_Close_S_Detach,
    8183    UIActionIndexST_M_Machine_M_Close_S_SaveState,
    8284    UIActionIndexST_M_Machine_M_Close_S_Shutdown,
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r60599 r61101  
    782782}
    783783
     784void 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
    784802void UISelectorWindow::sltPerformSaveMachineState()
    785803{
     
    14311449
    14321450    /* Populate 'Group' / 'Close' menu: */
     1451    // pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Detach));
    14331452    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_SaveState));
    14341453    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Shutdown));
     
    14361455
    14371456    /* 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)
    14391459                   << actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Shutdown)
    14401460                   << actionPool()->action(UIActionIndexST_M_Group_M_Close_S_PowerOff);
     
    14481468
    14491469    /* Populate 'Machine' / 'Close' menu: */
     1470    // pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Detach));
    14501471    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_SaveState));
    14511472    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Shutdown));
     
    14531474
    14541475    /* 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)
    14561478                     << actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Shutdown)
    14571479                     << actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_PowerOff);
     
    15901612    /* 'Group/Close' menu connections: */
    15911613    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()));
    15921615    connect(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_SaveState), SIGNAL(triggered()), this, SLOT(sltPerformSaveMachineState()));
    15931616    connect(actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Shutdown), SIGNAL(triggered()), this, SLOT(sltPerformShutdownMachine()));
     
    15961619    /* 'Machine/Close' menu connections: */
    15971620    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()));
    15981622    connect(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_SaveState), SIGNAL(triggered()), this, SLOT(sltPerformSaveMachineState()));
    15991623    connect(actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Shutdown), SIGNAL(triggered()), this, SLOT(sltPerformShutdownMachine()));
     
    17831807    /* Enable/disable group-close actions: */
    17841808    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));
    17851810    actionPool()->action(UIActionIndexST_M_Group_M_Close_S_SaveState)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_M_Close_S_SaveState, items));
    17861811    actionPool()->action(UIActionIndexST_M_Group_M_Close_S_Shutdown)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_M_Close_S_Shutdown, items));
     
    17891814    /* Enable/disable machine-close actions: */
    17901815    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));
    17911817    actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_SaveState)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_SaveState, items));
    17921818    actionPool()->action(UIActionIndexST_M_Machine_M_Close_S_Shutdown)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Shutdown, items));
     
    19391965            return isAtLeastOneItemStarted(items);
    19401966        }
     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        }
    19411972        case UIActionIndexST_M_Group_M_Close_S_SaveState:
    19421973        case UIActionIndexST_M_Machine_M_Close_S_SaveState:
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h

    r60599 r61101  
    143143        /** Handles call to reset machine. */
    144144        void sltPerformResetMachine();
     145        /** Handles call to detach machine UI. */
     146        void sltPerformDetachMachineUI();
    145147        /** Handles call to save machine state. */
    146148        void sltPerformSaveMachineState();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette