VirtualBox

Changeset 52186 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 25, 2014 1:00:08 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Extend USB menu with settings action; Restriction fix for r95238.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
11 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc

    r52116 r52186  
    270270        <file alias="os_type_16px.png">images/os_type_16px.png</file>
    271271        <file alias="os_ubuntu.png">images/os_ubuntu.png</file>
     272        <file alias="os_ubuntu_64.png">images/os_ubuntu_64.png</file>
    272273    </qresource>
    273274</RCC>
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox1_hidpi.qrc

    r51922 r52186  
    247247        <file alias="os_openbsd_hidpi.png">images/hidpi/os_openbsd_hidpi.png</file>
    248248        <file alias="os_opensuse_64_hidpi.png">images/hidpi/os_opensuse_64_hidpi.png</file>
     249        <file alias="os_opensuse_hidpi.png">images/hidpi/os_opensuse_hidpi.png</file>
    249250    </qresource>
    250251</RCC>
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox2.qrc

    r52116 r52186  
    11<RCC>
    22    <qresource prefix="/">
    3         <file alias="os_ubuntu_64.png">images/os_ubuntu_64.png</file>
    43        <file alias="os_win2k.png">images/os_win2k.png</file>
    54        <file alias="os_win2k12_64.png">images/os_win2k12_64.png</file>
     
    185184        <file alias="usb_remove_16px.png">images/usb_remove_16px.png</file>
    186185        <file alias="usb_remove_disabled_16px.png">images/usb_remove_disabled_16px.png</file>
     186        <file alias="usb_settings_16px.png">images/usb_settings_16px.png</file>
     187        <file alias="usb_settings_disabled_16px.png">images/usb_settings_disabled_16px.png</file>
    187188        <file alias="usb_unavailable_16px.png">images/usb_unavailable_16px.png</file>
    188189        <file alias="usb_unavailable_disabled_16px.png">images/usb_unavailable_disabled_16px.png</file>
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox2_hidpi.qrc

    r51922 r52186  
    11<RCC>
    22    <qresource prefix="/">
    3         <file alias="os_opensuse_hidpi.png">images/hidpi/os_opensuse_hidpi.png</file>
    43        <file alias="os_oracle_64_hidpi.png">images/hidpi/os_oracle_64_hidpi.png</file>
    54        <file alias="os_oracle_hidpi.png">images/hidpi/os_oracle_hidpi.png</file>
     
    179178        <file alias="usb_remove_16px_hidpi.png">images/hidpi/usb_remove_16px_hidpi.png</file>
    180179        <file alias="usb_remove_disabled_16px_hidpi.png">images/hidpi/usb_remove_disabled_16px_hidpi.png</file>
     180        <file alias="usb_settings_16px_hidpi.png">images/hidpi/usb_settings_16px_hidpi.png</file>
     181        <file alias="usb_settings_disabled_16px_hidpi.png">images/hidpi/usb_settings_disabled_16px_hidpi.png</file>
    181182        <file alias="usb_unavailable_16px_hidpi.png">images/hidpi/usb_unavailable_16px_hidpi.png</file>
    182183        <file alias="usb_unavailable_disabled_16px_hidpi.png">images/hidpi/usb_unavailable_disabled_16px_hidpi.png</file>
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

    r52180 r52186  
    565565        case RuntimeMenuDevicesActionType_FloppyDevices:         strResult = "FloppyDevices"; break;
    566566        case RuntimeMenuDevicesActionType_USBDevices:            strResult = "USBDevices"; break;
     567        case RuntimeMenuDevicesActionType_USBDevicesSettings:    strResult = "USBDevicesSettings"; break;
    567568        case RuntimeMenuDevicesActionType_WebCams:               strResult = "WebCams"; break;
    568569        case RuntimeMenuDevicesActionType_SharedClipboard:       strResult = "SharedClipboard"; break;
     
    597598    keys << "FloppyDevices";         values << RuntimeMenuDevicesActionType_FloppyDevices;
    598599    keys << "USBDevices";            values << RuntimeMenuDevicesActionType_USBDevices;
     600    keys << "USBDevicesSettings";    values << RuntimeMenuDevicesActionType_USBDevicesSettings;
    599601    keys << "WebCams";               values << RuntimeMenuDevicesActionType_WebCams;
    600602    keys << "SharedClipboard";       values << RuntimeMenuDevicesActionType_SharedClipboard;
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r52180 r52186  
    435435    RuntimeMenuDevicesActionType_FloppyDevices         = RT_BIT(3),
    436436    RuntimeMenuDevicesActionType_USBDevices            = RT_BIT(4),
    437     RuntimeMenuDevicesActionType_WebCams               = RT_BIT(5),
    438     RuntimeMenuDevicesActionType_SharedClipboard       = RT_BIT(6),
    439     RuntimeMenuDevicesActionType_DragAndDrop           = RT_BIT(7),
    440     RuntimeMenuDevicesActionType_Network               = RT_BIT(8),
    441     RuntimeMenuDevicesActionType_NetworkSettings       = RT_BIT(9),
    442     RuntimeMenuDevicesActionType_SharedFolders         = RT_BIT(10),
    443     RuntimeMenuDevicesActionType_SharedFoldersSettings = RT_BIT(11),
    444     RuntimeMenuDevicesActionType_VRDEServer            = RT_BIT(12),
    445     RuntimeMenuDevicesActionType_VideoCapture          = RT_BIT(13),
    446     RuntimeMenuDevicesActionType_VideoCaptureSettings  = RT_BIT(14),
    447     RuntimeMenuDevicesActionType_InstallGuestTools     = RT_BIT(15),
     437    RuntimeMenuDevicesActionType_USBDevicesSettings    = RT_BIT(5),
     438    RuntimeMenuDevicesActionType_WebCams               = RT_BIT(6),
     439    RuntimeMenuDevicesActionType_SharedClipboard       = RT_BIT(7),
     440    RuntimeMenuDevicesActionType_DragAndDrop           = RT_BIT(8),
     441    RuntimeMenuDevicesActionType_Network               = RT_BIT(9),
     442    RuntimeMenuDevicesActionType_NetworkSettings       = RT_BIT(10),
     443    RuntimeMenuDevicesActionType_SharedFolders         = RT_BIT(11),
     444    RuntimeMenuDevicesActionType_SharedFoldersSettings = RT_BIT(12),
     445    RuntimeMenuDevicesActionType_VRDEServer            = RT_BIT(13),
     446    RuntimeMenuDevicesActionType_VideoCapture          = RT_BIT(14),
     447    RuntimeMenuDevicesActionType_VideoCaptureSettings  = RT_BIT(15),
     448    RuntimeMenuDevicesActionType_InstallGuestTools     = RT_BIT(16),
    448449    RuntimeMenuDevicesActionType_All                   = 0xFFFF
    449450};
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r52184 r52186  
    216216    void retranslateUi()
    217217    {
    218         setName(QApplication::translate("UIActionPool", "Configure &Shortcuts..."));
     218        setName(QApplication::translate("UIActionPool", "&Keyboard Settings..."));
    219219        setStatusTip(QApplication::translate("UIActionPool", "Display the global settings window to configure shortcuts"));
    220220    }
     
    915915    {
    916916        setName(QApplication::translate("UIActionPool", "&USB Devices"));
     917    }
     918};
     919
     920class UIActionSimpleShowUSBDevicesSettingsDialog : public UIActionSimple
     921{
     922    Q_OBJECT;
     923
     924public:
     925
     926    UIActionSimpleShowUSBDevicesSettingsDialog(UIActionPool *pParent)
     927        : UIActionSimple(pParent, ":/usb_settings_16px.png", ":/usb_settings_disabled_16px.png")
     928    {
     929        retranslateUi();
     930    }
     931
     932protected:
     933
     934    QString shortcutExtraDataID() const
     935    {
     936        return QString("USBDevicesSettingsDialog");
     937    }
     938
     939    void retranslateUi()
     940    {
     941        setName(QApplication::translate("UIActionPool", "&USB Settings..."));
     942        setStatusTip(QApplication::translate("UIActionPool", "Change the settings of USB devices"));
    917943    }
    918944};
     
    15701596    m_pool[UIActionIndexRT_M_Devices_M_FloppyDevices] = new UIActionMenuFloppyDevices(this);
    15711597    m_pool[UIActionIndexRT_M_Devices_M_USBDevices] = new UIActionMenuUSBDevices(this);
     1598    m_pool[UIActionIndexRT_M_Devices_M_USBDevices_S_Settings] = new UIActionSimpleShowUSBDevicesSettingsDialog(this);
    15721599    m_pool[UIActionIndexRT_M_Devices_M_WebCams] = new UIActionMenuWebCams(this);
    15731600    m_pool[UIActionIndexRT_M_Devices_M_SharedClipboard] = new UIActionMenuSharedClipboard(this);
     
    16421669    /* Recache reconfiguration action restrictions: */
    16431670    bool fReconfigurationAllowed = gEDataManager->machineReconfigurationEnabled(strMachineID);
    1644     if (fReconfigurationAllowed)
     1671    if (!fReconfigurationAllowed)
    16451672    {
    16461673        m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] = (RuntimeMenuMachineActionType)
     
    16481675        m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = (RuntimeMenuDevicesActionType)
    16491676            (m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] | RuntimeMenuDevicesActionType_HardDrivesSettings);
     1677        m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = (RuntimeMenuDevicesActionType)
     1678            (m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] | RuntimeMenuDevicesActionType_USBDevicesSettings);
    16501679        m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = (RuntimeMenuDevicesActionType)
    16511680            (m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] | RuntimeMenuDevicesActionType_NetworkSettings);
     
    16581687    /* Recache snapshot related action restrictions: */
    16591688    bool fSnapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled(strMachineID);
    1660     if (fSnapshotOperationsAllowed)
     1689    if (!fSnapshotOperationsAllowed)
    16611690    {
    16621691        m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] = (RuntimeMenuMachineActionType)
     
    16671696    CExtPack extPack = vboxGlobal().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName);
    16681697    bool fExtensionPackOperationsAllowed = !extPack.isNull() && extPack.GetUsable();
    1669     if (fExtensionPackOperationsAllowed)
     1698    if (!fExtensionPackOperationsAllowed)
    16701699    {
    16711700        m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = (RuntimeMenuDevicesActionType)
     
    21772206        fSeparator1 = true;
    21782207    }
     2208    updateMenuDevicesUSBDevices();
    21792209
    21802210    /* 'Web Cams' submenu: */
     
    22772307    if (fAllowToShowActionHardDrivesSettings)
    22782308        pMenu->addAction(gpActionPool->action(UIActionIndexRT_M_Devices_M_HardDrives_S_Settings));
     2309}
     2310
     2311void UIActionPoolRuntime::updateMenuDevicesUSBDevices()
     2312{
     2313    /* Get corresponding menu: */
     2314    QMenu *pMenu = gpActionPool->action(UIActionIndexRT_M_Devices_M_USBDevices)->menu();
     2315    AssertPtrReturnVoid(pMenu);
     2316    /* Clear contents: */
     2317    pMenu->clear();
     2318
     2319    /* 'USB Devices Settings' action: */
     2320    const bool fAllowToShowActionUSBDevicesSettings = isAllowedInMenuDevices(RuntimeMenuDevicesActionType_USBDevicesSettings);
     2321    gpActionPool->action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings)->setEnabled(fAllowToShowActionUSBDevicesSettings);
     2322    if (fAllowToShowActionUSBDevicesSettings)
     2323        pMenu->addAction(gpActionPool->action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings));
    22792324}
    22802325
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h

    r52184 r52186  
    7575    UIActionIndexRT_M_Devices_M_FloppyDevices,
    7676    UIActionIndexRT_M_Devices_M_USBDevices,
     77    UIActionIndexRT_M_Devices_M_USBDevices_S_Settings,
    7778    UIActionIndexRT_M_Devices_M_WebCams,
    7879    UIActionIndexRT_M_Devices_M_SharedClipboard,
     
    200201    /** Update 'Devices' : 'Hard Drives' menu routine. */
    201202    void updateMenuDevicesHardDrives();
     203    /** Update 'Devices' : 'USB' menu routine. */
     204    void updateMenuDevicesUSBDevices();
    202205    /** Update 'Devices' : 'Network' menu routine. */
    203206    void updateMenuDevicesNetwork();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r52184 r52186  
    858858    m_pRunningOrPausedActions->addAction(gpActionPool->action(UIActionIndexRT_M_Devices_M_FloppyDevices));
    859859    m_pRunningOrPausedActions->addAction(gpActionPool->action(UIActionIndexRT_M_Devices_M_USBDevices));
     860    m_pRunningOrPausedActions->addAction(gpActionPool->action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings));
    860861    m_pRunningOrPausedActions->addAction(gpActionPool->action(UIActionIndexRT_M_Devices_M_WebCams));
    861862    m_pRunningOrPausedActions->addAction(gpActionPool->action(UIActionIndexRT_M_Devices_M_SharedClipboard));
     
    924925    connect(gpActionPool->action(UIActionIndexRT_M_Devices_M_USBDevices)->menu(), SIGNAL(aboutToShow()),
    925926            this, SLOT(sltPrepareUSBMenu()));
     927    connect(gpActionPool->action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings), SIGNAL(triggered()),
     928            this, SLOT(sltOpenUSBDevicesSettingsDialog()));
    926929    connect(gpActionPool->action(UIActionIndexRT_M_Devices_M_WebCams)->menu(), SIGNAL(aboutToShow()),
    927930            this, SLOT(sltPrepareWebCamMenu()));
     
    933936            this, SLOT(sltPrepareNetworkMenu()));
    934937    connect(gpActionPool->action(UIActionIndexRT_M_Devices_M_Network_S_Settings), SIGNAL(triggered()),
    935             this, SLOT(sltOpenNetworkAdaptersDialog()));
     938            this, SLOT(sltOpenNetworkSettingsDialog()));
    936939    connect(gpActionPool->action(UIActionIndexRT_M_Devices_M_SharedFolders_S_Settings), SIGNAL(triggered()),
    937             this, SLOT(sltOpenSharedFoldersDialog()));
     940            this, SLOT(sltOpenSharedFoldersSettingsDialog()));
    938941    connect(gpActionPool->action(UIActionIndexRT_M_Devices_T_VRDEServer), SIGNAL(toggled(bool)),
    939942            this, SLOT(sltToggleVRDE(bool)));
     
    15241527}
    15251528
    1526 void UIMachineLogic::sltOpenNetworkAdaptersDialog()
     1529void UIMachineLogic::sltOpenUSBDevicesSettingsDialog()
     1530{
     1531    /* Machine settings: Storage page: */
     1532    sltOpenVMSettingsDialog("#usb");
     1533}
     1534
     1535void UIMachineLogic::sltOpenNetworkSettingsDialog()
    15271536{
    15281537    /* Open VM settings : Network page: */
     
    15301539}
    15311540
    1532 void UIMachineLogic::sltOpenSharedFoldersDialog()
     1541void UIMachineLogic::sltOpenSharedFoldersSettingsDialog()
    15331542{
    15341543    /* Do not process if additions are not loaded! */
     
    16231632    /* Clear menu initially: */
    16241633    pMenu->clear();
     1634
     1635    /* Add settings action: */
     1636    pMenu->addAction(gpActionPool->action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings));
    16251637
    16261638    /* Get current host: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r52184 r52186  
    8787
    8888    /* Wrapper to open Machine settings / Network page: */
    89     void openNetworkAdaptersDialog() { sltOpenNetworkAdaptersDialog(); }
     89    void openNetworkSettingsDialog() { sltOpenNetworkSettingsDialog(); }
    9090
    9191#ifdef Q_WS_MAC
     
    220220    void sltOpenVMSettingsDialog(const QString &strCategory = QString(), const QString &strControl = QString());
    221221    void sltOpenStorageSettingsDialog();
    222     void sltOpenNetworkAdaptersDialog();
    223     void sltOpenSharedFoldersDialog();
     222    void sltOpenUSBDevicesSettingsDialog();
     223    void sltOpenNetworkSettingsDialog();
     224    void sltOpenSharedFoldersSettingsDialog();
    224225    void sltPrepareStorageMenu();
    225226    void sltMountStorageMedium();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r52184 r52186  
    982982    const CHost host = vboxGlobal().host();
    983983    const CMachine machine = session().GetConsole().GetMachine();
     984    RuntimeMenuDevicesActionType restriction = RuntimeMenuDevicesActionType_Invalid;
    984985
    985986    /* Storage stuff: */
     
    10001001        pFloppyDevicesMenu->setData(iDevicesCountFD);
    10011002        if (!iDevicesCountCD)
    1002             gpActionPool->toRuntime()->setRestrictionForMenuDevices(UIActionPool::UIActionRestrictionLevel_Session,
    1003                                                                     RuntimeMenuDevicesActionType_OpticalDevices);
     1003            restriction = (RuntimeMenuDevicesActionType)(restriction | RuntimeMenuDevicesActionType_OpticalDevices);
    10041004        if (!iDevicesCountFD)
    1005             gpActionPool->toRuntime()->setRestrictionForMenuDevices(UIActionPool::UIActionRestrictionLevel_Session,
    1006                                                                     RuntimeMenuDevicesActionType_FloppyDevices);
     1005            restriction = (RuntimeMenuDevicesActionType)(restriction | RuntimeMenuDevicesActionType_FloppyDevices);
    10071006    }
    10081007
     
    10231022        }
    10241023        if (!fAtLeastOneAdapterActive)
    1025             gpActionPool->toRuntime()->setRestrictionForMenuDevices(UIActionPool::UIActionRestrictionLevel_Session,
    1026                                                                     RuntimeMenuDevicesActionType_Network);
     1024            restriction = (RuntimeMenuDevicesActionType)(restriction | RuntimeMenuDevicesActionType_Network);
    10271025    }
    10281026
     
    10341032                                 && machine.GetUSBProxyAvailable();
    10351033        if (!fUSBEnabled)
    1036             gpActionPool->toRuntime()->setRestrictionForMenuDevices(UIActionPool::UIActionRestrictionLevel_Session,
    1037                                                                     RuntimeMenuDevicesActionType_USBDevices);
     1034            restriction = (RuntimeMenuDevicesActionType)(restriction | RuntimeMenuDevicesActionType_USBDevices);
    10381035    }
    10391036
     
    10441041        const bool fWebCamsEnabled = host.isOk() && !machine.GetUSBControllers().isEmpty();
    10451042        if (!fWebCamsEnabled)
    1046             gpActionPool->toRuntime()->setRestrictionForMenuDevices(UIActionPool::UIActionRestrictionLevel_Session,
    1047                                                                     RuntimeMenuDevicesActionType_WebCams);
    1048     }
     1043            restriction = (RuntimeMenuDevicesActionType)(restriction | RuntimeMenuDevicesActionType_WebCams);
     1044    }
     1045
     1046    /* Apply cumulative restriction: */
     1047    gpActionPool->toRuntime()->setRestrictionForMenuDevices(UIActionPool::UIActionRestrictionLevel_Session, restriction);
    10491048
    10501049#ifdef Q_WS_MAC
     
    15631562    {
    15641563        if (msgCenter().UIMessageCenter::cannotStartWithoutNetworkIf(machine.GetName(), failedInterfaceNames.join(", ")))
    1565             machineLogic()->openNetworkAdaptersDialog();
     1564            machineLogic()->openNetworkSettingsDialog();
    15661565        else
    15671566        {
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