- Timestamp:
- Aug 12, 2021 1:25:55 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 10 edited
-
clonevm/UIWizardCloneVM.cpp (modified) (1 diff)
-
clonevm/UIWizardCloneVM.h (modified) (3 diffs)
-
clonevm/UIWizardCloneVMPageBasic1.cpp (modified) (3 diffs)
-
clonevm/UIWizardCloneVMPageBasic1.h (modified) (2 diffs)
-
clonevm/UIWizardCloneVMPageBasic2.cpp (modified) (1 diff)
-
clonevm/UIWizardCloneVMPageBasic2.h (modified) (2 diffs)
-
clonevm/UIWizardCloneVMPageBasic3.cpp (modified) (2 diffs)
-
clonevm/UIWizardCloneVMPageBasic3.h (modified) (3 diffs)
-
editors/UIWizardCloneVMEditors.cpp (modified) (7 diffs)
-
editors/UIWizardCloneVMEditors.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp
r90628 r90661 81 81 { 82 82 return m_strCloneFilePath; 83 } 84 85 MACAddressClonePolicy UIWizardCloneVM::macAddressClonePolicy() const 86 { 87 return m_enmMACAddressClonePolicy; 88 } 89 90 void UIWizardCloneVM::setMacAddressPolicy(MACAddressClonePolicy enmMACAddressClonePolicy) 91 { 92 m_enmMACAddressClonePolicy = enmMACAddressClonePolicy; 93 } 94 95 bool UIWizardCloneVM::keepDiskNames() const 96 { 97 return m_fKeepDiskNames; 98 } 99 100 void UIWizardCloneVM::setKeepDiskNames(bool fKeepDiskNames) 101 { 102 m_fKeepDiskNames = fKeepDiskNames; 103 } 104 105 bool UIWizardCloneVM::keepHardwareUUIDs() const 106 { 107 return m_fKeepHardwareUUIDs; 108 } 109 110 void UIWizardCloneVM::setKeepHardwareUUIDs(bool fKeepHardwareUUIDs) 111 { 112 m_fKeepHardwareUUIDs = fKeepHardwareUUIDs; 113 } 114 115 bool UIWizardCloneVM::linkedClone() const 116 { 117 return m_fLinkedClone; 118 } 119 120 void UIWizardCloneVM::setLinkedClone(bool fLinkedClone) 121 { 122 m_fLinkedClone = fLinkedClone; 123 } 124 125 KCloneMode UIWizardCloneVM::cloneMode() const 126 { 127 return m_enmCloneMode; 128 } 129 130 void UIWizardCloneVM::setCloneMode(KCloneMode enmCloneMode) 131 { 132 m_enmCloneMode = enmCloneMode; 83 133 } 84 134 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.h
r90628 r90661 24 24 /* GUI includes: */ 25 25 #include "UINativeWizard.h" 26 #include "UIWizardCloneVMEditors.h" 26 27 27 28 /* COM includes: */ … … 54 55 bool cloneVM(); 55 56 56 void setCloneName(const QString &strCloneName); 57 const QString &cloneName() const; 57 /** @name Parameter setter/getters 58 * @{ */ 59 void setCloneName(const QString &strCloneName); 60 const QString &cloneName() const; 58 61 59 void setCloneFilePath(const QString &strCloneFilePath); 60 const QString &cloneFilePath() const; 62 void setCloneFilePath(const QString &strCloneFilePath); 63 const QString &cloneFilePath() const; 64 65 MACAddressClonePolicy macAddressClonePolicy() const; 66 void setMacAddressPolicy(MACAddressClonePolicy enmMACAddressClonePolicy); 67 68 bool keepDiskNames() const; 69 void setKeepDiskNames(bool fKeepDiskNames); 70 71 bool keepHardwareUUIDs() const; 72 void setKeepHardwareUUIDs(bool fKeepHardwareUUIDs); 73 74 bool linkedClone() const; 75 void setLinkedClone(bool fLinkedClone); 76 77 KCloneMode cloneMode() const; 78 void setCloneMode(KCloneMode enmCloneMode); 79 /** @} */ 61 80 62 81 protected: … … 78 97 QString m_strCloneName; 79 98 QString m_strCloneFilePath; 99 MACAddressClonePolicy m_enmMACAddressClonePolicy; 100 bool m_fKeepDiskNames; 101 bool m_fKeepHardwareUUIDs; 102 bool m_fLinkedClone; 103 KCloneMode m_enmCloneMode; 80 104 /** @} */ 81 82 83 105 }; 84 106 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic1.cpp
r90628 r90661 21 21 22 22 /* GUI includes: */ 23 #include "UIWizardCloneVMEditors.h"24 23 #include "QIRichTextLabel.h" 25 24 #include "UIWizardCloneVM.h" … … 104 103 m_pAdditionalOptionsEditor->setFlat(true); 105 104 pMainLayout->addWidget(m_pAdditionalOptionsEditor); 105 connect(m_pAdditionalOptionsEditor, &UICloneVMAdditionalOptionsEditor::sigMACAddressClonePolicyChanged, 106 this, &UIWizardCloneVMPageBasic1::sltMACAddressClonePolicyChanged); 107 connect(m_pAdditionalOptionsEditor, &UICloneVMAdditionalOptionsEditor::sigKeepDiskNamesToggled, 108 this, &UIWizardCloneVMPageBasic1::sltKeepDiskNamesToggled); 109 connect(m_pAdditionalOptionsEditor, &UICloneVMAdditionalOptionsEditor::sigKeepHardwareUUIDsToggled, 110 this, &UIWizardCloneVMPageBasic1::sltKeepHardwareUUIDsToggled); 106 111 } 107 112 … … 143 148 } 144 149 145 void UIWizardCloneVMPageBasic1::slt HandleMACAddressClonePolicyComboChange()150 void UIWizardCloneVMPageBasic1::sltMACAddressClonePolicyChanged(MACAddressClonePolicy enmMACAddressClonePolicy) 146 151 { 147 /* Update tool-tip: */148 //updateMACAddressClonePolicyComboToolTip();152 m_userModifiedParameters << "MacAddressPolicy"; 153 cloneVMWizardPropertySet(MacAddressPolicy, enmMACAddressClonePolicy); 149 154 } 155 156 void UIWizardCloneVMPageBasic1::sltKeepDiskNamesToggled(bool fKeepDiskNames) 157 { 158 m_userModifiedParameters << "KeepDiskNames"; 159 cloneVMWizardPropertySet(KeepDiskNames, fKeepDiskNames); 160 } 161 162 void UIWizardCloneVMPageBasic1::sltKeepHardwareUUIDsToggled(bool fKeepHardwareUUIDs) 163 { 164 m_userModifiedParameters << "KeepHardwareUUIDs"; 165 cloneVMWizardPropertySet(KeepHardwareUUIDs, fKeepHardwareUUIDs); 166 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic1.h
r90628 r90661 27 27 /* Local includes: */ 28 28 #include "UINativeWizardPage.h" 29 #include "UIWizardCloneVMEditors.h" 29 30 30 31 /* Forward declarations: */ … … 52 53 void sltCloneNameChanged(const QString &strCloneName); 53 54 void sltClonePathChanged(const QString &strClonePath); 54 /** Handles change in MAC address policy combo-box. */ 55 void sltHandleMACAddressClonePolicyComboChange(); 55 void sltMACAddressClonePolicyChanged(MACAddressClonePolicy enmMACAddressClonePolicy); 56 void sltKeepDiskNamesToggled(bool fKeepDiskNames); 57 void sltKeepHardwareUUIDsToggled(bool fKeepHardwareUUIDs); 56 58 57 59 private: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic2.cpp
r90621 r90661 60 60 { 61 61 UIWizardCloneVM *pWizard = qobject_cast<UIWizardCloneVM*>(wizard()); 62 m_userModifiedParameters << "LinkedClone"; 63 cloneVMWizardPropertySet(LinkedClone, !fIsFullClone); 64 /* Show/hide 3rd page according to linked clone toggle: */ 62 65 AssertReturnVoid(pWizard); 63 66 pWizard->setCloneModePageVisible(fIsFullClone); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic2.h
r90621 r90661 21 21 # pragma once 22 22 #endif 23 24 /* Qt includes: */ 25 #include <QSet> 23 26 24 27 /* Local includes: */ … … 51 54 bool m_fAdditionalInfo; 52 55 UICloneVMCloneTypeGroupBox *m_pCloneTypeGroupBox; 56 57 QSet<QString> m_userModifiedParameters; 53 58 }; 54 59 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic3.cpp
r90607 r90661 74 74 pMainLayout->addWidget(m_pCloneModeGroupBox); 75 75 m_pCloneModeGroupBox->setFlat(true); 76 connect(m_pCloneModeGroupBox, &UICloneVMCloneModeGroupBox::sigCloneModeChanged, 77 this, &UIWizardCloneVMPageBasic3::sltCloneModeChanged); 76 78 } 77 79 pMainLayout->addStretch(); … … 141 143 return fResult; 142 144 } 145 146 void UIWizardCloneVMPageBasic3::sltCloneModeChanged(KCloneMode enmCloneMode) 147 { 148 m_userModifiedParameters << "CloneMode"; 149 cloneVMWizardPropertySet(CloneMode, enmCloneMode); 150 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic3.h
r90607 r90661 21 21 # pragma once 22 22 #endif 23 24 /* Qt includes: */ 25 #include <QSet> 23 26 24 27 /* GUI includes: */ … … 63 66 UIWizardCloneVMPageBasic3(bool fShowChildsOption); 64 67 68 private slots: 69 70 void sltCloneModeChanged(KCloneMode enmCloneMode); 71 65 72 private: 66 73 … … 80 87 81 88 bool m_fShowChildsOption; 82 89 QSet<QString> m_userModifiedParameters; 83 90 }; 84 91 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardCloneVMEditors.cpp
r90628 r90661 143 143 m_pContainerLayout->addWidget(m_pPathSelector, 1, 1, 1, 1); 144 144 m_pPathSelector->setPath(m_strDefaultPath); 145 connect(m_pPathSelector, &UIFilePathSelector::pathChanged, 146 this, &UICloneVMNamePathEditor::sigClonePathChanged); 145 147 } 146 148 … … 218 220 m_pMACComboBox = new QComboBox; 219 221 if (m_pMACComboBox) 222 { 220 223 m_pContainerLayout->addWidget(m_pMACComboBox, 2, 1, 1, 1); 224 connect(m_pMACComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 225 this, &UICloneVMAdditionalOptionsEditor::sltMACAddressClonePolicyChanged); 226 } 221 227 populateMACAddressClonePolicies(); 222 228 … … 242 248 m_pKeepDiskNamesCheckBox = new QCheckBox; 243 249 if (m_pKeepDiskNamesCheckBox) 250 { 244 251 m_pContainerLayout->addWidget(m_pKeepDiskNamesCheckBox, iVerticalPosition++, 1, 1, 1); 252 connect(m_pKeepDiskNamesCheckBox, &QCheckBox::toggled, 253 this, &UICloneVMAdditionalOptionsEditor::sigKeepDiskNamesToggled); 254 } 245 255 } 246 256 if (fSupportedKeepHWUUIDs) … … 248 258 m_pKeepHWUUIDsCheckBox = new QCheckBox; 249 259 if (m_pKeepHWUUIDsCheckBox) 260 { 250 261 m_pContainerLayout->addWidget(m_pKeepHWUUIDsCheckBox, iVerticalPosition++, 1, 1, 1); 262 connect(m_pKeepHWUUIDsCheckBox, &QCheckBox::toggled, 263 this, &UICloneVMAdditionalOptionsEditor::sigKeepHardwareUUIDsToggled); 264 } 251 265 } 252 266 … … 301 315 } 302 316 317 void UICloneVMAdditionalOptionsEditor::sltMACAddressClonePolicyChanged() 318 { 319 emit sigMACAddressClonePolicyChanged(macAddressClonePolicy()); 320 updateMACAddressClonePolicyComboToolTip(); 321 } 322 323 void UICloneVMAdditionalOptionsEditor::updateMACAddressClonePolicyComboToolTip() 324 { 325 if (!m_pMACComboBox) 326 return; 327 const QString strCurrentToolTip = m_pMACComboBox->currentData(Qt::ToolTipRole).toString(); 328 AssertMsg(!strCurrentToolTip.isEmpty(), ("Tool-tip data not found!")); 329 m_pMACComboBox->setToolTip(strCurrentToolTip); 330 } 331 303 332 void UICloneVMAdditionalOptionsEditor::populateMACAddressClonePolicies() 304 333 { … … 423 452 AssertReturnVoid(pMainLayout); 424 453 454 QButtonGroup *pButtonGroup = new QButtonGroup(this); 425 455 m_pMachineRadio = new QRadioButton(this); 456 if (m_pMachineRadio) 426 457 { 427 458 m_pMachineRadio->setChecked(true); 459 pButtonGroup->addButton(m_pMachineRadio); 428 460 } 429 461 m_pMachineAndChildsRadio = new QRadioButton(this); 462 if (m_pMachineAndChildsRadio) 430 463 { 431 464 if (!m_fShowChildsOption) 432 465 m_pMachineAndChildsRadio->hide(); 433 } 466 pButtonGroup->addButton(m_pMachineAndChildsRadio); 467 } 468 434 469 m_pAllRadio = new QRadioButton(this); 470 if (m_pAllRadio) 471 pButtonGroup->addButton(m_pAllRadio); 472 435 473 pMainLayout->addWidget(m_pMachineRadio); 436 474 pMainLayout->addWidget(m_pMachineAndChildsRadio); 437 475 pMainLayout->addWidget(m_pAllRadio); 438 476 pMainLayout->addStretch(); 477 478 479 connect(pButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked), 480 this, &UICloneVMCloneModeGroupBox::sltButtonClicked); 439 481 440 482 retranslateUi(); … … 450 492 m_pAllRadio->setText(tr("&Everything")); 451 493 } 494 495 496 void UICloneVMCloneModeGroupBox::sltButtonClicked() 497 { 498 KCloneMode enmCloneMode = KCloneMode_MachineState; 499 if (m_pMachineAndChildsRadio && m_pMachineAndChildsRadio->isChecked()) 500 enmCloneMode = KCloneMode_MachineAndChildStates; 501 else if (m_pAllRadio && m_pAllRadio->isChecked()) 502 enmCloneMode = KCloneMode_AllStates; 503 emit sigCloneModeChanged(enmCloneMode); 504 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardCloneVMEditors.h
r90628 r90661 28 28 /* Local includes: */ 29 29 #include "QIWithRetranslateUI.h" 30 31 /* Other VBox includes: */ 32 #include "COMEnums.h" 30 33 31 34 … … 110 113 signals: 111 114 115 void sigMACAddressClonePolicyChanged(MACAddressClonePolicy enmMACAddressClonePolicy); 116 void sigKeepDiskNamesToggled(bool fKeepDiskNames); 117 void sigKeepHardwareUUIDsToggled(bool fKeepHardwareUUIDs); 112 118 113 119 public: … … 119 125 MACAddressClonePolicy macAddressClonePolicy() const; 120 126 void setMACAddressClonePolicy(MACAddressClonePolicy enmMACAddressClonePolicy); 127 121 128 void setFirstColumnWidth(int iWidth); 122 129 int firstColumnWidth() const; 123 130 131 private slots: 132 133 void sltMACAddressClonePolicyChanged(); 134 124 135 private: 125 136 … … 127 138 virtual void retranslateUi() /* override final */; 128 139 void populateMACAddressClonePolicies(); 140 void updateMACAddressClonePolicyComboToolTip(); 129 141 130 142 QGridLayout *m_pContainerLayout; … … 169 181 signals: 170 182 183 void sigCloneModeChanged(KCloneMode enmCloneMode); 184 171 185 public: 172 186 173 187 UICloneVMCloneModeGroupBox(bool fShowChildsOption, QWidget *pParent = 0); 188 189 private slots: 190 191 void sltButtonClicked(); 174 192 175 193 private: … … 182 200 QRadioButton *m_pMachineAndChildsRadio; 183 201 QRadioButton *m_pAllRadio; 184 185 202 }; 186 203
Note:
See TracChangeset
for help on using the changeset viewer.

