Changeset 95159 in vbox
- Timestamp:
- Jun 1, 2022 11:06:35 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 151655
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r95129 r95159 900 900 src/settings/editors/UIBaseMemoryEditor.h \ 901 901 src/settings/editors/UIBootOrderEditor.h \ 902 src/settings/editors/UIChipsetEditor.h \ 902 903 src/settings/editors/UIColorThemeEditor.h \ 903 904 src/settings/editors/UIDefaultMachineFolderEditor.h \ … … 1470 1471 src/settings/editors/UIBaseMemoryEditor.cpp \ 1471 1472 src/settings/editors/UIBootOrderEditor.cpp \ 1473 src/settings/editors/UIChipsetEditor.cpp \ 1472 1474 src/settings/editors/UIColorThemeEditor.cpp \ 1473 1475 src/settings/editors/UIDefaultMachineFolderEditor.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIChipsetEditor.cpp
r95156 r95159 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI SharedClipboardEditor class implementation.3 * VBox Qt GUI - UIChipsetEditor class implementation. 4 4 */ 5 5 … … 25 25 #include "UICommon.h" 26 26 #include "UIConverter.h" 27 #include "UI SharedClipboardEditor.h"27 #include "UIChipsetEditor.h" 28 28 29 29 /* COM includes: */ … … 31 31 32 32 33 UI SharedClipboardEditor::UISharedClipboardEditor(QWidget *pParent /* = 0 */)33 UIChipsetEditor::UIChipsetEditor(QWidget *pParent /* = 0 */) 34 34 : QIWithRetranslateUI<QWidget>(pParent) 35 , m_enmValue(KC lipboardMode_Max)35 , m_enmValue(KChipsetType_Max) 36 36 , m_pLabel(0) 37 37 , m_pCombo(0) … … 40 40 } 41 41 42 void UI SharedClipboardEditor::setValue(KClipboardMode enmValue)42 void UIChipsetEditor::setValue(KChipsetType enmValue) 43 43 { 44 44 /* Update cached value and … … 51 51 } 52 52 53 KC lipboardMode UISharedClipboardEditor::value() const53 KChipsetType UIChipsetEditor::value() const 54 54 { 55 return m_pCombo ? m_pCombo->currentData().value<KC lipboardMode>() : m_enmValue;55 return m_pCombo ? m_pCombo->currentData().value<KChipsetType>() : m_enmValue; 56 56 } 57 57 58 int UI SharedClipboardEditor::minimumLabelHorizontalHint() const58 int UIChipsetEditor::minimumLabelHorizontalHint() const 59 59 { 60 60 return m_pLabel ? m_pLabel->minimumSizeHint().width() : 0; 61 61 } 62 62 63 void UI SharedClipboardEditor::setMinimumLayoutIndent(int iIndent)63 void UIChipsetEditor::setMinimumLayoutIndent(int iIndent) 64 64 { 65 65 if (m_pLayout) … … 67 67 } 68 68 69 void UI SharedClipboardEditor::retranslateUi()69 void UIChipsetEditor::retranslateUi() 70 70 { 71 71 if (m_pLabel) 72 m_pLabel->setText(tr("& Shared Clipboard:"));72 m_pLabel->setText(tr("&Chipset:")); 73 73 if (m_pCombo) 74 74 { 75 75 for (int i = 0; i < m_pCombo->count(); ++i) 76 76 { 77 const KC lipboardMode enmType = m_pCombo->itemData(i).value<KClipboardMode>();77 const KChipsetType enmType = m_pCombo->itemData(i).value<KChipsetType>(); 78 78 m_pCombo->setItemText(i, gpConverter->toString(enmType)); 79 79 } 80 m_pCombo->setToolTip(tr("Holds which clipboard data will be copied between the guest and the host OS. " 81 "This feature requires Guest Additions to be installed in the guest OS.")); 80 m_pCombo->setToolTip(tr("Selects the chipset to be emulated in this virtual machine. Note that the ICH9 chipset " 81 "emulation is experimental and not recommended except for guest systems (such as Mac OS X) " 82 "which require it.")); 82 83 } 83 84 } 84 85 85 void UI SharedClipboardEditor::prepare()86 void UIChipsetEditor::prepare() 86 87 { 87 88 /* Create main layout: */ … … 111 112 if (m_pLabel) 112 113 m_pLabel->setBuddy(m_pCombo); 114 connect(m_pCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 115 this, &UIChipsetEditor::sigValueChanged); 113 116 pComboLayout->addWidget(m_pCombo); 114 117 } … … 129 132 } 130 133 131 void UI SharedClipboardEditor::populateCombo()134 void UIChipsetEditor::populateCombo() 132 135 { 133 136 if (m_pCombo) … … 136 139 m_pCombo->clear(); 137 140 138 /* Load currently supported audio driver types: */141 /* Load currently supported values: */ 139 142 CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties(); 140 m_supportedValues = comProperties.GetSupportedC lipboardModes();143 m_supportedValues = comProperties.GetSupportedChipsetTypes(); 141 144 142 145 /* Make sure requested value if sane is present as well: */ 143 if ( m_enmValue != KC lipboardMode_Max146 if ( m_enmValue != KChipsetType_Max 144 147 && !m_supportedValues.contains(m_enmValue)) 145 148 m_supportedValues.prepend(m_enmValue); 146 149 147 150 /* Update combo with all the supported values: */ 148 foreach (const KC lipboardMode &enmType, m_supportedValues)151 foreach (const KChipsetType &enmType, m_supportedValues) 149 152 m_pCombo->addItem(QString(), QVariant::fromValue(enmType)); 150 153 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIChipsetEditor.h
r95156 r95159 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI SharedClipboardEditor class declaration.3 * VBox Qt GUI - UIChipsetEditor class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_settings_editors_UI SharedClipboardEditor_h19 #define FEQT_INCLUDED_SRC_settings_editors_UI SharedClipboardEditor_h18 #ifndef FEQT_INCLUDED_SRC_settings_editors_UIChipsetEditor_h 19 #define FEQT_INCLUDED_SRC_settings_editors_UIChipsetEditor_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 37 37 class QLabel; 38 38 39 /** QWidget subclass used as a shared clipboardeditor. */40 class SHARED_LIBRARY_STUFF UI SharedClipboardEditor : public QIWithRetranslateUI<QWidget>39 /** QWidget subclass used as a chipset editor. */ 40 class SHARED_LIBRARY_STUFF UIChipsetEditor : public QIWithRetranslateUI<QWidget> 41 41 { 42 42 Q_OBJECT; 43 44 signals: 45 46 /** Notifies listeners about value change. */ 47 void sigValueChanged(); 43 48 44 49 public: 45 50 46 51 /** Constructs editor passing @a pParent to the base-class. */ 47 UI SharedClipboardEditor(QWidget *pParent = 0);52 UIChipsetEditor(QWidget *pParent = 0); 48 53 49 54 /** Defines editor @a enmValue. */ 50 void setValue(KC lipboardMode enmValue);55 void setValue(KChipsetType enmValue); 51 56 /** Returns editor value. */ 52 KC lipboardMode value() const;57 KChipsetType value() const; 53 58 54 59 /** Returns the vector of supported values. */ 55 QVector<KC lipboardMode> supportedValues() const { return m_supportedValues; }60 QVector<KChipsetType> supportedValues() const { return m_supportedValues; } 56 61 57 62 /** Returns minimum layout hint. */ … … 73 78 74 79 /** Holds the value to be selected. */ 75 KC lipboardMode m_enmValue;80 KChipsetType m_enmValue; 76 81 77 82 /** Holds the vector of supported values. */ 78 QVector<KC lipboardMode> m_supportedValues;83 QVector<KChipsetType> m_supportedValues; 79 84 80 85 /** Holds the main layout instance. */ … … 86 91 }; 87 92 88 #endif /* !FEQT_INCLUDED_SRC_settings_editors_UI SharedClipboardEditor_h */93 #endif /* !FEQT_INCLUDED_SRC_settings_editors_UIChipsetEditor_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r94667 r95159 30 30 #include "UIBaseMemoryEditor.h" 31 31 #include "UIBootOrderEditor.h" 32 #include "UIChipsetEditor.h" 32 33 #include "UICommon.h" 33 34 #include "UIConverter.h" … … 160 161 , m_pLabelBootOrder(0) 161 162 , m_pEditorBootOrder(0) 162 , m_pLabelChipset(0) 163 , m_pComboChipset(0) 163 , m_pEditorChipset(0) 164 164 , m_pLabelPointingHID(0) 165 165 , m_pComboPointingHID(0) … … 239 239 KChipsetType UIMachineSettingsSystem::chipsetType() const 240 240 { 241 return m_p ComboChipset->currentData().value<KChipsetType>();241 return m_pEditorChipset->value(); 242 242 } 243 243 … … 319 319 /* We are doing that *now* because these combos have 320 320 * dynamical content which depends on cashed value: */ 321 repopulateComboChipsetType();322 321 repopulateComboPointingHIDType(); 323 322 repopulateComboParavirtProviderType(); … … 328 327 if (m_pEditorBootOrder) 329 328 m_pEditorBootOrder->setValue(oldSystemData.m_bootItems); 330 if (m_pComboChipset) 331 { 332 const int iChipsetTypePosition = m_pComboChipset->findData(oldSystemData.m_chipsetType); 333 m_pComboChipset->setCurrentIndex(iChipsetTypePosition == -1 ? 0 : iChipsetTypePosition); 334 } 329 if (m_pEditorChipset) 330 m_pEditorChipset->setValue(oldSystemData.m_chipsetType); 335 331 if (m_pComboPointingHID) 336 332 { … … 393 389 if (m_pEditorBootOrder) 394 390 newSystemData.m_bootItems = m_pEditorBootOrder->value(); 395 if (m_p ComboChipset)396 newSystemData.m_chipsetType = m_p ComboChipset->currentData().value<KChipsetType>();391 if (m_pEditorChipset) 392 newSystemData.m_chipsetType = m_pEditorChipset->value(); 397 393 if (m_pComboPointingHID) 398 394 newSystemData.m_pointingHIDType = m_pComboPointingHID->currentData().value<KPointingHIDType>(); 399 395 if ( m_pCheckBoxAPIC 400 396 && m_pSliderProcessorCount 401 && m_p ComboChipset)397 && m_pEditorChipset) 402 398 newSystemData.m_fEnabledIoApic = m_pCheckBoxAPIC->isChecked() 403 399 || m_pSliderProcessorCount->value() > 1 404 || m_p ComboChipset->currentData().value<KChipsetType>() == KChipsetType_ICH9;400 || m_pEditorChipset->value() == KChipsetType_ICH9; 405 401 if (m_pCheckBoxEFI) 406 402 newSystemData.m_fEnabledEFI = m_pCheckBoxEFI->isChecked(); … … 482 478 483 479 /* Chipset type vs IO-APIC test: */ 484 if (m_p ComboChipset->currentData().value<KChipsetType>() == KChipsetType_ICH9 && !m_pCheckBoxAPIC->isChecked())480 if (m_pEditorChipset->value() == KChipsetType_ICH9 && !m_pCheckBoxAPIC->isChecked()) 485 481 { 486 482 message.second << tr( … … 632 628 setTabOrder(m_pTabWidget->focusProxy(), m_pEditorBaseMemory); 633 629 setTabOrder(m_pEditorBaseMemory, m_pEditorBootOrder); 634 setTabOrder(m_pEditorBootOrder, m_p ComboChipset);635 setTabOrder(m_p ComboChipset, m_pComboPointingHID);630 setTabOrder(m_pEditorBootOrder, m_pEditorChipset); 631 setTabOrder(m_pEditorChipset, m_pComboPointingHID); 636 632 setTabOrder(m_pComboPointingHID, m_pCheckBoxAPIC); 637 633 setTabOrder(m_pCheckBoxAPIC, m_pCheckBoxEFI); … … 661 657 "checkboxes on the left to enable or disable individual boot devices. " 662 658 "Move items up and down to change the device order.")); 663 m_pLabelChipset->setText(tr("&Chipset:"));664 m_pComboChipset->setToolTip(tr("Selects the chipset to be emulated in this virtual machine. Note that the ICH9 chipset "665 "emulation is experimental and not recommended except for guest systems (such as Mac OS X) "666 "which require it."));667 659 m_pLabelPointingHID->setText(tr("&Pointing Device:")); 668 660 m_pComboPointingHID->setToolTip(tr("Determines whether the emulated pointing device is a standard PS/2 mouse, " … … 725 717 726 718 /* Retranslate combo-boxes: */ 727 retranslateComboChipsetType();728 719 retranslateComboPointingHIDType(); 729 720 retranslateComboParavirtProvider(); 721 722 /* These editors have own labels, but we want them to be properly layouted according to each other: */ 723 int iMinimumLayoutHint = 0; 724 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pLabelBaseMemory->minimumSizeHint().width()); 725 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pLabelBootOrder->minimumSizeHint().width()); 726 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorChipset->minimumLabelHorizontalHint()); 727 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pLabelPointingHID->minimumSizeHint().width()); 728 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pLabelExtendedMotherboard->minimumSizeHint().width()); 729 m_pEditorChipset->setMinimumLayoutIndent(iMinimumLayoutHint); 730 730 } 731 731 … … 740 740 m_pLabelBootOrder->setEnabled(isMachineOffline()); 741 741 m_pEditorBootOrder->setEnabled(isMachineOffline()); 742 m_pLabelChipset->setEnabled(isMachineOffline()); 743 m_pComboChipset->setEnabled(isMachineOffline()); 742 m_pEditorChipset->setEnabled(isMachineOffline()); 744 743 m_pLabelPointingHID->setEnabled(isMachineOffline()); 745 744 m_pComboPointingHID->setEnabled(isMachineOffline()); … … 915 914 } 916 915 917 /* Prepare chipset label: */ 918 m_pLabelChipset = new QLabel(m_pTabMotherboard); 919 if (m_pLabelChipset) 920 { 921 m_pLabelChipset->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 922 pLayoutMotherboard->addWidget(m_pLabelChipset, 4, 0); 923 } 924 /* Prepare chipset combo: */ 925 m_pComboChipset = new QComboBox(m_pTabMotherboard); 926 if (m_pComboChipset) 927 { 928 if (m_pLabelChipset) 929 m_pLabelChipset->setBuddy(m_pComboChipset); 930 m_pComboChipset->setSizeAdjustPolicy(QComboBox::AdjustToContents); 931 m_pComboChipset->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); 932 933 pLayoutMotherboard->addWidget(m_pComboChipset, 4, 1); 934 } 916 /* Prepare chipset editor: */ 917 m_pEditorChipset = new UIChipsetEditor(m_pTabMotherboard); 918 if (m_pEditorChipset) 919 pLayoutMotherboard->addWidget(m_pEditorChipset, 4, 0, 1, 2); 935 920 936 921 /* Prepare pointing HID label: */ … … 1238 1223 { 1239 1224 /* Configure 'Motherboard' connections: */ 1240 connect(m_p ComboChipset, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),1225 connect(m_pEditorChipset, &UIChipsetEditor::sigValueChanged, 1241 1226 this, &UIMachineSettingsSystem::revalidate); 1242 1227 connect(m_pComboPointingHID, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), … … 1268 1253 } 1269 1254 1270 void UIMachineSettingsSystem::repopulateComboChipsetType()1271 {1272 AssertPtrReturnVoid(m_pComboChipset);1273 {1274 /* Clear combo first of all: */1275 m_pComboChipset->clear();1276 1277 /* Load currently supported chipset types: */1278 CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties();1279 QVector<KChipsetType> chipsetTypes = comProperties.GetSupportedChipsetTypes();1280 /* Take into account currently cached value: */1281 const KChipsetType enmCachedValue = m_pCache->base().m_chipsetType;1282 if (!chipsetTypes.contains(enmCachedValue))1283 chipsetTypes.prepend(enmCachedValue);1284 1285 /* Populate combo finally: */1286 foreach (const KChipsetType &enmType, chipsetTypes)1287 m_pComboChipset->addItem(gpConverter->toString(enmType), QVariant::fromValue(enmType));1288 }1289 }1290 1291 1255 void UIMachineSettingsSystem::repopulateComboPointingHIDType() 1292 1256 { … … 1328 1292 foreach (const KParavirtProvider &enmProvider, supportedProviderTypes) 1329 1293 m_pComboParavirtProvider->addItem(gpConverter->toString(enmProvider), QVariant::fromValue(enmProvider)); 1330 }1331 }1332 1333 void UIMachineSettingsSystem::retranslateComboChipsetType()1334 {1335 /* For each the element in m_pComboChipset: */1336 for (int iIndex = 0; iIndex < m_pComboChipset->count(); ++iIndex)1337 {1338 /* Apply retranslated text: */1339 const KChipsetType enmType = m_pComboChipset->currentData().value<KChipsetType>();1340 m_pComboChipset->setItemText(iIndex, gpConverter->toString(enmType));1341 1294 } 1342 1295 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r94333 r95159 37 37 class UIBaseMemoryEditor; 38 38 class UIBootOrderEditor; 39 class UIChipsetEditor; 39 40 40 41 /** Machine settings: System page. */ … … 136 137 void cleanup(); 137 138 138 /** Repopulates Chipset type combo-box. */139 void repopulateComboChipsetType();140 139 /** Repopulates Pointing HID type combo-box. */ 141 140 void repopulateComboPointingHIDType(); … … 143 142 void repopulateComboParavirtProviderType(); 144 143 145 /** Retranslates Chipset type combo-box. */146 void retranslateComboChipsetType();147 144 /** Retranslates Pointing HID type combo-box. */ 148 145 void retranslateComboPointingHIDType(); … … 191 188 /** Holds the boot order editor instance. */ 192 189 UIBootOrderEditor *m_pEditorBootOrder; 193 /** Holds the chipset label instance. */ 194 QLabel *m_pLabelChipset; 195 /** Holds the chipset combo instance. */ 196 QComboBox *m_pComboChipset; 190 /** Holds the chipset editor instance. */ 191 UIChipsetEditor *m_pEditorChipset; 197 192 /** Holds the pointing HID label instance. */ 198 193 QLabel *m_pLabelPointingHID;
Note:
See TracChangeset
for help on using the changeset viewer.