VirtualBox

Changeset 52467 in vbox


Ignore:
Timestamp:
Aug 22, 2014 11:55:21 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
95682
Message:

FE/Qt: 7462: Extra-data Manager should provide defaults for menu-bar restrictions.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r52464 r52467  
    25942594            result = static_cast<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(result | value);
    25952595    }
     2596    /* Defaults: */
     2597    if (result == UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Invalid)
     2598    {
     2599        result = static_cast<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(result | UIExtraDataMetaDefs::RuntimeMenuMachineActionType_KeyboardSettings);
     2600        result = static_cast<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(result | UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState);
     2601        result = static_cast<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(result | UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff);
     2602    }
    25962603    /* Return result: */
    25972604    return result;
     
    26852692        if (value != UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Invalid)
    26862693            result = static_cast<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(result | value);
     2694    }
     2695    /* Defaults: */
     2696    if (result == UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Invalid)
     2697    {
     2698        result = static_cast<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(result | UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrives);
     2699        result = static_cast<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(result | UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders);
    26872700    }
    26882701    /* Return result: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r52459 r52467  
    173173protected:
    174174
    175     void retranslateUi() {}
     175    void retranslateUi()
     176    {
     177        setName(QApplication::translate("UIActionPool", "&Keyboard"));
     178    }
    176179};
    177180
     
    199202};
    200203
    201 class UIActionMenuMouseIntegration : public UIActionMenu
    202 {
    203     Q_OBJECT;
    204 
    205 public:
    206 
    207     UIActionMenuMouseIntegration(UIActionPool *pParent)
     204class UIActionMenuMouse : public UIActionMenu
     205{
     206    Q_OBJECT;
     207
     208public:
     209
     210    UIActionMenuMouse(UIActionPool *pParent)
    208211        : UIActionMenu(pParent) {}
    209212
    210213protected:
    211214
    212     void retranslateUi() {}
     215    void retranslateUi()
     216    {
     217        setName(QApplication::translate("UIActionPool", "&Mouse"));
     218    }
    213219};
    214220
     
    728734};
    729735
    730 class UIActionMenuHardDisks : public UIActionMenu
    731 {
    732     Q_OBJECT;
    733 
    734 public:
    735 
    736     UIActionMenuHardDisks(UIActionPool *pParent)
     736class UIActionMenuHardDrives : public UIActionMenu
     737{
     738    Q_OBJECT;
     739
     740public:
     741
     742    UIActionMenuHardDrives(UIActionPool *pParent)
    737743        : UIActionMenu(pParent, ":/hd_16px.png", ":/hd_disabled_16px.png")
    738744    {
     
    742748protected:
    743749
    744     void retranslateUi() {}
    745 };
    746 
    747 class UIActionSimpleShowStorageSettingsDialog : public UIActionSimple
    748 {
    749     Q_OBJECT;
    750 
    751 public:
    752 
    753     UIActionSimpleShowStorageSettingsDialog(UIActionPool *pParent)
     750    void retranslateUi()
     751    {
     752        setName(QApplication::translate("UIActionPool", "&Hard Drives"));
     753    }
     754};
     755
     756class UIActionSimpleShowHardDrivesSettingsDialog : public UIActionSimple
     757{
     758    Q_OBJECT;
     759
     760public:
     761
     762    UIActionSimpleShowHardDrivesSettingsDialog(UIActionPool *pParent)
    754763        : UIActionSimple(pParent, ":/hd_settings_16px.png", ":/hd_settings_disabled_16px.png") {}
    755764
     
    758767    QString shortcutExtraDataID() const
    759768    {
    760         return QString("StorageSettingsDialog");
    761     }
    762 
    763     void retranslateUi()
    764     {
    765         setName(QApplication::translate("UIActionPool", "&Storage Settings..."));
    766         setStatusTip(QApplication::translate("UIActionPool", "Change the settings of storage devices"));
     769        return QString("HardDriveSettingsDialog");
     770    }
     771
     772    void retranslateUi()
     773    {
     774        setName(QApplication::translate("UIActionPool", "&Hard Drive Settings..."));
     775        setStatusTip(QApplication::translate("UIActionPool", "Change the settings of hard drives"));
    767776    }
    768777};
     
    952961
    953962    UIActionMenuSharedFolders(UIActionPool *pParent)
    954         : UIActionMenu(pParent) {}
    955 
    956 protected:
    957 
    958     void retranslateUi() {}
     963        : UIActionMenu(pParent, ":/sf_16px.png", ":/sf_disabled_16px.png") {}
     964
     965protected:
     966
     967    void retranslateUi()
     968    {
     969        setName(QApplication::translate("UIActionPool", "&Shared Folders"));
     970    }
    959971};
    960972
     
    10181030protected:
    10191031
    1020     void retranslateUi() {}
     1032    void retranslateUi()
     1033    {
     1034        setName(QApplication::translate("UIActionPool", "&Video Capture"));
     1035    }
    10211036};
    10221037
     
    14421457    m_pool[UIActionIndexRT_M_Machine_M_Keyboard] = new UIActionMenuKeyboard(this);
    14431458    m_pool[UIActionIndexRT_M_Machine_M_Keyboard_S_Settings] = new UIActionSimpleKeyboardSettings(this);
    1444     m_pool[UIActionIndexRT_M_Machine_M_Mouse] = new UIActionMenuMouseIntegration(this);
     1459    m_pool[UIActionIndexRT_M_Machine_M_Mouse] = new UIActionMenuMouse(this);
    14451460    m_pool[UIActionIndexRT_M_Machine_M_Mouse_T_Integration] = new UIActionToggleMouseIntegration(this);
    14461461    m_pool[UIActionIndexRT_M_Machine_S_TypeCAD] = new UIActionSimplePerformTypeCAD(this);
     
    14691484    /* 'Devices' actions: */
    14701485    m_pool[UIActionIndexRT_M_Devices] = new UIActionMenuDevices(this);
    1471     m_pool[UIActionIndexRT_M_Devices_M_HardDrives] = new UIActionMenuHardDisks(this);
    1472     m_pool[UIActionIndexRT_M_Devices_M_HardDrives_S_Settings] = new UIActionSimpleShowStorageSettingsDialog(this);
     1486    m_pool[UIActionIndexRT_M_Devices_M_HardDrives] = new UIActionMenuHardDrives(this);
     1487    m_pool[UIActionIndexRT_M_Devices_M_HardDrives_S_Settings] = new UIActionSimpleShowHardDrivesSettingsDialog(this);
    14731488    m_pool[UIActionIndexRT_M_Devices_M_OpticalDevices] = new UIActionMenuOpticalDevices(this);
    14741489    m_pool[UIActionIndexRT_M_Devices_M_FloppyDevices] = new UIActionMenuFloppyDevices(this);
     
    17461761    updateMenuMachineKeyboard();
    17471762
     1763    /* 'Keyboard Settings' action: */
     1764    const bool fAllowToShowActionKeyboardSettings = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_KeyboardSettings);
     1765    action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings)->setEnabled(fAllowToShowActionKeyboardSettings);
     1766    if (fAllowToShowActionKeyboardSettings)
     1767    {
     1768        pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings));
     1769        fSeparator2 = true;
     1770    }
     1771
    17481772    /* 'Mouse' submenu: */
    17491773    const bool fAllowToShowActionMouse = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Mouse);
     
    18241848    if (fAllowToShowActionSaveState)
    18251849    {
    1826 //        pMenu->addAction(action(UIActionIndexRT_M_Machine_S_Save));
    1827 //        fSeparator4 = true;
     1850        pMenu->addAction(action(UIActionIndexRT_M_Machine_S_Save));
     1851        fSeparator4 = true;
    18281852    }
    18291853
     
    18421866    if (fAllowToShowActionPowerOff)
    18431867    {
    1844 //        pMenu->addAction(action(UIActionIndexRT_M_Machine_S_PowerOff));
    1845 //        fSeparator4 = true;
     1868        pMenu->addAction(action(UIActionIndexRT_M_Machine_S_PowerOff));
     1869        fSeparator4 = true;
    18461870    }
    18471871
     
    22312255    if (fAllowToShowActionHardDrives)
    22322256    {
    2233 //        pMenu->addAction(action(UIActionIndexRT_M_Devices_M_HardDrives));
    2234 //        fSeparator1 = true;
     2257        pMenu->addAction(action(UIActionIndexRT_M_Devices_M_HardDrives));
     2258        fSeparator1 = true;
    22352259    }
    22362260    updateMenuDevicesHardDrives();
     
    23062330    if (fAllowToShowActionSharedFolders)
    23072331    {
    2308 //        pMenu->addAction(action(UIActionIndexRT_M_Devices_M_SharedFolders));
    2309 //        fSeparator1 = true;
     2332        pMenu->addAction(action(UIActionIndexRT_M_Devices_M_SharedFolders));
     2333        fSeparator1 = true;
    23102334    }
    23112335    updateMenuDevicesSharedFolders();
Note: See TracChangeset for help on using the changeset viewer.

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