Changeset 82549 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Dec 11, 2019 2:12:14 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageExpert.cpp
r76606 r82549 16 16 */ 17 17 18 /* Globalincludes: */18 /* Qt includes: */ 19 19 #include <QButtonGroup> 20 20 #include <QCheckBox> … … 24 24 #include <QRadioButton> 25 25 26 /* Localincludes: */26 /* GUI includes: */ 27 27 #include "QILineEdit.h" 28 #include "UICommon.h" 28 29 #include "UIFilePathSelector.h" 29 30 #include "UIWizardCloneVMPageExpert.h" 30 31 #include "UIWizardCloneVM.h" 32 33 /* COM includes: */ 34 #include "CSystemProperties.h" 31 35 32 36 … … 134 138 m_pCloneOptionsLayout->addWidget(m_pMACComboBoxLabel, 0, 0, 1, 1); 135 139 } 136 m_pAdditionalOptionsLabel = new QLabel; 137 if (m_pAdditionalOptionsLabel) 138 { 139 m_pAdditionalOptionsLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 140 m_pCloneOptionsLayout->addWidget(m_pAdditionalOptionsLabel, 3, 0, 1, 1); 141 } 142 m_pKeepDiskNamesCheckBox = new QCheckBox; 143 if (m_pKeepDiskNamesCheckBox) 144 m_pCloneOptionsLayout->addWidget(m_pKeepDiskNamesCheckBox, 3, 1, 1, 1); 145 m_pKeepHWUUIDsCheckBox = new QCheckBox; 146 if (m_pKeepHWUUIDsCheckBox) 147 m_pCloneOptionsLayout->addWidget(m_pKeepHWUUIDsCheckBox, 4, 1, 1, 1); 148 140 141 /* Load currently supported clone options: */ 142 CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties(); 143 const QVector<KCloneOptions> supportedOptions = comProperties.GetSupportedCloneOptions(); 144 /* Check whether we support additional clone options at all: */ 145 int iVerticalPosition = 3; 146 const bool fSupportedKeepDiskNames = supportedOptions.contains(KCloneOptions_KeepDiskNames); 147 const bool fSupportedKeepHWUUIDs = supportedOptions.contains(KCloneOptions_KeepHwUUIDs); 148 if (fSupportedKeepDiskNames || fSupportedKeepHWUUIDs) 149 { 150 m_pAdditionalOptionsLabel = new QLabel; 151 if (m_pAdditionalOptionsLabel) 152 { 153 m_pAdditionalOptionsLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 154 m_pCloneOptionsLayout->addWidget(m_pAdditionalOptionsLabel, iVerticalPosition, 0, 1, 1); 155 } 156 } 157 if (fSupportedKeepDiskNames) 158 { 159 m_pKeepDiskNamesCheckBox = new QCheckBox; 160 if (m_pKeepDiskNamesCheckBox) 161 m_pCloneOptionsLayout->addWidget(m_pKeepDiskNamesCheckBox, iVerticalPosition++, 1, 1, 1); 162 } 163 if (fSupportedKeepHWUUIDs) 164 { 165 m_pKeepHWUUIDsCheckBox = new QCheckBox; 166 if (m_pKeepHWUUIDsCheckBox) 167 m_pCloneOptionsLayout->addWidget(m_pKeepHWUUIDsCheckBox, iVerticalPosition++, 1, 1, 1); 168 } 149 169 } 150 170 … … 216 236 /* Translate MAC address policy combo-box: */ 217 237 m_pMACComboBoxLabel->setText(UIWizardCloneVM::tr("MAC Address &Policy:")); 218 m_pMACComboBox->setItemText(MACAddressClonePolicy_KeepAllMACs, 219 UIWizardCloneVM::tr("Include all network adapter MAC addresses")); 220 m_pMACComboBox->setItemText(MACAddressClonePolicy_KeepNATMACs, 221 UIWizardCloneVM::tr("Include only NAT network adapter MAC addresses")); 222 m_pMACComboBox->setItemText(MACAddressClonePolicy_StripAllMACs, 223 UIWizardCloneVM::tr("Generate new MAC addresses for all network adapters")); 224 m_pMACComboBox->setItemData(MACAddressClonePolicy_KeepAllMACs, 225 UIWizardCloneVM::tr("Include all network adapter MAC addresses during cloning."), Qt::ToolTipRole); 226 m_pMACComboBox->setItemData(MACAddressClonePolicy_KeepNATMACs, 227 UIWizardCloneVM::tr("Include only NAT network adapter MAC addresses during cloning."), Qt::ToolTipRole); 228 m_pMACComboBox->setItemData(MACAddressClonePolicy_StripAllMACs, 229 UIWizardCloneVM::tr("Generate new MAC addresses for all network adapters during cloning."), Qt::ToolTipRole); 238 for (int i = 0; i < m_pMACComboBox->count(); ++i) 239 { 240 const MACAddressClonePolicy enmPolicy = m_pMACComboBox->itemData(i).value<MACAddressClonePolicy>(); 241 switch (enmPolicy) 242 { 243 case MACAddressClonePolicy_KeepAllMACs: 244 { 245 m_pMACComboBox->setItemText(i, UIWizardCloneVM::tr("Include all network adapter MAC addresses")); 246 m_pMACComboBox->setItemData(i, UIWizardCloneVM::tr("Include all network adapter MAC addresses during cloning."), Qt::ToolTipRole); 247 break; 248 } 249 case MACAddressClonePolicy_KeepNATMACs: 250 { 251 m_pMACComboBox->setItemText(i, UIWizardCloneVM::tr("Include only NAT network adapter MAC addresses")); 252 m_pMACComboBox->setItemData(i, UIWizardCloneVM::tr("Include only NAT network adapter MAC addresses during cloning."), Qt::ToolTipRole); 253 break; 254 } 255 case MACAddressClonePolicy_StripAllMACs: 256 { 257 m_pMACComboBox->setItemText(i, UIWizardCloneVM::tr("Generate new MAC addresses for all network adapters")); 258 m_pMACComboBox->setItemData(i, UIWizardCloneVM::tr("Generate new MAC addresses for all network adapters during cloning."), Qt::ToolTipRole); 259 break; 260 } 261 default: 262 break; 263 } 264 } 230 265 231 266 m_pAdditionalOptionsLabel->setText(UIWizardCloneVM::tr("Additional Options:"));
Note:
See TracChangeset
for help on using the changeset viewer.