VirtualBox

Changeset 106084 in vbox


Ignore:
Timestamp:
Sep 18, 2024 6:20:15 PM (7 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164856
Message:

FE/Qt: ​bugref:10765. More layout fixes in Additional Options group box of the new vm wizard.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIHostnameDomainNameEditor.cpp

    r106079 r106084  
    2727
    2828/* Qt includes: */
     29#include <QCheckBox>
    2930#include <QGridLayout>
    3031#include <QLabel>
     
    5657    , m_pProductKeyLabel(0)
    5758    , m_pMainLayout(0)
     59    , m_pStartHeadlessCheckBox(0)
    5860{
    5961    prepare();
     
    127129    if (m_pProductKeyLineEdit)
    128130        m_pProductKeyLineEdit->setToolTip(UIWizardNewVM::tr("Holds the product key."));
     131
     132    if (m_pStartHeadlessCheckBox)
     133    {
     134        m_pStartHeadlessCheckBox->setText(UIWizardNewVM::tr("&Install in Background"));
     135        m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("When checked, headless boot (with no GUI) will be enabled for "
     136                                                               "unattended guest OS installation of newly created virtual machine."));
     137    }
    129138}
    130139
     
    152161{
    153162    m_pMainLayout = new QGridLayout;
    154     m_pMainLayout->setColumnStretch(0, 0);
    155     m_pMainLayout->setColumnStretch(1, 1);
    156163    if (!m_pMainLayout)
    157164        return;
     
    159166    int iRow = 0;
    160167
    161 
    162 
    163168    addLineEdit(iRow, m_pProductKeyLabel, m_pProductKeyLineEdit, m_pMainLayout);
    164169    addLineEdit(iRow, m_pHostnameLabel, m_pHostnameLineEdit, m_pMainLayout);
     
    168173    {
    169174        m_pProductKeyLineEdit->setInputMask(">NNNNN-NNNNN-NNNNN-NNNNN-NNNNN;#");
    170         m_pProductKeyLineEdit->setMinimumWidth(fontMetrics().horizontalAdvance("NNNNN-NNNNN-NNNNN-NNNNN-NNNNN"));
     175        m_pProductKeyLineEdit->setMinimumWidthByText("NNNNN-NNNNN-NNNNN-NNNNN-NNNNN");
    171176    }
    172177
     
    186191    connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
    187192            this, &UIHostnameDomainNameEditor::sltRetranslateUI);
     193
     194    m_pStartHeadlessCheckBox = new QCheckBox;
     195    if (m_pStartHeadlessCheckBox)
     196        m_pMainLayout->addWidget(m_pStartHeadlessCheckBox, iRow, 1, 1, 3);
     197
     198    if (m_pStartHeadlessCheckBox)
     199        connect(m_pStartHeadlessCheckBox, &QCheckBox::toggled,
     200                this, &UIHostnameDomainNameEditor::sigStartHeadlessChanged);
     201
     202    sltRetranslateUI();
    188203}
    189204
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIHostnameDomainNameEditor.h

    r106079 r106084  
    3737
    3838/* Forward declarations: */
     39class QCheckBox;
    3940class QGridLayout;
    4041class QLabel;
     
    5152    void sigHostnameDomainNameChanged(const QString &strHostNameDomain, bool fIsComplete);
    5253    void sigProductKeyChanged(const QString &strProductKey);
     54    void sigStartHeadlessChanged(bool fChecked);
    5355
    5456public:
     
    8890    QLabel *m_pProductKeyLabel;
    8991    QGridLayout *m_pMainLayout;
     92    QCheckBox *m_pStartHeadlessCheckBox;
    9093};
    9194
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardNewVMEditors.cpp

    r106083 r106084  
    225225    : QGroupBox(pParent)
    226226    , m_pHostnameDomainNameEditor(0)
    227     , m_pStartHeadlessCheckBox(0)
    228227{
    229228    prepare();
     
    232231void UIAdditionalUnattendedOptions::prepare()
    233232{
    234     m_pMainLayout = new QGridLayout(this);
    235     m_pMainLayout->setColumnStretch(0, 0);
    236     m_pMainLayout->setColumnStretch(1, 1);
    237 
     233    m_pMainLayout = new QHBoxLayout(this);
    238234    m_pHostnameDomainNameEditor = new UIHostnameDomainNameEditor;
    239235    if (m_pHostnameDomainNameEditor)
    240         m_pMainLayout->addWidget(m_pHostnameDomainNameEditor, 1, 0, 2, 3);
    241 
    242     m_pStartHeadlessCheckBox = new QCheckBox;
    243     if (m_pStartHeadlessCheckBox)
    244         m_pMainLayout->addWidget(m_pStartHeadlessCheckBox, 3, 1);
     236        m_pMainLayout->addWidget(m_pHostnameDomainNameEditor);
    245237
    246238    if (m_pHostnameDomainNameEditor)
     
    250242        connect(m_pHostnameDomainNameEditor, &UIHostnameDomainNameEditor::sigProductKeyChanged,
    251243                this, &UIAdditionalUnattendedOptions::sigProductKeyChanged);
     244        connect(m_pHostnameDomainNameEditor, &UIHostnameDomainNameEditor::sigStartHeadlessChanged,
     245                this, &UIAdditionalUnattendedOptions::sigStartHeadlessChanged);
    252246    }
    253     if (m_pStartHeadlessCheckBox)
    254         connect(m_pStartHeadlessCheckBox, &QCheckBox::toggled,
    255                 this, &UIAdditionalUnattendedOptions::sigStartHeadlessChanged);
    256247
    257248    sltRetranslateUI();
     
    263254{
    264255    setTitle(UIWizardNewVM::tr("Additional Options"));
    265 
    266     if (m_pStartHeadlessCheckBox)
    267     {
    268         m_pStartHeadlessCheckBox->setText(UIWizardNewVM::tr("&Install in Background"));
    269         m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("When checked, headless boot (with no GUI) will be enabled for "
    270                                                                "unattended guest OS installation of newly created virtual machine."));
    271     }
    272256}
    273257
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardNewVMEditors.h

    r106079 r106084  
    3838/* Forward declarations: */
    3939class QCheckBox;
    40 class QGridLayout;
     40class QHBoxLayout;
    4141class QLabel;
    4242class QILineEdit;
     
    152152    void prepare();
    153153
    154 
    155 
    156154    UIHostnameDomainNameEditor *m_pHostnameDomainNameEditor;
    157     QCheckBox *m_pStartHeadlessCheckBox;
    158     QGridLayout *m_pMainLayout;
     155    QHBoxLayout *m_pMainLayout;
    159156};
    160157
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