VirtualBox

Changeset 93673 in vbox


Ignore:
Timestamp:
Feb 10, 2022 7:04:54 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
149838
Message:

FE/Qt: bugref:9996. A small fix in clone vd expert wizard to make it more similar to the corresponding new vd wizard page.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.cpp

    r93115 r93673  
    3131
    3232UIWizardCloneVDExpertPage::UIWizardCloneVDExpertPage(KDeviceType enmDeviceType, qulonglong uSourceDiskLogicaSize)
    33     :m_pFormatGroupBox(0)
     33    : m_pFormatComboBox(0)
    3434    , m_pVariantWidget(0)
    3535    , m_pMediumSizePathGroupBox(0)
     36    , m_pFormatVariantGroupBox(0)
    3637    , m_enmDeviceType(enmDeviceType)
    3738{
     
    4142void UIWizardCloneVDExpertPage::prepare(KDeviceType enmDeviceType, qulonglong uSourceDiskLogicaSize)
    4243{
    43     QGridLayout *pMainLayout = new QGridLayout(this);
     44    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    4445
    4546    m_pMediumSizePathGroupBox = new UIMediumSizeAndPathGroupBox(true /* expert mode */, 0 /* parent */, uSourceDiskLogicaSize);
     
    4748    if (m_pMediumSizePathGroupBox)
    4849    {
    49         pMainLayout->addWidget(m_pMediumSizePathGroupBox, 0, 0, 4, 2);
     50        pMainLayout->addWidget(m_pMediumSizePathGroupBox);
    5051        connect(m_pMediumSizePathGroupBox, &UIMediumSizeAndPathGroupBox::sigMediumLocationButtonClicked,
    5152                this, &UIWizardCloneVDExpertPage::sltSelectLocationButtonClicked);
     
    5657    }
    5758
    58     m_pFormatGroupBox = new UIDiskFormatsGroupBox(true /* expert mode */, enmDeviceType, 0);
    59     if (m_pFormatGroupBox)
    60     {
    61         pMainLayout-> addWidget(m_pFormatGroupBox, 4, 0, 7, 1);
    62         connect(m_pFormatGroupBox, &UIDiskFormatsGroupBox::sigMediumFormatChanged,
     59    m_pFormatComboBox = new UIDiskFormatsComboBox(true /* expert mode */, enmDeviceType, 0);
     60    if (m_pFormatComboBox)
     61        connect(m_pFormatComboBox, &UIDiskFormatsComboBox::sigMediumFormatChanged,
    6362                this, &UIWizardCloneVDExpertPage::sltMediumFormatChanged);
    64     }
    6563
    6664    m_pVariantWidget = new UIDiskVariantWidget(0);
    6765    if (m_pVariantWidget)
    68     {
    69         pMainLayout-> addWidget(m_pVariantWidget, 4, 1, 3, 1);
    7066        connect(m_pVariantWidget, &UIDiskVariantWidget::sigMediumVariantChanged,
    7167                this, &UIWizardCloneVDExpertPage::sltMediumVariantChanged);
     68
     69    m_pFormatVariantGroupBox = new QGroupBox;
     70    if (m_pFormatVariantGroupBox)
     71    {
     72        QHBoxLayout *pFormatVariantLayout = new QHBoxLayout(m_pFormatVariantGroupBox);
     73        pFormatVariantLayout->addWidget(m_pFormatComboBox, 0, Qt::AlignTop);
     74        pFormatVariantLayout->addWidget(m_pVariantWidget);
     75        pMainLayout->addWidget(m_pFormatVariantGroupBox);
    7276    }
    7377}
     
    7579void UIWizardCloneVDExpertPage::sltMediumFormatChanged()
    7680{
    77     if (wizardWindow<UIWizardCloneVD>() && m_pFormatGroupBox)
    78         wizardWindow<UIWizardCloneVD>()->setMediumFormat(m_pFormatGroupBox->mediumFormat());
     81    if (wizardWindow<UIWizardCloneVD>() && m_pFormatComboBox)
     82        wizardWindow<UIWizardCloneVD>()->setMediumFormat(m_pFormatComboBox->mediumFormat());
    7983    updateDiskWidgetsAfterMediumFormatChange();
    8084    emit completeChanged();
     
    125129void UIWizardCloneVDExpertPage::retranslateUi()
    126130{
     131    if (m_pFormatVariantGroupBox)
     132        m_pFormatVariantGroupBox->setTitle(UIWizardCloneVD::tr("Hard Disk File &Type and Variant"));
    127133}
    128134
    129135void UIWizardCloneVDExpertPage::initializePage()
    130136{
    131     AssertReturnVoid(wizardWindow<UIWizardCloneVD>() && m_pMediumSizePathGroupBox && m_pFormatGroupBox && m_pVariantWidget);
    132     UIWizardCloneVD *pWizard = wizardWindow<UIWizardCloneVD>();
    133 
    134     pWizard->setMediumFormat(m_pFormatGroupBox->mediumFormat());
     137    AssertReturnVoid(wizardWindow<UIWizardCloneVD>() && m_pMediumSizePathGroupBox && m_pFormatComboBox && m_pVariantWidget);
     138    UIWizardCloneVD *pWizard = wizardWindow<UIWizardCloneVD>();
     139
     140    pWizard->setMediumFormat(m_pFormatComboBox->mediumFormat());
    135141
    136142    pWizard->setMediumVariant(m_pVariantWidget->mediumVariant());
     
    160166    bool fResult = true;
    161167
    162     if (m_pFormatGroupBox)
    163         fResult = m_pFormatGroupBox->mediumFormat().isNull();
     168    if (m_pFormatComboBox)
     169        fResult = m_pFormatComboBox->mediumFormat().isNull();
    164170    if (m_pVariantWidget)
    165171        fResult = m_pVariantWidget->isComplete();
     
    188194{
    189195    UIWizardCloneVD *pWizard = wizardWindow<UIWizardCloneVD>();
    190     AssertReturnVoid(pWizard && m_pVariantWidget && m_pMediumSizePathGroupBox && m_pFormatGroupBox);
     196    AssertReturnVoid(pWizard && m_pVariantWidget && m_pMediumSizePathGroupBox && m_pFormatComboBox);
    191197    const CMediumFormat &comMediumFormat = pWizard->mediumFormat();
    192198    AssertReturnVoid(!comMediumFormat.isNull());
     
    197203
    198204    m_pMediumSizePathGroupBox->blockSignals(true);
    199     m_pMediumSizePathGroupBox->updateMediumPath(comMediumFormat, m_pFormatGroupBox->formatExtensions(), m_enmDeviceType);
     205    m_pMediumSizePathGroupBox->updateMediumPath(comMediumFormat, m_pFormatComboBox->formatExtensions(), m_enmDeviceType);
    200206    m_pMediumSizePathGroupBox->blockSignals(false);
    201207    /* Update the wizard parameters explicitly since we blocked th signals: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.h

    r93115 r93673  
    2929
    3030/* Forward declarations: */
    31 class UIDiskFormatsGroupBox;
     31class QGroupBox;
     32class UIDiskFormatsComboBox;
    3233class UIDiskVariantWidget;
    3334class UIMediumSizeAndPathGroupBox;
     35
    3436
    3537/** Expert page of the Clone Virtual Disk Image wizard: */
     
    7678    void updateDiskWidgetsAfterMediumFormatChange();
    7779
    78     UIDiskFormatsGroupBox *m_pFormatGroupBox;
     80    UIDiskFormatsComboBox *m_pFormatComboBox;
    7981    UIDiskVariantWidget *m_pVariantWidget;
    8082    UIMediumSizeAndPathGroupBox *m_pMediumSizePathGroupBox;
     83    QGroupBox *m_pFormatVariantGroupBox;
    8184    KDeviceType m_enmDeviceType;
    8285};
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDFormatPage.cpp

    r93115 r93673  
    5656{
    5757    /* Translate page: */
    58     setTitle(UIWizardCloneVD::tr("Disk image file type"));
     58    setTitle(UIWizardCloneVD::tr("Virtual Hard disk file type"));
    5959
    6060    /* Translate widgets: */
    6161    m_pLabel->setText(UIWizardCloneVD::tr("Please choose the type of file that you would like to use "
    62                                           "for the new virtual disk image. If you do not need to use it "
     62                                          "for the destination virtual disk image. If you do not need to use it "
    6363                                          "with other virtualization software you can leave this setting unchanged."));
    6464}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.cpp

    r93115 r93673  
    3333    : UINativeWizardPage()
    3434    , m_pSizeAndPathGroup(0)
    35     , m_pFormatComboxBox(0)
     35    , m_pFormatComboBox(0)
    3636    , m_pVariantWidget(0)
    3737    , m_pFormatVariantGroupBox(0)
     
    4949    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    5050    m_pSizeAndPathGroup = new UIMediumSizeAndPathGroupBox(true /* fExpertMode */, 0 /* parent */, _4M /* minimum size */);
    51     m_pFormatComboxBox = new UIDiskFormatsComboBox(true /* fExpertMode */, KDeviceType_HardDisk, 0);
     51    m_pFormatComboBox = new UIDiskFormatsComboBox(true /* fExpertMode */, KDeviceType_HardDisk, 0);
    5252    m_pVariantWidget = new UIDiskVariantWidget(0);
    5353
    5454    m_pFormatVariantGroupBox = new QGroupBox;
    5555    QHBoxLayout *pFormatVariantLayout = new QHBoxLayout(m_pFormatVariantGroupBox);
    56     pFormatVariantLayout->addWidget(m_pFormatComboxBox, 0, Qt::AlignTop);
     56    pFormatVariantLayout->addWidget(m_pFormatComboBox, 0, Qt::AlignTop);
    5757    pFormatVariantLayout->addWidget(m_pVariantWidget);
    5858
     
    6060    pMainLayout->addWidget(m_pFormatVariantGroupBox);
    6161
    62     connect(m_pFormatComboxBox, &UIDiskFormatsComboBox::sigMediumFormatChanged,
     62    connect(m_pFormatComboBox, &UIDiskFormatsComboBox::sigMediumFormatChanged,
    6363            this, &UIWizardNewVDExpertPage::sltMediumFormatChanged);
    6464    connect(m_pVariantWidget, &UIDiskVariantWidget::sigMediumVariantChanged,
     
    101101void UIWizardNewVDExpertPage::sltMediumFormatChanged()
    102102{
    103     AssertReturnVoid(m_pFormatComboxBox);
     103    AssertReturnVoid(m_pFormatComboBox);
    104104    AssertReturnVoid(wizardWindow<UIWizardNewVD>());
    105     wizardWindow<UIWizardNewVD>()->setMediumFormat(m_pFormatComboxBox->mediumFormat());
     105    wizardWindow<UIWizardNewVD>()->setMediumFormat(m_pFormatComboBox->mediumFormat());
    106106    updateDiskWidgetsAfterMediumFormatChange();
    107107    completeChanged();
     
    137137    AssertReturnVoid(pWizard);
    138138    /* First set the medium format of the wizard: */
    139     AssertReturnVoid(m_pFormatComboxBox);
    140     const CMediumFormat &comMediumFormat = m_pFormatComboxBox->mediumFormat();
     139    AssertReturnVoid(m_pFormatComboBox);
     140    const CMediumFormat &comMediumFormat = m_pFormatComboBox->mediumFormat();
    141141    AssertReturnVoid(!comMediumFormat.isNull());
    142142    pWizard->setMediumFormat(comMediumFormat);
     
    211211{
    212212    UIWizardNewVD *pWizard = wizardWindow<UIWizardNewVD>();
    213     AssertReturnVoid(pWizard && m_pVariantWidget && m_pSizeAndPathGroup && m_pFormatComboxBox);
     213    AssertReturnVoid(pWizard && m_pVariantWidget && m_pSizeAndPathGroup && m_pFormatComboBox);
    214214    const CMediumFormat &comMediumFormat = pWizard->mediumFormat();
    215215    AssertReturnVoid(!comMediumFormat.isNull());
    216216
    217217    m_pVariantWidget->updateMediumVariantWidgetsAfterFormatChange(comMediumFormat);
    218     m_pSizeAndPathGroup->updateMediumPath(comMediumFormat, m_pFormatComboxBox->formatExtensions(), KDeviceType_HardDisk);
    219 }
     218    m_pSizeAndPathGroup->updateMediumPath(comMediumFormat, m_pFormatComboBox->formatExtensions(), KDeviceType_HardDisk);
     219}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.h

    r93115 r93673  
    6565     * @{ */
    6666       UIMediumSizeAndPathGroupBox *m_pSizeAndPathGroup;
    67        UIDiskFormatsComboBox *m_pFormatComboxBox;
     67       UIDiskFormatsComboBox *m_pFormatComboBox;
    6868       UIDiskVariantWidget *m_pVariantWidget;
    6969       QGroupBox *m_pFormatVariantGroupBox;
Note: See TracChangeset for help on using the changeset viewer.

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