VirtualBox

Ignore:
Timestamp:
Jan 13, 2021 7:38:24 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9515. Some clean up

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp

    r87240 r87244  
    286286}
    287287
    288 int UIWizardNewVMPage1::createNameOSTypeWidgets(QGridLayout *pLayout, bool fCreateLabels /* = true */)
    289 {
    290     AssertReturn(pLayout, 0);
     288QWidget *UIWizardNewVMPage1::createNameOSTypeWidgets(WizardMode mode, bool fCreateLabels /* = true */)
     289{
     290    Q_UNUSED(mode);
     291    QWidget *pContainer = new QWidget;
     292    QGridLayout *pLayout = new QGridLayout(pContainer);
    291293    int iRow = 0;
    292294    if (fCreateLabels)
     
    344346    if (m_pSystemTypeEditor)
    345347        pLayout->addWidget(m_pSystemTypeEditor, iRow++, 0, 1, 4);
    346     return iRow;
     348    return pContainer;
    347349}
    348350
     
    517519void UIWizardNewVMPageBasic1::prepare()
    518520{
    519     QGridLayout *pPageLayout = new QGridLayout(this);
    520     int iRow = createNameOSTypeWidgets(pPageLayout, false);
    521     pPageLayout->addItem(new QSpacerItem(20, 40, QSizePolicy::Expanding, QSizePolicy::Expanding),
    522                          iRow, 0, 1, 4);
     521    QVBoxLayout *pPageLayout = new QVBoxLayout(this);
     522    pPageLayout->addWidget(createNameOSTypeWidgets(WizardMode_Basic, false));
     523    pPageLayout->addStretch();
     524
    523525    createConnections();
    524526    /* Register fields: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h

    r87240 r87244  
    2424/* Local includes: */
    2525#include "UIWizardPage.h"
     26#include "UIExtraDataDefs.h"
    2627
    2728/* Forward declarations: */
     
    7677    /** calls CVirtualBox::ComposeMachineFilename(...) and sets related member variables */
    7778    void composeMachineFilePath();
    78     /** Creates the page widgets and adds them into the @p pGridLayout. */
     79
     80    QWidget *createNameOSTypeWidgets(WizardMode mode, bool fCreateLabels = true);
    7981    int createNameOSTypeWidgets(QGridLayout *pLayout, bool fCreateLabels = true);
    8082    void setTypeByISODetectedOSType(const QString &strDetectedOSType);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r87243 r87244  
    4444UIWizardNewVMPageExpert::UIWizardNewVMPageExpert(const QString &strGroup)
    4545    : UIWizardNewVMPage1(strGroup)
    46     , m_pNameAndSystemContainer(0)
    4746    , m_pToolBox(0)
    4847{
     
    5150    {
    5251        m_pToolBox = new QToolBox;
    53         m_pNameAndSystemContainer = new QWidget(this);
    54         QGridLayout *pNameContainerLayout = new QGridLayout(m_pNameAndSystemContainer);
    55         createNameOSTypeWidgets(pNameContainerLayout, false);
    56         m_pGAInstallContainer = createGAInstallWidgets();
    57         m_pUsernameHostnameContainer = createUserNameHostNameWidgets();
    58 
    59         m_pToolBox->insertItem(ExpertToolboxItems_NameAndOSType, m_pNameAndSystemContainer, "");
     52
     53        m_pToolBox->insertItem(ExpertToolboxItems_NameAndOSType, createNameOSTypeWidgets(WizardMode_Expert, false), "");
    6054        m_pToolBox->insertItem(ExpertToolboxItems_Disk, createDiskWidgets(), "");
    6155        m_pToolBox->insertItem(ExpertToolboxItems_Hardware, createHardwareWidgets(), "");
    62         m_pToolBox->insertItem(ExpertToolboxItems_UsernameHostname, m_pUsernameHostnameContainer, "");
    63         m_pToolBox->insertItem(ExpertToolboxItems_GAInstall, m_pGAInstallContainer, "");
     56        m_pToolBox->insertItem(ExpertToolboxItems_UsernameHostname, createUserNameHostNameWidgets(), "");
     57        m_pToolBox->insertItem(ExpertToolboxItems_GAInstall, createGAInstallWidgets(), "");
    6458        m_pToolBox->insertItem(ExpertToolboxItems_ProductKey, createProductKeyWidgets(), "");
    6559        pMainLayout->addWidget(m_pToolBox);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r87060 r87244  
    110110    void disableEnableUnattendedRelatedWidgets(bool fEnabled);
    111111    void markWidgets() const;
    112     /** Widgets. */
    113     QWidget *m_pNameAndSystemContainer;
    114     QWidget *m_pGAInstallContainer;
    115     QWidget *m_pUsernameHostnameContainer;
     112
    116113    QToolBox  *m_pToolBox;
    117114};
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