VirtualBox

Changeset 88148 in vbox


Ignore:
Timestamp:
Mar 17, 2021 9:51:23 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143297
Message:

FE/Qt: bugref:9515: New VM wizard: A bit of layout fixes for 1st page and corresponding Name and OS Type editor used there.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp

    r88107 r88148  
    286286{
    287287    if (m_pNameLabel)
    288         m_pNameLabel->setText(tr("Name:"));
     288        m_pNameLabel->setText(tr("&Name:"));
    289289    if (m_pPathLabel)
    290         m_pPathLabel->setText(tr("Folder:"));
     290        m_pPathLabel->setText(tr("&Folder:"));
    291291    if (m_pISOFileSelectorLabel)
    292         m_pISOFileSelectorLabel->setText(tr("Installation ISO:"));
     292        m_pISOFileSelectorLabel->setText(tr("&Image:"));
    293293    if (m_pLabelFamily)
    294294        m_pLabelFamily->setText(tr("&Type:"));
     
    417417void UINameAndSystemEditor::prepareWidgets()
    418418{
    419     /* Create main-layout: */
     419    /* Prepare main-layout: */
    420420    m_pMainLayout = new QGridLayout(this);
    421421    if (m_pMainLayout)
     
    429429        if (m_fChooseName)
    430430        {
    431             /* Create name label: */
    432             m_pNameLabel = new QLabel;
     431            /* Prepare name label: */
     432            m_pNameLabel = new QLabel(this);
    433433            if (m_pNameLabel)
    434434            {
     
    436436                m_pNameLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    437437
    438                 /* Add into layout: */
    439                 m_pMainLayout->addWidget(m_pNameLabel, iRow, 0, 1, 1);
    440             }
    441             /* Create name editor: */
    442             m_pNameLineEdit = new QILineEdit;
     438                m_pMainLayout->addWidget(m_pNameLabel, iRow, 0);
     439            }
     440            /* Prepare name editor: */
     441            m_pNameLineEdit = new QILineEdit(this);
    443442            if (m_pNameLineEdit)
    444443            {
    445                 /* Add into layout: */
     444                m_pNameLabel->setBuddy(m_pNameLineEdit);
    446445                m_pMainLayout->addWidget(m_pNameLineEdit, iRow, 1, 1, 2);
    447446            }
     
    452451        if (m_fChoosePath)
    453452        {
    454             /* Create path label: */
    455             m_pPathLabel = new QLabel;
     453            /* Prepare path label: */
     454            m_pPathLabel = new QLabel(this);
    456455            if (m_pPathLabel)
    457456            {
     
    459458                m_pPathLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    460459
    461                 /* Add into layout: */
    462                 m_pMainLayout->addWidget(m_pPathLabel, iRow, 0, 1, 1);
    463             }
    464             /* Create path selector: */
    465             m_pPathSelector = new UIFilePathSelector;
     460                m_pMainLayout->addWidget(m_pPathLabel, iRow, 0);
     461            }
     462            /* Prepare path selector: */
     463            m_pPathSelector = new UIFilePathSelector(this);
    466464            if (m_pPathSelector)
    467465            {
     466                m_pPathLabel->setBuddy(m_pPathSelector);
    468467                QString strDefaultMachineFolder = uiCommon().virtualBox().GetSystemProperties().GetDefaultMachineFolder();
    469468                m_pPathSelector->setPath(strDefaultMachineFolder);
    470469                m_pPathSelector->setDefaultPath(strDefaultMachineFolder);
    471470
    472                 /* Add into layout: */
    473471                m_pMainLayout->addWidget(m_pPathSelector, iRow, 1, 1, 2);
    474472            }
     
    479477        if (m_fChooseISOFile)
    480478        {
     479            /* Prepare ISO label: */
    481480            m_pISOFileSelectorLabel = new QLabel(this);
    482             m_pMainLayout->addWidget(m_pISOFileSelectorLabel, iRow, 0);
    483 
     481            if (m_pISOFileSelectorLabel)
     482            {
     483                m_pISOFileSelectorLabel->setAlignment(Qt::AlignRight);
     484                m_pISOFileSelectorLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
     485
     486                m_pMainLayout->addWidget(m_pISOFileSelectorLabel, iRow, 0);
     487            }
     488            /* Prepare ISO selector: */
    484489            m_pISOFileSelector = new UIFilePathSelector(this);
    485490            if (m_pISOFileSelector)
     
    488493                m_pISOFileSelector->setMode(UIFilePathSelector::Mode_File_Open);
    489494                m_pISOFileSelector->setFileDialogFilters("*.iso *.ISO");
    490                 m_pISOFileSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
     495                m_pISOFileSelector->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
    491496                m_pISOFileSelector->setInitialPath(uiCommon().defaultFolderPathForType(UIMediumDeviceType_DVD));
    492497                m_pISOFileSelectorLabel->setBuddy(m_pISOFileSelector);
     498
    493499                m_pMainLayout->addWidget(m_pISOFileSelector, iRow, 1, 1, 2);
    494500            }
     501
    495502            ++iRow;
    496503        }
     
    498505        if (m_fChooseType)
    499506        {
    500             /* Create VM OS family label: */
    501             m_pLabelFamily = new QLabel;
     507            /* Prepare VM OS family label: */
     508            m_pLabelFamily = new QLabel(this);
    502509            if (m_pLabelFamily)
    503510            {
    504511                m_pLabelFamily->setAlignment(Qt::AlignRight);
    505512                m_pLabelFamily->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    506                 /* Add into layout: */
     513
    507514                m_pMainLayout->addWidget(m_pLabelFamily, iRow, 0);
    508515            }
    509 
    510             int iIconRow = iRow;
    511 
    512             /* Create VM OS family combo: */
    513             m_pComboFamily = new QComboBox;
     516            /* Prepare VM OS family combo: */
     517            m_pComboFamily = new QComboBox(this);
    514518            if (m_pComboFamily)
    515519            {
     
    517521                m_pLabelFamily->setBuddy(m_pComboFamily);
    518522
    519                 /* Add into layout: */
    520523                m_pMainLayout->addWidget(m_pComboFamily, iRow, 1);
    521524            }
    522525
     526            const int iIconRow = iRow;
    523527            ++iRow;
    524528
    525             /* Create VM OS type label: */
    526             m_pLabelType = new QLabel;
     529            /* Prepare VM OS type label: */
     530            m_pLabelType = new QLabel(this);
    527531            if (m_pLabelType)
    528532            {
     
    530534                m_pLabelType->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    531535
    532                 /* Add into layout: */
    533536                m_pMainLayout->addWidget(m_pLabelType, iRow, 0);
    534537            }
    535             /* Create VM OS type combo: */
    536             m_pComboType = new QComboBox;
     538            /* Prepare VM OS type combo: */
     539            m_pComboType = new QComboBox(this);
    537540            if (m_pComboType)
    538541            {
     
    540543                m_pLabelType->setBuddy(m_pComboType);
    541544
    542                 /* Add into layout: */
    543545                m_pMainLayout->addWidget(m_pComboType, iRow, 1);
    544546            }
     
    546548            ++iRow;
    547549
    548             /* Create sub-layout: */
     550            /* Prepare sub-layout: */
    549551            QVBoxLayout *pLayoutIcon = new QVBoxLayout;
    550552            if (pLayoutIcon)
    551553            {
    552                 /* Create VM OS type icon: */
    553                 m_pIconType = new QLabel;
     554                /* Prepare VM OS type icon: */
     555                m_pIconType = new QLabel(this);
    554556                if (m_pIconType)
    555557                {
    556558                    m_pIconType->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    557 
    558                     /* Add into layout: */
    559559                    pLayoutIcon->addWidget(m_pIconType);
    560560                }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp

    r88116 r88148  
    235235QWidget *UIWizardNewVMPage1::createNameOSTypeWidgets()
    236236{
     237    /* Prepare container widget: */
    237238    QWidget *pContainerWidget = new QWidget;
    238     QVBoxLayout *pLayout = new QVBoxLayout(pContainerWidget);
    239     pLayout->setContentsMargins(0, 0, 0, 0);
    240 
    241     /* Prepare Name and OS Type editor: */
    242     m_pNameAndSystemEditor = new UINameAndSystemEditor(0,
    243                                                        true /* fChooseName? */,
    244                                                        true /* fChoosePath? */,
    245                                                        true /* fChooseType? */,
    246                                                        true /* fChooseISOFile? */);
    247     pLayout->addWidget(m_pNameAndSystemEditor);
    248     m_pSkipUnattendedCheckBox = new QCheckBox;
    249     pLayout->addWidget(m_pSkipUnattendedCheckBox);
     239    if (pContainerWidget)
     240    {
     241        /* Prepare layout: */
     242        QVBoxLayout *pLayout = new QVBoxLayout(pContainerWidget);
     243        if (pLayout)
     244        {
     245            pLayout->setContentsMargins(0, 0, 0, 0);
     246
     247            /* Prepare Name and OS Type editor: */
     248            m_pNameAndSystemEditor = new UINameAndSystemEditor(0,
     249                                                               true /* fChooseName? */,
     250                                                               true /* fChoosePath? */,
     251                                                               true /* fChooseType? */,
     252                                                               true /* fChooseISOFile? */);
     253            if (m_pNameAndSystemEditor)
     254                pLayout->addWidget(m_pNameAndSystemEditor);
     255
     256            /* Prepare Skip Unattended checkbox: */
     257            m_pSkipUnattendedCheckBox = new QCheckBox;
     258            if (m_pSkipUnattendedCheckBox)
     259                pLayout->addWidget(m_pSkipUnattendedCheckBox);
     260        }
     261    }
     262
     263    /* Return container widget: */
    250264    return pContainerWidget;
    251265}
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