VirtualBox

Changeset 74576 in vbox for trunk


Ignore:
Timestamp:
Oct 2, 2018 10:05:14 AM (6 years ago)
Author:
vboxsync
Message:

bugref:9260. Hadding keep hw UUIDs and disk names options to clone wizard(s)

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  
    129129    }
    130130
     131    /* Clone options vector to pass to cloning: */
     132    QVector<KCloneOptions> options;
    131133    /* Set the selected MAC address policy: */
    132     QVector<KCloneOptions> options;
    133134    switch (field("macAddressClonePolicy").value<MACAddressClonePolicy>())
    134135    {
     
    142143            break;
    143144    }
     145
     146    if (field("keepDiskNames").value<bool>())
     147        options.append(KCloneOptions_KeepDiskNames);
     148    if (field("keepHWUUIDs").value<bool>())
     149        options.append(KCloneOptions_KeepHwUUIDs);
    144150
    145151    /* Linked clones requested? */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic1.cpp

    r74550 r74576  
    5151    , m_pMACComboBoxLabel(0)
    5252    , m_pMACComboBox(0)
     53    , m_pAdditionalOptionsLabel(0)
     54    , m_pKeepDiskNamesCheckBox(0)
     55    , m_pKeepHWUUIDsCheckBox(0)
    5356{
    5457}
     
    140143}
    141144
     145bool UIWizardCloneVMPage1::keepDiskNames() const
     146{
     147    if (!m_pKeepDiskNamesCheckBox)
     148        return false;
     149    return m_pKeepDiskNamesCheckBox->isChecked();
     150}
     151
     152void 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
     161bool UIWizardCloneVMPage1::keepHWUUIDs() const
     162{
     163    if (!m_pKeepHWUUIDsCheckBox)
     164        return false;
     165    return m_pKeepHWUUIDsCheckBox->isChecked();
     166}
     167
     168void 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
    142178UIWizardCloneVMPageBasic1::UIWizardCloneVMPageBasic1(const QString &strOriginalName, const QString &strDefaultPath, const QString &strGroup)
    143179    : UIWizardCloneVMPage1(strOriginalName, strDefaultPath, strGroup)
     
    210246            m_pContainerLayout->addWidget(m_pMACComboBoxLabel, 2, 0, 1, 1);
    211247        }
     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);
    212261    }
    213262    pMainLayout->addStretch();
     
    220269    registerField("cloneFilePath", this, "cloneFilePath");
    221270    registerField("macAddressClonePolicy", this, "macAddressClonePolicy");
     271    registerField("keepDiskNames", this, "keepDiskNames");
     272    registerField("keepHWUUIDs", this, "keepHWUUIDs");
    222273
    223274    composeCloneFilePath();
     
    268319                                                      "during cloning."), Qt::ToolTipRole);
    269320
     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
    270327    /* Adjust label widths: */
    271328    QList<QWidget*> labels;
     
    273330    labels <<m_pNameLabel;
    274331    labels << m_pPathLabel;
     332    labels << m_pAdditionalOptionsLabel;
    275333
    276334    int iMaxWidth = 0;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageBasic1.h

    r74550 r74576  
    6969    void setMACAddressClonePolicy(MACAddressClonePolicy enmMACAddressClonePolicy);
    7070
     71    bool keepDiskNames() const;
     72    void setKeepDiskNames(bool fKeepDiskNames);
     73
     74    bool keepHWUUIDs() const;
     75    void setKeepHWUUIDs(bool bKeepHWUUIDs);
     76
    7177    QString      m_strOriginalName;
    7278    QString      m_strDefaultPath;
     
    8389    QLabel      *m_pMACComboBoxLabel;
    8490    QComboBox   *m_pMACComboBox;
     91    QLabel      *m_pAdditionalOptionsLabel;
     92    QCheckBox   *m_pKeepDiskNamesCheckBox;
     93    QCheckBox   *m_pKeepHWUUIDsCheckBox;
    8594};
    8695
     
    92101    Q_PROPERTY(QString cloneFilePath READ cloneFilePath WRITE setCloneFilePath);
    93102    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
    94106
    95107public:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageExpert.cpp

    r74550 r74576  
    5050            QGridLayout *pNameCntLayout = new QGridLayout(m_pNameCnt);
    5151            {
    52                 pNameCntLayout->setContentsMargins(0, 0, 0, 0);
    53 
     52                //pNameCntLayout->setContentsMargins(0, 0, 0, 0);
    5453                m_pNameLabel = new QLabel;
    5554                if (m_pNameLabel)
     
    124123        {
    125124            m_pCloneOptionsLayout = new QGridLayout(m_pCloneOptionsCnt);
    126             //m_pCloneOptionsLayout->setContentsMargins(0, 0, 0, 0);
    127125            /* Create MAC policy combo-box: */
    128126            m_pMACComboBox = new QComboBox;
     
    142140                m_pCloneOptionsLayout->addWidget(m_pMACComboBoxLabel, 0, 0, 1, 1);
    143141            }
     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
    144155        }
    145156
     
    175186    registerField("cloneMode", this, "cloneMode");
    176187    registerField("macAddressClonePolicy", this, "macAddressClonePolicy");
     188    registerField("keepDiskNames", this, "keepDiskNames");
     189    registerField("keepHWUUIDs", this, "keepHWUUIDs");
     190
    177191    composeCloneFilePath();
    178192}
     
    205219    m_pPathLabel->setText(UIWizardCloneVM::tr("Path:"));
    206220
    207     m_pCloneOptionsCnt->setTitle(UIWizardCloneVM::tr("Additional &options"));
     221    m_pCloneOptionsCnt->setTitle(UIWizardCloneVM::tr("Clone options"));
    208222
    209223    /* Translate MAC address policy combo-box: */
     
    225239                                                      "during cloning."), Qt::ToolTipRole);
    226240
     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
    227247    /* Adjust label widths: */
    228248    QList<QWidget*> labels;
    229249    labels << m_pMACComboBoxLabel;
     250    labels << m_pAdditionalOptionsLabel;
    230251
    231252    int iMaxWidth = 0;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVMPageExpert.h

    r74550 r74576  
    3939    Q_PROPERTY(KCloneMode cloneMode READ cloneMode WRITE setCloneMode);
    4040    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);
    4143
    4244public:
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette