- Timestamp:
- Oct 2, 2018 10:05:14 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp
r74550 r74576 129 129 } 130 130 131 /* Clone options vector to pass to cloning: */ 132 QVector<KCloneOptions> options; 131 133 /* Set the selected MAC address policy: */ 132 QVector<KCloneOptions> options;133 134 switch (field("macAddressClonePolicy").value<MACAddressClonePolicy>()) 134 135 { … … 142 143 break; 143 144 } 145 146 if (field("keepDiskNames").value<bool>()) 147 options.append(KCloneOptions_KeepDiskNames); 148 if (field("keepHWUUIDs").value<bool>()) 149 options.append(KCloneOptions_KeepHwUUIDs); 144 150 145 151 /* Linked clones requested? */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic1.cpp
r74550 r74576 51 51 , m_pMACComboBoxLabel(0) 52 52 , m_pMACComboBox(0) 53 , m_pAdditionalOptionsLabel(0) 54 , m_pKeepDiskNamesCheckBox(0) 55 , m_pKeepHWUUIDsCheckBox(0) 53 56 { 54 57 } … … 140 143 } 141 144 145 bool UIWizardCloneVMPage1::keepDiskNames() const 146 { 147 if (!m_pKeepDiskNamesCheckBox) 148 return false; 149 return m_pKeepDiskNamesCheckBox->isChecked(); 150 } 151 152 void UIWizardCloneVMPage1::setKeepDiskNames(bool fKeepDiskNames) 153 { 154 if (!m_pKeepDiskNamesCheckBox) 155 return; 156 if (m_pKeepDiskNamesCheckBox->isChecked() == fKeepDiskNames) 157 return; 158 m_pKeepDiskNamesCheckBox->setChecked(fKeepDiskNames); 159 } 160 161 bool UIWizardCloneVMPage1::keepHWUUIDs() const 162 { 163 if (!m_pKeepHWUUIDsCheckBox) 164 return false; 165 return m_pKeepHWUUIDsCheckBox->isChecked(); 166 } 167 168 void UIWizardCloneVMPage1::setKeepHWUUIDs(bool fKeepHWUUIDs) 169 { 170 if (!m_pKeepHWUUIDsCheckBox) 171 return; 172 if (m_pKeepHWUUIDsCheckBox->isChecked() == fKeepHWUUIDs) 173 return; 174 m_pKeepHWUUIDsCheckBox->setChecked(fKeepHWUUIDs); 175 } 176 177 142 178 UIWizardCloneVMPageBasic1::UIWizardCloneVMPageBasic1(const QString &strOriginalName, const QString &strDefaultPath, const QString &strGroup) 143 179 : UIWizardCloneVMPage1(strOriginalName, strDefaultPath, strGroup) … … 210 246 m_pContainerLayout->addWidget(m_pMACComboBoxLabel, 2, 0, 1, 1); 211 247 } 248 249 m_pAdditionalOptionsLabel = new QLabel; 250 if (m_pAdditionalOptionsLabel) 251 { 252 m_pAdditionalOptionsLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 253 m_pContainerLayout->addWidget(m_pAdditionalOptionsLabel, 3, 0, 1, 1); 254 } 255 m_pKeepDiskNamesCheckBox = new QCheckBox; 256 if (m_pKeepDiskNamesCheckBox) 257 m_pContainerLayout->addWidget(m_pKeepDiskNamesCheckBox, 3, 1, 1, 1); 258 m_pKeepHWUUIDsCheckBox = new QCheckBox; 259 if (m_pKeepHWUUIDsCheckBox) 260 m_pContainerLayout->addWidget(m_pKeepHWUUIDsCheckBox, 4, 1, 1, 1); 212 261 } 213 262 pMainLayout->addStretch(); … … 220 269 registerField("cloneFilePath", this, "cloneFilePath"); 221 270 registerField("macAddressClonePolicy", this, "macAddressClonePolicy"); 271 registerField("keepDiskNames", this, "keepDiskNames"); 272 registerField("keepHWUUIDs", this, "keepHWUUIDs"); 222 273 223 274 composeCloneFilePath(); … … 268 319 "during cloning."), Qt::ToolTipRole); 269 320 321 m_pAdditionalOptionsLabel->setText(UIWizardCloneVM::tr("Additional Options:")); 322 m_pKeepDiskNamesCheckBox->setToolTip(UIWizardCloneVM::tr("Don't change the disk names during cloning.")); 323 m_pKeepDiskNamesCheckBox->setText(UIWizardCloneVM::tr("Keep &Disk Names")); 324 m_pKeepHWUUIDsCheckBox->setToolTip(UIWizardCloneVM::tr("Don't change hardware UUIDs during cloning.")); 325 m_pKeepHWUUIDsCheckBox->setText(UIWizardCloneVM::tr("Keep &Hardware UUIDs")); 326 270 327 /* Adjust label widths: */ 271 328 QList<QWidget*> labels; … … 273 330 labels <<m_pNameLabel; 274 331 labels << m_pPathLabel; 332 labels << m_pAdditionalOptionsLabel; 275 333 276 334 int iMaxWidth = 0; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic1.h
r74550 r74576 69 69 void setMACAddressClonePolicy(MACAddressClonePolicy enmMACAddressClonePolicy); 70 70 71 bool keepDiskNames() const; 72 void setKeepDiskNames(bool fKeepDiskNames); 73 74 bool keepHWUUIDs() const; 75 void setKeepHWUUIDs(bool bKeepHWUUIDs); 76 71 77 QString m_strOriginalName; 72 78 QString m_strDefaultPath; … … 83 89 QLabel *m_pMACComboBoxLabel; 84 90 QComboBox *m_pMACComboBox; 91 QLabel *m_pAdditionalOptionsLabel; 92 QCheckBox *m_pKeepDiskNamesCheckBox; 93 QCheckBox *m_pKeepHWUUIDsCheckBox; 85 94 }; 86 95 … … 92 101 Q_PROPERTY(QString cloneFilePath READ cloneFilePath WRITE setCloneFilePath); 93 102 Q_PROPERTY(MACAddressClonePolicy macAddressClonePolicy READ macAddressClonePolicy WRITE setMACAddressClonePolicy); 103 Q_PROPERTY(bool keepDiskNames READ keepDiskNames WRITE setKeepDiskNames); 104 Q_PROPERTY(bool keepHWUUIDs READ keepHWUUIDs WRITE setKeepHWUUIDs); 105 94 106 95 107 public: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageExpert.cpp
r74550 r74576 50 50 QGridLayout *pNameCntLayout = new QGridLayout(m_pNameCnt); 51 51 { 52 pNameCntLayout->setContentsMargins(0, 0, 0, 0); 53 52 //pNameCntLayout->setContentsMargins(0, 0, 0, 0); 54 53 m_pNameLabel = new QLabel; 55 54 if (m_pNameLabel) … … 124 123 { 125 124 m_pCloneOptionsLayout = new QGridLayout(m_pCloneOptionsCnt); 126 //m_pCloneOptionsLayout->setContentsMargins(0, 0, 0, 0);127 125 /* Create MAC policy combo-box: */ 128 126 m_pMACComboBox = new QComboBox; … … 142 140 m_pCloneOptionsLayout->addWidget(m_pMACComboBoxLabel, 0, 0, 1, 1); 143 141 } 142 m_pAdditionalOptionsLabel = new QLabel; 143 if (m_pAdditionalOptionsLabel) 144 { 145 m_pAdditionalOptionsLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 146 m_pCloneOptionsLayout->addWidget(m_pAdditionalOptionsLabel, 3, 0, 1, 1); 147 } 148 m_pKeepDiskNamesCheckBox = new QCheckBox; 149 if (m_pKeepDiskNamesCheckBox) 150 m_pCloneOptionsLayout->addWidget(m_pKeepDiskNamesCheckBox, 3, 1, 1, 1); 151 m_pKeepHWUUIDsCheckBox = new QCheckBox; 152 if (m_pKeepHWUUIDsCheckBox) 153 m_pCloneOptionsLayout->addWidget(m_pKeepHWUUIDsCheckBox, 4, 1, 1, 1); 154 144 155 } 145 156 … … 175 186 registerField("cloneMode", this, "cloneMode"); 176 187 registerField("macAddressClonePolicy", this, "macAddressClonePolicy"); 188 registerField("keepDiskNames", this, "keepDiskNames"); 189 registerField("keepHWUUIDs", this, "keepHWUUIDs"); 190 177 191 composeCloneFilePath(); 178 192 } … … 205 219 m_pPathLabel->setText(UIWizardCloneVM::tr("Path:")); 206 220 207 m_pCloneOptionsCnt->setTitle(UIWizardCloneVM::tr(" Additional &options"));221 m_pCloneOptionsCnt->setTitle(UIWizardCloneVM::tr("Clone options")); 208 222 209 223 /* Translate MAC address policy combo-box: */ … … 225 239 "during cloning."), Qt::ToolTipRole); 226 240 241 m_pAdditionalOptionsLabel->setText(UIWizardCloneVM::tr("Additional Options:")); 242 m_pKeepDiskNamesCheckBox->setToolTip(UIWizardCloneVM::tr("Don't change the disk names during cloning.")); 243 m_pKeepDiskNamesCheckBox->setText(UIWizardCloneVM::tr("Keep &Disk Names")); 244 m_pKeepHWUUIDsCheckBox->setToolTip(UIWizardCloneVM::tr("Don't change hardware UUIDs during cloning.")); 245 m_pKeepHWUUIDsCheckBox->setText(UIWizardCloneVM::tr("Keep &Hardware UUIDs")); 246 227 247 /* Adjust label widths: */ 228 248 QList<QWidget*> labels; 229 249 labels << m_pMACComboBoxLabel; 250 labels << m_pAdditionalOptionsLabel; 230 251 231 252 int iMaxWidth = 0; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageExpert.h
r74550 r74576 39 39 Q_PROPERTY(KCloneMode cloneMode READ cloneMode WRITE setCloneMode); 40 40 Q_PROPERTY(MACAddressClonePolicy macAddressClonePolicy READ macAddressClonePolicy WRITE setMACAddressClonePolicy); 41 Q_PROPERTY(bool keepDiskNames READ keepDiskNames WRITE setKeepDiskNames); 42 Q_PROPERTY(bool keepHWUUIDs READ keepHWUUIDs WRITE setKeepHWUUIDs); 41 43 42 44 public:
Note:
See TracChangeset
for help on using the changeset viewer.