VirtualBox

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


Ignore:
Timestamp:
Jun 24, 2013 5:21:53 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: Adding extra-data flag to restrict (hide) particular global/machine settings pages.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp

    r46726 r46763  
    6868const char* UIDefs::GUI_RestrictedStatusBarIndicators = "GUI/RestrictedStatusBarIndicators";
    6969
     70/* Settings dialogs stuff: */
     71const char* UIDefs::GUI_RestrictedGlobalSettingsPages = "GUI/RestrictedGlobalSettingsPages";
     72const char* UIDefs::GUI_RestrictedMachineSettingsPages = "GUI/RestrictedMachineSettingsPages";
     73
    7074/* Mini tool-bar definitions: */
    7175const char* UIDefs::GUI_ShowMiniToolBar = "GUI/ShowMiniToolBar";
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h

    r46761 r46763  
    140140    extern const char* GUI_RestrictedStatusBarIndicators;
    141141
     142    /* Settings dialogs stuff: */
     143    extern const char* GUI_RestrictedGlobalSettingsPages;
     144    extern const char* GUI_RestrictedMachineSettingsPages;
     145
    142146    /* Mini tool-bar declarations: */
    143147    extern const char* GUI_ShowMiniToolBar;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r46726 r46763  
    37763776        MachineCloseAction value = gpConverter->fromInternalString<MachineCloseAction>(strValue);
    37773777        if (value != MachineCloseAction_Invalid)
     3778            result << value;
     3779    }
     3780    /* Return result: */
     3781    return result;
     3782}
     3783
     3784/* static */
     3785QList<GlobalSettingsPageType> VBoxGlobal::restrictedGlobalSettingsPages(CVirtualBox &vbox)
     3786{
     3787    /* Prepare result: */
     3788    QList<GlobalSettingsPageType> result;
     3789    /* Load restricted global-settings-pages: */
     3790    QString strList(vbox.GetExtraData(GUI_RestrictedGlobalSettingsPages));
     3791    QStringList list = strList.split(',');
     3792    /* Convert list into appropriate values: */
     3793    foreach (const QString &strValue, list)
     3794    {
     3795        GlobalSettingsPageType value = gpConverter->fromInternalString<GlobalSettingsPageType>(strValue);
     3796        if (value != GlobalSettingsPageType_Invalid)
     3797            result << value;
     3798    }
     3799    /* Return result: */
     3800    return result;
     3801}
     3802
     3803/* static */
     3804QList<MachineSettingsPageType> VBoxGlobal::restrictedMachineSettingsPages(CMachine &machine)
     3805{
     3806    /* Prepare result: */
     3807    QList<MachineSettingsPageType> result;
     3808    /* Load restricted machine-settings-pages: */
     3809    QString strList(machine.GetExtraData(GUI_RestrictedMachineSettingsPages));
     3810    QStringList list = strList.split(',');
     3811    /* Convert list into appropriate values: */
     3812    foreach (const QString &strValue, list)
     3813    {
     3814        MachineSettingsPageType value = gpConverter->fromInternalString<MachineSettingsPageType>(strValue);
     3815        if (value != MachineSettingsPageType_Invalid)
    37783816            result << value;
    37793817    }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r46726 r46763  
    386386    static QList<IndicatorType> restrictedStatusBarIndicators(CMachine &machine);
    387387    static QList<MachineCloseAction> restrictedMachineCloseActions(CMachine &machine);
     388    static QList<GlobalSettingsPageType> restrictedGlobalSettingsPages(CVirtualBox &vbox);
     389    static QList<MachineSettingsPageType> restrictedMachineSettingsPages(CMachine &machine);
    388390
    389391#ifdef RT_OS_LINUX
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r46761 r46763  
    311311
    312312    /* Creating settings pages: */
     313    QList<GlobalSettingsPageType> restrictedGlobalSettingsPages = vboxGlobal().restrictedGlobalSettingsPages(vboxGlobal().virtualBox());
    313314    for (int iPageIndex = GlobalSettingsPageType_General; iPageIndex < GlobalSettingsPageType_Max; ++iPageIndex)
    314315    {
     316        /* Make sure page was not restricted: */
     317        if (restrictedGlobalSettingsPages.contains(static_cast<GlobalSettingsPageType>(iPageIndex)))
     318            continue;
     319
     320        /* Make sure page is available: */
    315321        if (isPageAvailable(iPageIndex))
    316322        {
     
    578584
    579585    /* Creating settings pages: */
     586    QList<MachineSettingsPageType> restrictedMachineSettingsPages = vboxGlobal().restrictedMachineSettingsPages(m_machine);
    580587    for (int iPageIndex = MachineSettingsPageType_General; iPageIndex < MachineSettingsPageType_Max; ++iPageIndex)
    581588    {
     589        /* Make sure page was not restricted: */
     590        if (restrictedMachineSettingsPages.contains(static_cast<MachineSettingsPageType>(iPageIndex)))
     591            continue;
     592
     593        /* Make sure page is available: */
    582594        if (isPageAvailable(iPageIndex))
    583595        {
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