VirtualBox

Changeset 87073 in vbox


Ignore:
Timestamp:
Dec 9, 2020 5:30:53 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
141845
Message:

FE/Qt: bugref:9515. Banging on the wizard page to make it look a bit better

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

Legend:

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

    r87062 r87073  
    278278}
    279279
    280 void UIWizardNewVMPage1::createNameOSTypeWidgets(QWidget *pContainerWidget, bool fCreateLabels /* = true */)
    281 {
    282     AssertReturnVoid(pContainerWidget);
    283     QGridLayout *pGridLayout = new QGridLayout(pContainerWidget);
    284     AssertReturnVoid(pGridLayout);
    285 
    286     int iLayoutRow = 0;
     280void UIWizardNewVMPage1::createNameOSTypeWidgets(QVBoxLayout *pLayout, bool fCreateLabels /* = true */)
     281{
     282    AssertReturnVoid(pLayout);
     283
    287284    if (fCreateLabels)
    288285    {
    289286        m_pNameOSTypeLabel = new QIRichTextLabel;
    290287        if (m_pNameOSTypeLabel)
    291             pGridLayout->addWidget(m_pNameOSTypeLabel, iLayoutRow++, 0, 1, 3);
     288            pLayout->addWidget(m_pNameOSTypeLabel);
    292289    }
    293290
    294291    m_pNameAndFolderEditor = new UINameAndSystemEditor(0, true, true, false);
    295292    if (m_pNameAndFolderEditor)
    296         pGridLayout->addWidget(m_pNameAndFolderEditor, iLayoutRow++, 1, 1, 2);
     293        pLayout->addWidget(m_pNameAndFolderEditor);
    297294
    298295    if (fCreateLabels)
     
    300297        m_pUnattendedLabel = new QIRichTextLabel;
    301298        if (m_pUnattendedLabel)
    302             pGridLayout->addWidget(m_pUnattendedLabel, iLayoutRow++, 0, 1, 3);
    303     }
    304 
     299            pLayout->addWidget(m_pUnattendedLabel);
     300    }
     301
     302    QGridLayout *pUnattendedInstall = new QGridLayout;
    305303    m_pEnableUnattendedInstallCheckBox = new QCheckBox;
    306     pGridLayout->addWidget(m_pEnableUnattendedInstallCheckBox, iLayoutRow++, 0, 1, 3);
     304    pUnattendedInstall->addWidget(m_pEnableUnattendedInstallCheckBox, 0, 0, 1, 4, Qt::AlignLeft);
    307305
    308306    m_pISOSelectorLabel = new QLabel;
     
    310308    {
    311309        m_pISOSelectorLabel->setAlignment(Qt::AlignRight);
    312         m_pISOSelectorLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
     310        m_pISOSelectorLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
    313311        m_pISOSelectorLabel->setEnabled(false);
    314         pGridLayout->addWidget(m_pISOSelectorLabel, iLayoutRow, 1);
     312        pUnattendedInstall->addWidget(m_pISOSelectorLabel, 1, 0, 1, 1, Qt::AlignRight);
    315313    }
    316314    m_pISOFilePathSelector = new UIFilePathSelector;
     
    320318        m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open);
    321319        m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO");
    322         m_pISOFilePathSelector->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
     320        m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    323321        m_pISOFilePathSelector->setEnabled(false);
    324         pGridLayout->addWidget(m_pISOFilePathSelector, iLayoutRow++, 2);
     322        pUnattendedInstall->addWidget(m_pISOFilePathSelector, 1, 1, 1, 4);
    325323    }
    326324
     
    329327    {
    330328        m_pStartHeadlessCheckBox->setEnabled(false);
    331         pGridLayout->addWidget(m_pStartHeadlessCheckBox, iLayoutRow++, 2);
    332     }
    333 
     329        pUnattendedInstall->addWidget(m_pStartHeadlessCheckBox, 2, 1, 1, 1);
     330    }
     331    pLayout->addLayout(pUnattendedInstall);
    334332    m_pSystemTypeEditor = new UINameAndSystemEditor(0, false, false, true);
    335333    if (m_pSystemTypeEditor)
    336         pGridLayout->addWidget(m_pSystemTypeEditor, iLayoutRow++, 1, 1, 2);
     334        pLayout->addWidget(m_pSystemTypeEditor);
     335
    337336}
    338337
     
    489488
    490489    if (m_pISOSelectorLabel)
    491         m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Installation Medium:"));
     490        m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Installer:"));
    492491
    493492    if (m_pStartHeadlessCheckBox)
     
    507506void UIWizardNewVMPageBasic1::prepare()
    508507{
    509     QWidget *pContainerWidget = new QWidget;
    510508    QVBoxLayout *pPageLayout = new QVBoxLayout(this);
    511     pPageLayout->addWidget(pContainerWidget);
    512     createNameOSTypeWidgets(pContainerWidget, false);
     509    createNameOSTypeWidgets(pPageLayout, false);
    513510    pPageLayout->addStretch();
    514511    createConnections();
     
    606603                                             "to identify this machine."));
    607604
    608     if (   m_pNameAndFolderEditor
    609            && m_pSystemTypeEditor
    610            && m_pISOSelectorLabel)
    611     {
    612         int iMinWidthHint = 0;
    613         iMinWidthHint = qMax(iMinWidthHint, m_pISOSelectorLabel->minimumSizeHint().width());
    614         // m_pNameAndFolderEditor->setMinimumLayoutIndent(iMinWidthHint);
    615         // m_pSystemTypeEditor->setMinimumLayoutIndent(iMinWidthHint);
    616     }
     605    // if (   m_pNameAndFolderEditor
     606    //        && m_pSystemTypeEditor
     607    //        && m_pISOSelectorLabel)
     608    // {
     609    //     int iMinWidthHint = 0;
     610    //     iMinWidthHint = qMax(iMinWidthHint, m_pISOSelectorLabel->minimumSizeHint().width());
     611    //    m_pNameAndFolderEditor->setMinimumLayoutIndent(iMinWidthHint);
     612    //    m_pSystemTypeEditor->setMinimumLayoutIndent(iMinWidthHint);
     613    // }
    617614}
    618615
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h

    r87062 r87073  
    2727/* Forward declarations: */
    2828class QCheckBox;
    29 class QGridLayout;
    3029class QLabel;
    3130class QRadioButton;
     31class QVBoxLayout;
    3232class QIRichTextLabel;
    3333class UIFilePathSelector;
     
    7575    void composeMachineFilePath();
    7676    /** Creates the page widgets and adds them into the @p pGridLayout. */
    77     void createNameOSTypeWidgets(QWidget *pContainerWidget, bool fCreateLabels = true);
     77    void createNameOSTypeWidgets(QVBoxLayout *pLayout, bool fCreateLabels = true);
    7878    void setTypeByISODetectedOSType(const QString &strDetectedOSType);
    7979    /** Colors the widgets red if they cause isComplete to fail. */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r87062 r87073  
    5252        m_pToolBox = new QToolBox;
    5353        m_pNameAndSystemContainer = new QWidget(this);
    54         createNameOSTypeWidgets(m_pNameAndSystemContainer, false);
     54        QVBoxLayout *pNameContainerLayout = new QVBoxLayout(m_pNameAndSystemContainer);
     55        createNameOSTypeWidgets(pNameContainerLayout, false);
    5556        m_pGAInstallContainer = createGAInstallWidgets();
    5657        m_pUsernameHostnameContainer = createUserNameHostNameWidgets();
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