VirtualBox

Changeset 95222 in vbox for trunk/src


Ignore:
Timestamp:
Jun 8, 2022 10:16:27 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
151741
Message:

FE/Qt/Ds: bugref:6899: Machine settings: System page accessibility improvements (part 9); Moving extended acceleration features stuff into separate UIAccelerationFeaturesEditor widget.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r95213 r95222  
    893893        src/settings/UISettingsSelector.h \
    894894        src/settings/UISettingsSerializer.h \
     895        src/settings/editors/UIAccelerationFeaturesEditor.h \
    895896        src/settings/editors/UIAudioControllerEditor.h \
    896897        src/settings/editors/UIAudioFeaturesEditor.h \
     
    14691470        src/settings/UISettingsSelector.cpp \
    14701471        src/settings/UISettingsSerializer.cpp \
     1472        src/settings/editors/UIAccelerationFeaturesEditor.cpp \
    14711473        src/settings/editors/UIAudioControllerEditor.cpp \
    14721474        src/settings/editors/UIAudioFeaturesEditor.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIAccelerationFeaturesEditor.cpp

    r95221 r95222  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIProcessorFeaturesEditor class implementation.
     3 * VBox Qt GUI - UIAccelerationFeaturesEditor class implementation.
    44 */
    55
     
    2020#include <QGridLayout>
    2121#include <QLabel>
     22#include <QVBoxLayout>
    2223
    2324/* GUI includes: */
    24 #include "UIProcessorFeaturesEditor.h"
     25#include "UIAccelerationFeaturesEditor.h"
    2526
    2627
    27 UIProcessorFeaturesEditor::UIProcessorFeaturesEditor(QWidget *pParent /* = 0 */)
     28UIAccelerationFeaturesEditor::UIAccelerationFeaturesEditor(QWidget *pParent /* = 0 */)
    2829    : QIWithRetranslateUI<QWidget>(pParent)
    29     , m_fEnablePae(false)
    30     , m_fEnableNestedVirtualization(false)
     30    , m_fEnableVirtualization(false)
     31    , m_fEnableNestedPaging(false)
    3132    , m_pLabel(0)
    32     , m_pCheckBoxEnablePae(0)
    33     , m_pCheckBoxEnableNestedVirtualization(0)
     33    , m_pCheckBoxEnableVirtualization(0)
     34    , m_pCheckBoxEnableNestedPaging(0)
    3435{
    3536    prepare();
    3637}
    3738
    38 void UIProcessorFeaturesEditor::setEnablePae(bool fOn)
     39void UIAccelerationFeaturesEditor::setEnableVirtualization(bool fOn)
    3940{
    4041    /* Update cached value and
    4142     * check-box if value has changed: */
    42     if (m_fEnablePae != fOn)
     43    if (m_fEnableVirtualization != fOn)
    4344    {
    44         m_fEnablePae = fOn;
    45         if (m_pCheckBoxEnablePae)
    46             m_pCheckBoxEnablePae->setCheckState(m_fEnablePae ? Qt::Checked : Qt::Unchecked);
     45        m_fEnableVirtualization = fOn;
     46        if (m_pCheckBoxEnableVirtualization)
     47            m_pCheckBoxEnableVirtualization->setCheckState(m_fEnableVirtualization ? Qt::Checked : Qt::Unchecked);
    4748    }
    4849}
    4950
    50 bool UIProcessorFeaturesEditor::isEnabledPae() const
     51bool UIAccelerationFeaturesEditor::isEnabledVirtualization() const
    5152{
    52     return   m_pCheckBoxEnablePae
    53            ? m_pCheckBoxEnablePae->checkState() == Qt::Checked
    54            : m_fEnablePae;
     53    return   m_pCheckBoxEnableVirtualization
     54           ? m_pCheckBoxEnableVirtualization->checkState() == Qt::Checked
     55           : m_fEnableVirtualization;
    5556}
    5657
    57 void UIProcessorFeaturesEditor::setEnablePaeAvailable(bool fAvailable)
     58void UIAccelerationFeaturesEditor::setEnableVirtualizationAvailable(bool fAvailable)
    5859{
    59     m_pCheckBoxEnablePae->setEnabled(fAvailable);
     60    m_pCheckBoxEnableVirtualization->setEnabled(fAvailable);
    6061}
    6162
    62 void UIProcessorFeaturesEditor::setEnableNestedVirtualization(bool fOn)
     63void UIAccelerationFeaturesEditor::setEnableNestedPaging(bool fOn)
    6364{
    6465    /* Update cached value and
    6566     * check-box if value has changed: */
    66     if (m_fEnableNestedVirtualization != fOn)
     67    if (m_fEnableNestedPaging != fOn)
    6768    {
    68         m_fEnableNestedVirtualization = fOn;
    69         if (m_pCheckBoxEnableNestedVirtualization)
    70             m_pCheckBoxEnableNestedVirtualization->setCheckState(m_fEnableNestedVirtualization ? Qt::Checked : Qt::Unchecked);
     69        m_fEnableNestedPaging = fOn;
     70        if (m_pCheckBoxEnableNestedPaging)
     71            m_pCheckBoxEnableNestedPaging->setCheckState(m_fEnableNestedPaging ? Qt::Checked : Qt::Unchecked);
    7172    }
    7273}
    7374
    74 bool UIProcessorFeaturesEditor::isEnabledNestedVirtualization() const
     75bool UIAccelerationFeaturesEditor::isEnabledNestedPaging() const
    7576{
    76     return   m_pCheckBoxEnableNestedVirtualization
    77            ? m_pCheckBoxEnableNestedVirtualization->checkState() == Qt::Checked
    78            : m_fEnableNestedVirtualization;
     77    return   m_pCheckBoxEnableNestedPaging
     78           ? m_pCheckBoxEnableNestedPaging->checkState() == Qt::Checked
     79           : m_fEnableNestedPaging;
    7980}
    8081
    81 void UIProcessorFeaturesEditor::setEnableNestedVirtualizationAvailable(bool fAvailable)
     82void UIAccelerationFeaturesEditor::setEnableNestedPagingAvailable(bool fAvailable)
    8283{
    83     m_pCheckBoxEnableNestedVirtualization->setEnabled(fAvailable);
     84    m_pCheckBoxEnableNestedPaging->setEnabled(fAvailable);
    8485}
    8586
    86 int UIProcessorFeaturesEditor::minimumLabelHorizontalHint() const
     87int UIAccelerationFeaturesEditor::minimumLabelHorizontalHint() const
    8788{
    8889    return m_pLabel ? m_pLabel->minimumSizeHint().width() : 0;
    8990}
    9091
    91 void UIProcessorFeaturesEditor::setMinimumLayoutIndent(int iIndent)
     92void UIAccelerationFeaturesEditor::setMinimumLayoutIndent(int iIndent)
    9293{
    9394    if (m_pLayout)
     
    9596}
    9697
    97 void UIProcessorFeaturesEditor::retranslateUi()
     98void UIAccelerationFeaturesEditor::retranslateUi()
    9899{
    99100    if (m_pLabel)
    100         m_pLabel->setText(tr("Extended Features:"));
    101     if (m_pCheckBoxEnablePae)
     101        m_pLabel->setText(tr("Hardware Virtualization:"));
     102    if (m_pCheckBoxEnableVirtualization)
    102103    {
    103         m_pCheckBoxEnablePae->setText(tr("Enable PA&E/NX"));
    104         m_pCheckBoxEnablePae->setToolTip(tr("When checked, the Physical Address Extension (PAE) feature of the host CPU will be "
    105                                             "exposed to the virtual machine."));
     104        m_pCheckBoxEnableVirtualization->setText(tr("Enable &VT-x/AMD-V"));
     105        m_pCheckBoxEnableVirtualization->setToolTip(tr("When checked, the virtual machine will try to make use of the host "
     106                                                       "CPU's hardware virtualization extensions such as Intel VT-x and AMD-V."));
    106107    }
    107     if (m_pCheckBoxEnableNestedVirtualization)
     108    if (m_pCheckBoxEnableNestedPaging)
    108109    {
    109         m_pCheckBoxEnableNestedVirtualization->setText(tr("Enable Nested &VT-x/AMD-V"));
    110         m_pCheckBoxEnableNestedVirtualization->setToolTip(tr("When checked, the nested hardware virtualization CPU feature will "
    111                                                              "be exposed to the virtual machine."));
     110        m_pCheckBoxEnableNestedPaging->setText(tr("Enable Nested Pa&ging"));
     111        m_pCheckBoxEnableNestedPaging->setToolTip(tr("When checked, the virtual machine will try to make use of the nested "
     112                                                     "paging extension of Intel VT-x and AMD-V."));
    112113    }
    113114}
    114115
    115 void UIProcessorFeaturesEditor::prepare()
     116void UIAccelerationFeaturesEditor::prepare()
    116117{
    117118    /* Prepare main layout: */
     
    122123        m_pLayout->setColumnStretch(1, 1);
    123124
    124         /* Prepare label: */
    125         m_pLabel = new QLabel(this);
    126         if (m_pLabel)
     125        /* Prepare label layout: */
     126        QVBoxLayout *pLayoutLabel = new QVBoxLayout;
     127        if (pLayoutLabel)
    127128        {
    128             m_pLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    129             m_pLayout->addWidget(m_pLabel, 0, 0);
     129            /* Prepare virtualization label: */
     130            m_pLabel = new QLabel(this);
     131            if (m_pLabel)
     132            {
     133                m_pLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     134                pLayoutLabel->addWidget(m_pLabel);
     135            }
     136            /* Prepare placeholder: */
     137            QWidget *pWidgetPlaceholder = new QWidget(this);
     138            if (pWidgetPlaceholder)
     139            {
     140#ifndef VBOX_WITH_RAW_MODE
     141                /* Hide placeholder when raw-mode is not supported: */
     142                pWidgetPlaceholder->setVisible(false);
     143#endif
     144                pLayoutLabel->addWidget(pWidgetPlaceholder);
     145            }
     146
     147            m_pLayout->addLayout(pLayoutLabel, 0, 0);
    130148        }
    131         /* Prepare 'enable PAE' check-box: */
    132         m_pCheckBoxEnablePae = new QCheckBox(this);
    133         if (m_pCheckBoxEnablePae)
     149
     150        /* Prepare widget layout: */
     151        QVBoxLayout *pLayoutWidget = new QVBoxLayout;
     152        if (pLayoutWidget)
    134153        {
    135             connect(m_pCheckBoxEnablePae, &QCheckBox::stateChanged,
    136                     this, &UIProcessorFeaturesEditor::sigChangedPae);
    137             m_pLayout->addWidget(m_pCheckBoxEnablePae, 0, 1);
    138         }
    139         /* Prepare 'enable nested virtualization' check-box: */
    140         m_pCheckBoxEnableNestedVirtualization = new QCheckBox(this);
    141         if (m_pCheckBoxEnableNestedVirtualization)
    142         {
    143             connect(m_pCheckBoxEnableNestedVirtualization, &QCheckBox::stateChanged,
    144                     this, &UIProcessorFeaturesEditor::sigChangedNestedVirtualization);
    145             m_pLayout->addWidget(m_pCheckBoxEnableNestedVirtualization, 1, 1);
     154            /* Prepare 'enable PAE' check-box: */
     155            m_pCheckBoxEnableVirtualization = new QCheckBox(this);
     156            if (m_pCheckBoxEnableVirtualization)
     157            {
     158#ifndef VBOX_WITH_RAW_MODE
     159                /* Hide check-box when raw-mode is not supported: */
     160                m_pCheckBoxEnableVirtualization->setVisible(false);
     161#endif
     162                connect(m_pCheckBoxEnableVirtualization, &QCheckBox::stateChanged,
     163                        this, &UIAccelerationFeaturesEditor::sigChangedVirtualization);
     164                pLayoutWidget->addWidget(m_pCheckBoxEnableVirtualization);
     165            }
     166            /* Prepare 'enable nested virtualization' check-box: */
     167            m_pCheckBoxEnableNestedPaging = new QCheckBox(this);
     168            if (m_pCheckBoxEnableNestedPaging)
     169            {
     170                connect(m_pCheckBoxEnableNestedPaging, &QCheckBox::stateChanged,
     171                        this, &UIAccelerationFeaturesEditor::sigChangedNestedPaging);
     172                pLayoutWidget->addWidget(m_pCheckBoxEnableNestedPaging);
     173            }
     174
     175            m_pLayout->addLayout(pLayoutWidget, 0, 1);
    146176        }
    147177    }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIAccelerationFeaturesEditor.h

    r95221 r95222  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIProcessorFeaturesEditor class declaration.
     3 * VBox Qt GUI - UIAccelerationFeaturesEditor class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef FEQT_INCLUDED_SRC_settings_editors_UIProcessorFeaturesEditor_h
    19 #define FEQT_INCLUDED_SRC_settings_editors_UIProcessorFeaturesEditor_h
     18#ifndef FEQT_INCLUDED_SRC_settings_editors_UIAccelerationFeaturesEditor_h
     19#define FEQT_INCLUDED_SRC_settings_editors_UIAccelerationFeaturesEditor_h
    2020#ifndef RT_WITHOUT_PRAGMA_ONCE
    2121# pragma once
     
    3030class QLabel;
    3131
    32 /** QWidget subclass used as processor features editor. */
    33 class SHARED_LIBRARY_STUFF UIProcessorFeaturesEditor : public QIWithRetranslateUI<QWidget>
     32/** QWidget subclass used as acceleration features editor. */
     33class SHARED_LIBRARY_STUFF UIAccelerationFeaturesEditor : public QIWithRetranslateUI<QWidget>
    3434{
    3535    Q_OBJECT;
     
    3737signals:
    3838
    39     /** Notifies listeners about PAE change. */
    40     void sigChangedPae();
    41     /** Notifies listeners about nested virtualization change. */
    42     void sigChangedNestedVirtualization();
     39    /** Notifies listeners about virtualization change. */
     40    void sigChangedVirtualization();
     41    /** Notifies listeners about nested paging change. */
     42    void sigChangedNestedPaging();
    4343
    4444public:
    4545
    4646    /** Constructs editor passing @a pParent to the base-class. */
    47     UIProcessorFeaturesEditor(QWidget *pParent = 0);
     47    UIAccelerationFeaturesEditor(QWidget *pParent = 0);
    4848
    49     /** Defines whether 'enable PAE' feature in @a fOn. */
    50     void setEnablePae(bool fOn);
    51     /** Returns 'enable PAE' feature value. */
    52     bool isEnabledPae() const;
    53     /** Defines whether 'enable PAE' option @a fAvailable. */
    54     void setEnablePaeAvailable(bool fAvailable);
     49    /** Defines whether 'enable virtualization' feature in @a fOn. */
     50    void setEnableVirtualization(bool fOn);
     51    /** Returns 'enable virtualization' feature value. */
     52    bool isEnabledVirtualization() const;
     53    /** Defines whether 'enable virtualization' option @a fAvailable. */
     54    void setEnableVirtualizationAvailable(bool fAvailable);
    5555
    56     /** Defines whether 'enable nested virtualization' feature in @a fOn. */
    57     void setEnableNestedVirtualization(bool fOn);
    58     /** Returns 'enable nested virtualization' feature value. */
    59     bool isEnabledNestedVirtualization() const;
    60     /** Defines whether 'enable nested virtualization' option @a fAvailable. */
    61     void setEnableNestedVirtualizationAvailable(bool fAvailable);
     56    /** Defines whether 'enable nested paging' feature in @a fOn. */
     57    void setEnableNestedPaging(bool fOn);
     58    /** Returns 'enable nested paging' feature value. */
     59    bool isEnabledNestedPaging() const;
     60    /** Defines whether 'enable nested paging' option @a fAvailable. */
     61    void setEnableNestedPagingAvailable(bool fAvailable);
    6262
    6363    /** Returns minimum layout hint. */
     
    7878    /** @name Values
    7979     * @{ */
    80         /** Holds the 'enable PAE' feature value. */
    81         bool  m_fEnablePae;
    82         /** Holds the 'enable nested virtualization' feature value. */
    83         bool  m_fEnableNestedVirtualization;
     80        /** Holds the 'enable virtualization' feature value. */
     81        bool  m_fEnableVirtualization;
     82        /** Holds the 'enable nested paging' feature value. */
     83        bool  m_fEnableNestedPaging;
    8484    /** @} */
    8585
     
    9090        /** Holds the label instance. */
    9191        QLabel      *m_pLabel;
    92         /** Holds the 'enable PAE' check-box instance. */
    93         QCheckBox   *m_pCheckBoxEnablePae;
    94         /** Holds the 'enable nested virtualization' check-box instance. */
    95         QCheckBox   *m_pCheckBoxEnableNestedVirtualization;
     92        /** Holds the 'enable virtualization' check-box instance. */
     93        QCheckBox   *m_pCheckBoxEnableVirtualization;
     94        /** Holds the 'enable nested paging' check-box instance. */
     95        QCheckBox   *m_pCheckBoxEnableNestedPaging;
    9696    /** @} */
    9797};
    9898
    99 #endif /* !FEQT_INCLUDED_SRC_settings_editors_UIProcessorFeaturesEditor_h */
     99#endif /* !FEQT_INCLUDED_SRC_settings_editors_UIAccelerationFeaturesEditor_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp

    r95213 r95222  
    1717
    1818/* Qt includes: */
    19 #include <QCheckBox>
    20 #include <QComboBox>
    21 #include <QLabel>
    2219#include <QVBoxLayout>
    2320
    2421/* GUI includes: */
    2522#include "QITabWidget.h"
     23#include "UIAccelerationFeaturesEditor.h"
    2624#include "UIBaseMemoryEditor.h"
    2725#include "UIBootOrderEditor.h"
    2826#include "UIChipsetEditor.h"
    2927#include "UICommon.h"
    30 #include "UIConverter.h"
     28//#include "UIConverter.h"
    3129#include "UIErrorString.h"
    3230#include "UIExecutionCapEditor.h"
     
    164162    , m_pTabAcceleration(0)
    165163    , m_pEditorParavirtProvider(0)
    166     , m_pLabelVirtualization(0)
    167     , m_pCheckBoxVirtualization(0)
    168     , m_pCheckBoxNestedPaging(0)
    169 {
    170     /* Prepare: */
     164    , m_pEditorAccelerationFeatures(0)
     165{
    171166    prepare();
    172167}
     
    174169UIMachineSettingsSystem::~UIMachineSettingsSystem()
    175170{
    176     /* Cleanup: */
    177171    cleanup();
    178172}
     
    186180bool UIMachineSettingsSystem::isHWVirtExEnabled() const
    187181{
    188     return m_pCheckBoxVirtualization->isChecked();
     182    return m_pEditorAccelerationFeatures->isEnabledVirtualization();
    189183}
    190184
     
    197191bool UIMachineSettingsSystem::isNestedPagingEnabled() const
    198192{
    199     return m_pCheckBoxNestedPaging->isChecked();
     193    return m_pEditorAccelerationFeatures->isEnabledNestedPaging();
    200194}
    201195
     
    326320    if (m_pEditorParavirtProvider)
    327321        m_pEditorParavirtProvider->setValue(oldSystemData.m_paravirtProvider);
    328     if (m_pCheckBoxVirtualization)
    329         m_pCheckBoxVirtualization->setChecked(oldSystemData.m_fEnabledHwVirtEx);
    330     if (m_pCheckBoxNestedPaging)
    331         m_pCheckBoxNestedPaging->setChecked(oldSystemData.m_fEnabledNestedPaging);
     322    if (m_pEditorAccelerationFeatures)
     323    {
     324        m_pEditorAccelerationFeatures->setEnableVirtualization(oldSystemData.m_fEnabledHwVirtEx);
     325        m_pEditorAccelerationFeatures->setEnableNestedPaging(oldSystemData.m_fEnabledNestedPaging);
     326    }
    332327
    333328    /* Polish page finally: */
     
    396391     * Nested HW Virt Ex is requested. */
    397392    newSystemData.m_fEnabledNestedPaging =    isNestedPagingEnabled()
    398                                      || (   isNestedPagingSupported()
    399                                          && isNestedHWVirtExEnabled());
     393                                           || (   isNestedPagingSupported()
     394                                               && isNestedHWVirtExEnabled());
    400395
    401396    /* Cache new data: */
     
    608603
    609604    /* Configure navigation for 'acceleration' tab: */
    610     setTabOrder(m_pEditorParavirtProvider, m_pCheckBoxVirtualization);
    611     setTabOrder(m_pCheckBoxVirtualization, m_pCheckBoxNestedPaging);
     605    setTabOrder(m_pEditorParavirtProvider, m_pEditorAccelerationFeatures);
    612606}
    613607
     
    621615    m_pTabWidget->setTabText(m_pTabWidget->indexOf(m_pTabMotherboard), tr("&Motherboard"));
    622616    m_pTabWidget->setTabText(m_pTabWidget->indexOf(m_pTabProcessor), tr("&Processor"));
    623     m_pLabelVirtualization->setText(tr("Hardware Virtualization:"));
    624     m_pCheckBoxVirtualization->setToolTip(tr("When checked, the virtual machine will try to make use of the host CPU's hardware "
    625                                              "virtualization extensions such as Intel VT-x and AMD-V."));
    626     m_pCheckBoxVirtualization->setText(tr("Enable &VT-x/AMD-V"));
    627     m_pCheckBoxNestedPaging->setToolTip(tr("When checked, the virtual machine will try to make use of the nested paging "
    628                                            "extension of Intel VT-x and AMD-V."));
    629     m_pCheckBoxNestedPaging->setText(tr("Enable Nested Pa&ging"));
    630617    m_pTabWidget->setTabText(m_pTabWidget->indexOf(m_pTabAcceleration), tr("Acce&leration"));
    631618
     
    649636    m_pEditorExecCap->setMinimumLayoutIndent(iMinimumLayoutHint);
    650637    m_pEditorProcessorFeatures->setMinimumLayoutIndent(iMinimumLayoutHint);
     638    iMinimumLayoutHint = 0;
     639    iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorParavirtProvider->minimumLabelHorizontalHint());
     640    iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorAccelerationFeatures->minimumLabelHorizontalHint());
     641    m_pEditorParavirtProvider->setMinimumLayoutIndent(iMinimumLayoutHint);
     642    m_pEditorAccelerationFeatures->setMinimumLayoutIndent(iMinimumLayoutHint);
    651643}
    652644
     
    673665    /* Polish 'Acceleration' availability: */
    674666    m_pEditorParavirtProvider->setEnabled(isMachineOffline());
    675     m_pLabelVirtualization->setEnabled(isMachineOffline());
    676     m_pCheckBoxVirtualization->setEnabled(   (systemData.m_fSupportedHwVirtEx && isMachineOffline())
    677                                           || (systemData.m_fEnabledHwVirtEx && isMachineOffline()));
    678     m_pCheckBoxNestedPaging->setEnabled(   m_pCheckBoxVirtualization->isChecked()
    679                                         && (   (systemData.m_fSupportedNestedPaging && isMachineOffline())
    680                                             || (systemData.m_fEnabledNestedPaging && isMachineOffline())));
     667    m_pEditorAccelerationFeatures->setEnabled(isMachineOffline());
     668    m_pEditorAccelerationFeatures->setEnableVirtualizationAvailable(   (systemData.m_fSupportedHwVirtEx && isMachineOffline())
     669                                                                    || (systemData.m_fEnabledHwVirtEx && isMachineOffline()));
     670    m_pEditorAccelerationFeatures->setEnableNestedPagingAvailable(   m_pEditorAccelerationFeatures->isEnabledVirtualization()
     671                                                                  && (   (systemData.m_fSupportedNestedPaging && isMachineOffline())
     672                                                                      || (systemData.m_fEnabledNestedPaging && isMachineOffline())));
    681673}
    682674
     
    685677    /* Update Nested Paging checkbox: */
    686678    AssertPtrReturnVoid(m_pCache);
    687     m_pCheckBoxNestedPaging->setEnabled(   m_pCheckBoxVirtualization->isChecked()
    688                                         && (   (m_pCache->base().m_fSupportedNestedPaging && isMachineOffline())
    689                                             || (m_pCache->base().m_fEnabledNestedPaging && isMachineOffline())));
     679    m_pEditorAccelerationFeatures->setEnableNestedPagingAvailable(   m_pEditorAccelerationFeatures->isEnabledVirtualization()
     680                                                                  && (   (m_pCache->base().m_fSupportedNestedPaging && isMachineOffline())
     681                                                                      || (m_pCache->base().m_fEnabledNestedPaging && isMachineOffline())));
    690682
    691683    /* Revalidate: */
     
    819811            m_pEditorParavirtProvider = new UIParavirtProviderEditor(m_pTabAcceleration);
    820812            if (m_pEditorParavirtProvider)
    821                 pLayoutAcceleration->addWidget(m_pEditorParavirtProvider, 0, 0, 1, 3);
    822 
    823             /* Prepare virtualization label layout: */
    824             QVBoxLayout *pLayoutVirtualizationLabel = new QVBoxLayout;
    825             if (pLayoutVirtualizationLabel)
    826             {
    827                 /* Prepare virtualization label: */
    828                 m_pLabelVirtualization = new QLabel(m_pTabAcceleration);
    829                 if (m_pLabelVirtualization)
    830                 {
    831                     m_pLabelVirtualization->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    832                     pLayoutVirtualizationLabel->addWidget(m_pLabelVirtualization);
    833                 }
    834                 /* Prepare placeholder: */
    835                 QWidget *pWidgetPlaceholder = new QWidget(m_pTabAcceleration);
    836                 if (pWidgetPlaceholder)
    837                 {
    838 #ifndef VBOX_WITH_RAW_MODE
    839                     /* Hide placeholder when raw-mode is not supported: */
    840                     pWidgetPlaceholder->setVisible(false);
    841 #endif
    842 
    843                     pLayoutVirtualizationLabel->addWidget(pWidgetPlaceholder);
    844                 }
    845 
    846                 pLayoutAcceleration->addLayout(pLayoutVirtualizationLabel, 1, 0);
    847             }
    848             /* Prepare virtualization stuff layout: */
    849             QVBoxLayout *pLayoutVirtualizationStuff = new QVBoxLayout;
    850             if (pLayoutVirtualizationStuff)
    851             {
    852                 /* Prepare virtualization check-box: */
    853                 m_pCheckBoxVirtualization = new QCheckBox(m_pTabAcceleration);
    854                 if (m_pCheckBoxVirtualization)
    855                 {
    856 #ifndef VBOX_WITH_RAW_MODE
    857                     /* Hide HW Virt Ex checkbox when raw-mode is not supported: */
    858                     m_pCheckBoxVirtualization->setVisible(false);
    859 #endif
    860 
    861                     pLayoutVirtualizationStuff->addWidget(m_pCheckBoxVirtualization);
    862                 }
    863                 /* Prepare nested paging check-box: */
    864                 m_pCheckBoxNestedPaging = new QCheckBox(m_pTabAcceleration);
    865                 if (m_pCheckBoxNestedPaging)
    866                     pLayoutVirtualizationStuff->addWidget(m_pCheckBoxNestedPaging);
    867 
    868                 pLayoutAcceleration->addLayout(pLayoutVirtualizationStuff, 1, 1);
    869             }
     813                pLayoutAcceleration->addWidget(m_pEditorParavirtProvider, 0, 0, 1, 2);
     814
     815            /* Prepare acceleration features editor: */
     816            m_pEditorAccelerationFeatures = new UIAccelerationFeaturesEditor(m_pTabAcceleration);
     817            if (m_pEditorAccelerationFeatures)
     818                pLayoutAcceleration->addWidget(m_pEditorAccelerationFeatures, 1, 0);
    870819
    871820            m_pTabWidget->addTab(m_pTabAcceleration, QString());
     
    895844
    896845    /* Configure 'Acceleration' connections: */
    897     connect(m_pCheckBoxVirtualization, &QCheckBox::stateChanged,
     846    connect(m_pEditorAccelerationFeatures, &UIAccelerationFeaturesEditor::sigChangedVirtualization,
    898847            this, &UIMachineSettingsSystem::sltHandleHwVirtExToggle);
    899     connect(m_pCheckBoxNestedPaging, &QCheckBox::stateChanged,
     848    connect(m_pEditorAccelerationFeatures, &UIAccelerationFeaturesEditor::sigChangedNestedPaging,
    900849            this, &UIMachineSettingsSystem::revalidate);
    901850}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h

    r95213 r95222  
    2828struct UIDataSettingsMachineSystem;
    2929typedef UISettingsCache<UIDataSettingsMachineSystem> UISettingsCacheMachineSystem;
    30 class QCheckBox;
    31 class QComboBox;
    32 class QLabel;
    3330class QITabWidget;
     31class UIAccelerationFeaturesEditor;
    3432class UIBaseMemoryEditor;
    3533class UIBootOrderEditor;
     
    174172
    175173        /** Holds the 'Acceleration' tab instance. */
    176         QWidget                  *m_pTabAcceleration;
     174        QWidget                      *m_pTabAcceleration;
    177175        /** Holds the paravirtualization provider editor instance. */
    178         UIParavirtProviderEditor *m_pEditorParavirtProvider;
    179         /** Holds the virtualization label instance. */
    180         QLabel                   *m_pLabelVirtualization;
    181         /** Holds the virtualization check-box instance. */
    182         QCheckBox                *m_pCheckBoxVirtualization;
    183         /** Holds the nested paging check-box instance. */
    184         QCheckBox                *m_pCheckBoxNestedPaging;
     176        UIParavirtProviderEditor     *m_pEditorParavirtProvider;
     177        /** Holds the acceleration features editor instance. */
     178        UIAccelerationFeaturesEditor *m_pEditorAccelerationFeatures;
    185179   /** @} */
    186180};
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