Changeset 95213 in vbox
- Timestamp:
- Jun 7, 2022 11:52:15 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 151723
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r95175 r95213 922 922 src/settings/editors/UINetworkFeaturesEditor.h \ 923 923 src/settings/editors/UINetworkSettingsEditor.h \ 924 src/settings/editors/UIParavirtProviderEditor.h \ 924 925 src/settings/editors/UIPointingHIDEditor.h \ 925 926 src/settings/editors/UIProcessorFeaturesEditor.h \ … … 1497 1498 src/settings/editors/UINetworkFeaturesEditor.cpp \ 1498 1499 src/settings/editors/UINetworkSettingsEditor.cpp \ 1500 src/settings/editors/UIParavirtProviderEditor.cpp \ 1499 1501 src/settings/editors/UIPointingHIDEditor.cpp \ 1500 1502 src/settings/editors/UIProcessorFeaturesEditor.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIParavirtProviderEditor.cpp
r95212 r95213 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI AudioControllerEditor class implementation.3 * VBox Qt GUI - UIParavirtProviderEditor class implementation. 4 4 */ 5 5 … … 25 25 #include "UICommon.h" 26 26 #include "UIConverter.h" 27 #include "UI AudioControllerEditor.h"27 #include "UIParavirtProviderEditor.h" 28 28 29 29 /* COM includes: */ … … 31 31 32 32 33 UI AudioControllerEditor::UIAudioControllerEditor(QWidget *pParent /* = 0 */)33 UIParavirtProviderEditor::UIParavirtProviderEditor(QWidget *pParent /* = 0 */) 34 34 : QIWithRetranslateUI<QWidget>(pParent) 35 , m_enmValue(K AudioControllerType_Max)35 , m_enmValue(KParavirtProvider_Max) 36 36 , m_pLabel(0) 37 37 , m_pCombo(0) … … 40 40 } 41 41 42 void UI AudioControllerEditor::setValue(KAudioControllerTypeenmValue)42 void UIParavirtProviderEditor::setValue(KParavirtProvider enmValue) 43 43 { 44 44 /* Update cached value and … … 51 51 } 52 52 53 K AudioControllerType UIAudioControllerEditor::value() const53 KParavirtProvider UIParavirtProviderEditor::value() const 54 54 { 55 return m_pCombo ? m_pCombo->currentData().value<K AudioControllerType>() : m_enmValue;55 return m_pCombo ? m_pCombo->currentData().value<KParavirtProvider>() : m_enmValue; 56 56 } 57 57 58 int UI AudioControllerEditor::minimumLabelHorizontalHint() const58 int UIParavirtProviderEditor::minimumLabelHorizontalHint() const 59 59 { 60 60 return m_pLabel ? m_pLabel->minimumSizeHint().width() : 0; 61 61 } 62 62 63 void UI AudioControllerEditor::setMinimumLayoutIndent(int iIndent)63 void UIParavirtProviderEditor::setMinimumLayoutIndent(int iIndent) 64 64 { 65 65 if (m_pLayout) … … 67 67 } 68 68 69 void UI AudioControllerEditor::retranslateUi()69 void UIParavirtProviderEditor::retranslateUi() 70 70 { 71 71 if (m_pLabel) 72 m_pLabel->setText(tr(" Audio &Controller:"));72 m_pLabel->setText(tr("&Paravirtualization Interface:")); 73 73 if (m_pCombo) 74 74 { 75 75 for (int i = 0; i < m_pCombo->count(); ++i) 76 76 { 77 const K AudioControllerType enmType = m_pCombo->itemData(i).value<KAudioControllerType>();77 const KParavirtProvider enmType = m_pCombo->itemData(i).value<KParavirtProvider>(); 78 78 m_pCombo->setItemText(i, gpConverter->toString(enmType)); 79 79 } 80 m_pCombo->setToolTip(tr("Selects the type of the virtual sound card. Depending on this value,"81 " VirtualBox will provide different audio hardware to thevirtual machine."));80 m_pCombo->setToolTip(tr("Selects the paravirtualization guest interface " 81 "provider to be used by this virtual machine.")); 82 82 } 83 83 } 84 84 85 void UI AudioControllerEditor::prepare()85 void UIParavirtProviderEditor::prepare() 86 86 { 87 87 /* Create main layout: */ … … 129 129 } 130 130 131 void UI AudioControllerEditor::populateCombo()131 void UIParavirtProviderEditor::populateCombo() 132 132 { 133 133 if (m_pCombo) … … 136 136 m_pCombo->clear(); 137 137 138 /* Load currently supported audio driver types: */138 /* Load currently supported paravirt provider types: */ 139 139 CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties(); 140 m_supportedValues = comProperties.GetSupported AudioControllerTypes();140 m_supportedValues = comProperties.GetSupportedParavirtProviders(); 141 141 142 142 /* Make sure requested value if sane is present as well: */ 143 if ( m_enmValue != K AudioControllerType_Max143 if ( m_enmValue != KParavirtProvider_Max 144 144 && !m_supportedValues.contains(m_enmValue)) 145 145 m_supportedValues.prepend(m_enmValue); 146 146 147 147 /* Update combo with all the supported values: */ 148 foreach (const K AudioControllerType&enmType, m_supportedValues)148 foreach (const KParavirtProvider &enmType, m_supportedValues) 149 149 m_pCombo->addItem(QString(), QVariant::fromValue(enmType)); 150 150 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIParavirtProviderEditor.h
r95212 r95213 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI AudioControllerEditor class declaration.3 * VBox Qt GUI - UIParavirtProviderEditor class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_settings_editors_UI AudioControllerEditor_h19 #define FEQT_INCLUDED_SRC_settings_editors_UI AudioControllerEditor_h18 #ifndef FEQT_INCLUDED_SRC_settings_editors_UIParavirtProviderEditor_h 19 #define FEQT_INCLUDED_SRC_settings_editors_UIParavirtProviderEditor_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 37 37 class QLabel; 38 38 39 /** QWidget subclass used as an audio controller editor. */40 class SHARED_LIBRARY_STUFF UI AudioControllerEditor : public QIWithRetranslateUI<QWidget>39 /** QWidget subclass used as an paravirtualization provider editor. */ 40 class SHARED_LIBRARY_STUFF UIParavirtProviderEditor : public QIWithRetranslateUI<QWidget> 41 41 { 42 42 Q_OBJECT; … … 45 45 46 46 /** Constructs editor passing @a pParent to the base-class. */ 47 UI AudioControllerEditor(QWidget *pParent = 0);47 UIParavirtProviderEditor(QWidget *pParent = 0); 48 48 49 49 /** Defines editor @a enmValue. */ 50 void setValue(K AudioControllerTypeenmValue);50 void setValue(KParavirtProvider enmValue); 51 51 /** Returns editor value. */ 52 K AudioControllerTypevalue() const;52 KParavirtProvider value() const; 53 53 54 54 /** Returns the vector of supported values. */ 55 QVector<K AudioControllerType> supportedValues() const { return m_supportedValues; }55 QVector<KParavirtProvider> supportedValues() const { return m_supportedValues; } 56 56 57 57 /** Returns minimum layout hint. */ … … 73 73 74 74 /** Holds the value to be selected. */ 75 K AudioControllerTypem_enmValue;75 KParavirtProvider m_enmValue; 76 76 77 77 /** Holds the vector of supported values. */ 78 QVector<K AudioControllerType> m_supportedValues;78 QVector<KParavirtProvider> m_supportedValues; 79 79 80 80 /** Holds the main layout instance. */ … … 86 86 }; 87 87 88 #endif /* !FEQT_INCLUDED_SRC_settings_editors_UI AudioControllerEditor_h */88 #endif /* !FEQT_INCLUDED_SRC_settings_editors_UIParavirtProviderEditor_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r95175 r95213 33 33 #include "UIMachineSettingsSystem.h" 34 34 #include "UIMotherboardFeaturesEditor.h" 35 #include "UIParavirtProviderEditor.h" 35 36 #include "UIPointingHIDEditor.h" 36 37 #include "UIProcessorFeaturesEditor.h" … … 162 163 , m_pEditorProcessorFeatures(0) 163 164 , m_pTabAcceleration(0) 164 , m_pLabelParavirtProvider(0) 165 , m_pComboParavirtProvider(0) 165 , m_pEditorParavirtProvider(0) 166 166 , m_pLabelVirtualization(0) 167 167 , m_pCheckBoxVirtualization(0) … … 295 295 /* Get old data from cache: */ 296 296 const UIDataSettingsMachineSystem &oldSystemData = m_pCache->base(); 297 298 /* We are doing that *now* because these combos have299 * dynamical content which depends on cashed value: */300 repopulateComboParavirtProviderType();301 297 302 298 /* Load old 'Motherboard' data from cache: */ … … 328 324 329 325 /* Load old 'Acceleration' data from cache: */ 330 if (m_pComboParavirtProvider) 331 { 332 const int iParavirtProviderPosition = m_pComboParavirtProvider->findData(oldSystemData.m_paravirtProvider); 333 m_pComboParavirtProvider->setCurrentIndex(iParavirtProviderPosition == -1 ? 0 : iParavirtProviderPosition); 334 } 326 if (m_pEditorParavirtProvider) 327 m_pEditorParavirtProvider->setValue(oldSystemData.m_paravirtProvider); 335 328 if (m_pCheckBoxVirtualization) 336 329 m_pCheckBoxVirtualization->setChecked(oldSystemData.m_fEnabledHwVirtEx); … … 390 383 391 384 /* Gather 'Acceleration' data: */ 392 if (m_p ComboParavirtProvider)393 newSystemData.m_paravirtProvider = m_p ComboParavirtProvider->currentData().value<KParavirtProvider>();385 if (m_pEditorParavirtProvider) 386 newSystemData.m_paravirtProvider = m_pEditorParavirtProvider->value(); 394 387 /* Enable HW Virt Ex automatically if it's supported and 395 388 * 1. multiple CPUs, 2. Nested Paging or 3. Nested HW Virt Ex is requested. */ … … 612 605 setTabOrder(m_pEditorVCPU, m_pEditorExecCap); 613 606 setTabOrder(m_pEditorExecCap, m_pEditorProcessorFeatures); 614 setTabOrder(m_pEditorProcessorFeatures, m_p ComboParavirtProvider);607 setTabOrder(m_pEditorProcessorFeatures, m_pEditorParavirtProvider); 615 608 616 609 /* Configure navigation for 'acceleration' tab: */ 617 setTabOrder(m_p ComboParavirtProvider, m_pCheckBoxVirtualization);610 setTabOrder(m_pEditorParavirtProvider, m_pCheckBoxVirtualization); 618 611 setTabOrder(m_pCheckBoxVirtualization, m_pCheckBoxNestedPaging); 619 612 } … … 628 621 m_pTabWidget->setTabText(m_pTabWidget->indexOf(m_pTabMotherboard), tr("&Motherboard")); 629 622 m_pTabWidget->setTabText(m_pTabWidget->indexOf(m_pTabProcessor), tr("&Processor")); 630 m_pLabelParavirtProvider->setText(tr("&Paravirtualization Interface:"));631 m_pComboParavirtProvider->setToolTip(tr("Selects the paravirtualization guest interface provider to be used by this "632 "virtual machine."));633 623 m_pLabelVirtualization->setText(tr("Hardware Virtualization:")); 634 624 m_pCheckBoxVirtualization->setToolTip(tr("When checked, the virtual machine will try to make use of the host CPU's hardware " … … 639 629 m_pCheckBoxNestedPaging->setText(tr("Enable Nested Pa&ging")); 640 630 m_pTabWidget->setTabText(m_pTabWidget->indexOf(m_pTabAcceleration), tr("Acce&leration")); 641 642 /* Retranslate combo-boxes: */643 retranslateComboParavirtProvider();644 631 645 632 /* These editors have own labels, but we want them to be properly layouted according to each other: */ … … 685 672 686 673 /* Polish 'Acceleration' availability: */ 674 m_pEditorParavirtProvider->setEnabled(isMachineOffline()); 675 m_pLabelVirtualization->setEnabled(isMachineOffline()); 687 676 m_pCheckBoxVirtualization->setEnabled( (systemData.m_fSupportedHwVirtEx && isMachineOffline()) 688 677 || (systemData.m_fEnabledHwVirtEx && isMachineOffline())); … … 690 679 && ( (systemData.m_fSupportedNestedPaging && isMachineOffline()) 691 680 || (systemData.m_fEnabledNestedPaging && isMachineOffline()))); 692 m_pLabelParavirtProvider->setEnabled(isMachineOffline());693 m_pComboParavirtProvider->setEnabled(isMachineOffline());694 m_pLabelVirtualization->setEnabled(isMachineOffline());695 681 } 696 682 … … 830 816 pLayoutAcceleration->setRowStretch(3, 1); 831 817 832 /* Prepare paravirtualization provider label: */ 833 m_pLabelParavirtProvider = new QLabel(m_pTabAcceleration); 834 if (m_pLabelParavirtProvider) 835 { 836 m_pLabelParavirtProvider->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 837 pLayoutAcceleration->addWidget(m_pLabelParavirtProvider, 0, 0); 838 } 839 /* Prepare paravirtualization provider combo: */ 840 m_pComboParavirtProvider = new QComboBox(m_pTabAcceleration); 841 if (m_pComboParavirtProvider) 842 { 843 if (m_pLabelParavirtProvider) 844 m_pLabelParavirtProvider->setBuddy(m_pComboParavirtProvider); 845 m_pComboParavirtProvider->setSizeAdjustPolicy(QComboBox::AdjustToContents); 846 m_pComboParavirtProvider->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); 847 848 pLayoutAcceleration->addWidget(m_pComboParavirtProvider, 0, 1, 1, 2); 849 } 818 /* Prepare paravirtualization provider editor: */ 819 m_pEditorParavirtProvider = new UIParavirtProviderEditor(m_pTabAcceleration); 820 if (m_pEditorParavirtProvider) 821 pLayoutAcceleration->addWidget(m_pEditorParavirtProvider, 0, 0, 1, 3); 850 822 851 823 /* Prepare virtualization label layout: */ … … 936 908 } 937 909 938 void UIMachineSettingsSystem::repopulateComboParavirtProviderType()939 {940 AssertPtrReturnVoid(m_pComboParavirtProvider);941 {942 /* Clear combo first of all: */943 m_pComboParavirtProvider->clear();944 945 /* Load currently supported paravirtualization provider types: */946 CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties();947 QVector<KParavirtProvider> supportedProviderTypes = comProperties.GetSupportedParavirtProviders();948 /* Take into account currently cached value: */949 const KParavirtProvider enmCachedValue = m_pCache->base().m_paravirtProvider;950 if (!supportedProviderTypes.contains(enmCachedValue))951 supportedProviderTypes.prepend(enmCachedValue);952 953 /* Populate combo finally: */954 foreach (const KParavirtProvider &enmProvider, supportedProviderTypes)955 m_pComboParavirtProvider->addItem(gpConverter->toString(enmProvider), QVariant::fromValue(enmProvider));956 }957 }958 959 void UIMachineSettingsSystem::retranslateComboParavirtProvider()960 {961 /* For each the element in m_pComboParavirtProvider: */962 for (int iIndex = 0; iIndex < m_pComboParavirtProvider->count(); ++iIndex)963 {964 /* Apply retranslated text: */965 const KParavirtProvider enmType = m_pComboParavirtProvider->currentData().value<KParavirtProvider>();966 m_pComboParavirtProvider->setItemText(iIndex, gpConverter->toString(enmType));967 }968 }969 970 910 bool UIMachineSettingsSystem::saveData() 971 911 { -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r95175 r95213 37 37 class UIExecutionCapEditor; 38 38 class UIMotherboardFeaturesEditor; 39 class UIParavirtProviderEditor; 39 40 class UIPointingHIDEditor; 40 41 class UIProcessorFeaturesEditor; … … 130 131 void cleanup(); 131 132 132 /** Repopulates Paravirtualization Provider type combo-box. */133 void repopulateComboParavirtProviderType();134 135 /** Retranslates Paravirtualization providers combo-box. */136 void retranslateComboParavirtProvider();137 138 133 /** Saves existing data from cache. */ 139 134 bool saveData(); … … 179 174 180 175 /** Holds the 'Acceleration' tab instance. */ 181 QWidget *m_pTabAcceleration; 182 /** Holds the paravirtualization provider label instance. */ 183 QLabel *m_pLabelParavirtProvider; 184 /** Holds the paravirtualization provider combo instance. */ 185 QComboBox *m_pComboParavirtProvider; 176 QWidget *m_pTabAcceleration; 177 /** Holds the paravirtualization provider editor instance. */ 178 UIParavirtProviderEditor *m_pEditorParavirtProvider; 186 179 /** Holds the virtualization label instance. */ 187 QLabel *m_pLabelVirtualization;180 QLabel *m_pLabelVirtualization; 188 181 /** Holds the virtualization check-box instance. */ 189 QCheckBox *m_pCheckBoxVirtualization;182 QCheckBox *m_pCheckBoxVirtualization; 190 183 /** Holds the nested paging check-box instance. */ 191 QCheckBox *m_pCheckBoxNestedPaging;184 QCheckBox *m_pCheckBoxNestedPaging; 192 185 /** @} */ 193 186 };
Note:
See TracChangeset
for help on using the changeset viewer.