VirtualBox

Ignore:
Timestamp:
Jun 30, 2020 6:40:35 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138898
Message:

FE/Qt: bugref:9515. Adding another wizard page for GA install.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
9 edited
2 copied
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r84969 r85001  
    668668        src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.h \
    669669        src/wizards/newvm/UIWizardNewVM.h \
    670         src/wizards/newvm/UIWizardNewVMPageBasicInstallSetup.h \
     670        src/wizards/newvm/UIWizardNewVMPageBasicUserNameHostname.h \
    671671        src/wizards/newvm/UIWizardNewVMPageBasicUnattended.h \
    672672        src/wizards/newvm/UIWizardNewVMPageBasicNameType.h \
     673        src/wizards/newvm/UIWizardNewVMPageBasicGAInstall.h \
    673674        src/wizards/newvm/UIWizardNewVMPageBasicHardware.h \
    674675        src/wizards/newvm/UIWizardNewVMPageBasicProductKey.h \
     
    11321133        src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp \
    11331134        src/wizards/newvm/UIWizardNewVM.cpp \
    1134         src/wizards/newvm/UIWizardNewVMPageBasicInstallSetup.cpp \
     1135        src/wizards/newvm/UIWizardNewVMPageBasicUserNameHostname.cpp \
    11351136        src/wizards/newvm/UIWizardNewVMPageBasicUnattended.cpp \
    11361137        src/wizards/newvm/UIWizardNewVMPageBasicNameType.cpp \
     1138        src/wizards/newvm/UIWizardNewVMPageBasicGAInstall.cpp \
    11371139        src/wizards/newvm/UIWizardNewVMPageBasicHardware.cpp \
    11381140        src/wizards/newvm/UIWizardNewVMPageBasicProductKey.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r84991 r85001  
    619619        unattendedInstallData.m_fInstallGuestAdditions = comUnattendedInstaller.GetInstallGuestAdditions();
    620620        unattendedInstallData.m_strGuestAdditionsISOPath = comUnattendedInstaller.GetAdditionsIsoPath();
    621 
    622621        pWizard->setDefaultUnattendedInstallData(unattendedInstallData);
    623622
     
    19011900    comUnattendedInstaller.SetHostname(unattendedData.m_strHostname);
    19021901    comUnattendedInstaller.SetProductKey(unattendedData.m_strProductKey);
     1902    comUnattendedInstaller.SetInstallGuestAdditions(unattendedData.m_fInstallGuestAdditions);
     1903    comUnattendedInstaller.SetAdditionsIsoPath(unattendedData.m_strGuestAdditionsISOPath);
    19031904
    19041905    comUnattendedInstaller.Prepare();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r84971 r85001  
    2323#include "UIWizardNewVMPageBasicHardware.h"
    2424#include "UIWizardNewVMPageBasicProductKey.h"
     25#include "UIWizardNewVMPageBasicGAInstall.h"
    2526#include "UIWizardNewVMPageBasicDisk.h"
    2627#include "UIWizardNewVMPageExpert.h"
    27 #include "UIWizardNewVMPageBasicInstallSetup.h"
     28#include "UIWizardNewVMPageBasicUserNameHostname.h"
    2829#include "UIMessageCenter.h"
    2930#include "UIMedium.h"
     
    8384            setPage(PageUnattended, pUnattendedPage);
    8485            setPage(PageNameType, new UIWizardNewVMPageBasicNameType(m_strGroup));
    85             setPage(PageInstallSetup, new UIWizardNewVMPageBasicInstallSetup);
     86            setPage(PageUserNameHostname, new UIWizardNewVMPageBasicUserNameHostname);
     87            setPage(PageGAInstall, new UIWizardNewVMPageBasicGAInstall);
    8688            setPage(PageProductKey, new UIWizardNewVMPageBasicProductKey);
    8789            setPage(PageHardware, new UIWizardNewVMPageBasicHardware);
     
    396398}
    397399
     400bool UIWizardNewVM::getBoolFieldValue(const QString &strFieldName) const
     401{
     402    QVariant fieldValue = field(strFieldName);
     403    if (!fieldValue.isNull() && fieldValue.isValid() && fieldValue.canConvert(QMetaType::Bool))
     404        return fieldValue.toBool();
     405    return false;
     406}
     407
    398408void UIWizardNewVM::sltHandleWizardCancel()
    399409{
     
    510520    setField("password", unattendedInstallData.m_strPassword);
    511521    setField("hostname", unattendedInstallData.m_strHostname);
     522    setField("installGuestAdditions", unattendedInstallData.m_fInstallGuestAdditions);
     523    setField("guestAdditionsISOPath", unattendedInstallData.m_strGuestAdditionsISOPath);
    512524}
    513525
     
    524536    m_unattendedInstallData.m_strDetectedOSHints = getStringFieldValue("detectedOSHints");
    525537    m_unattendedInstallData.m_strProductKey = getStringFieldValue("productKey");
    526 
    527     QVariant fieldValue = field("isUnattendedEnabled");
    528     if (!fieldValue.isNull() && fieldValue.isValid() && fieldValue.canConvert(QMetaType::Bool))
    529         m_unattendedInstallData.m_fUnattendedEnabled = fieldValue.toBool();
    530 
    531     fieldValue = field("startHeadless");
    532     if (!fieldValue.isNull() && fieldValue.isValid() && fieldValue.canConvert(QMetaType::Bool))
    533         m_unattendedInstallData.m_fStartHeadless = fieldValue.toBool();
     538    m_unattendedInstallData.m_strGuestAdditionsISOPath = getStringFieldValue("guestAdditionsISOPath");
     539
     540    m_unattendedInstallData.m_fUnattendedEnabled = getBoolFieldValue("isUnattendedEnabled");
     541    m_unattendedInstallData.m_fStartHeadless = getBoolFieldValue("startHeadless");
     542    m_unattendedInstallData.m_fInstallGuestAdditions = getBoolFieldValue("installGuestAdditions");
    534543
    535544    m_unattendedInstallData.m_uMachineUid = createdMachineId();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r84971 r85001  
    6262        PageUnattended,
    6363        PageNameType,
    64         PageInstallSetup,
     64        PageUserNameHostname,
     65        PageGAInstall,
    6566        PageProductKey,
    6667        PageHardware,
     
    9899
    99100    QString getStringFieldValue(const QString &strFieldName) const;
     101    bool getBoolFieldValue(const QString &strFieldName) const;
    100102
    101103    /* Who will be able to create virtual-machine: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicGAInstall.cpp

    r84965 r85001  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIWizardNewVMPageBasicProductKey class implementation.
     3 * VBox Qt GUI - UIWizardNewVMPageBasicGAInstall class implementation.
    44 */
    55
     
    1717
    1818/* Qt includes: */
    19 #include <QComboBox>
    20 #include <QGridLayout>
     19#include <QCheckBox>
     20#include <QFileInfo>
    2121#include <QLabel>
    2222#include <QLineEdit>
    23 #include <QSpacerItem>
    24 #include <QVBoxLayout>
     23#include <QHBoxLayout>
     24#include <QGridLayout>
    2525
    2626/* GUI includes: */
    2727#include "QIRichTextLabel.h"
    28 #include "UIIconPool.h"
    29 #include "UIWizardNewVMPageBasicProductKey.h"
     28#include "UICommon.h"
     29#include "UIFilePathSelector.h"
     30#include "UIMessageCenter.h"
     31#include "UINameAndSystemEditor.h"
     32#include "UIWizardNewVMPageBasicGAInstall.h"
    3033#include "UIWizardNewVM.h"
    3134
    32 UIWizardNewVMPageProductKey::UIWizardNewVMPageProductKey()
    33     : m_pProductKeyLineEdit(0)
    34     , m_pHostnameLabel(0)
     35/* COM includes: */
     36#include "CHost.h"
     37#include "CUnattended.h"
     38
     39UIWizardNewVMPageGAInstall::UIWizardNewVMPageGAInstall()
     40    : m_pInstallGACheckBox(0)
     41    , m_pISOPathLabel(0)
     42    , m_pISOFilePathSelector(0)
    3543{
    3644}
    3745
    38 QString UIWizardNewVMPageProductKey::productKey() const
     46bool UIWizardNewVMPageGAInstall::installGuestAdditions() const
    3947{
    40     if (!m_pProductKeyLineEdit || !m_pProductKeyLineEdit->hasAcceptableInput())
    41         return QString();
    42     return m_pProductKeyLineEdit->text();
     48    if (!m_pInstallGACheckBox)
     49        return true;
     50    return m_pInstallGACheckBox->isChecked();
    4351}
    4452
     53void UIWizardNewVMPageGAInstall::setInstallGuestAdditions(bool fInstallGA)
     54{
     55    if (m_pInstallGACheckBox)
     56        m_pInstallGACheckBox->setChecked(fInstallGA);
     57}
    4558
    46 UIWizardNewVMPageBasicProductKey::UIWizardNewVMPageBasicProductKey()
    47     : m_pLabel(0)
     59QString UIWizardNewVMPageGAInstall::guestAdditionsISOPath() const
    4860{
    49     /* Create widget: */
     61    if (!m_pISOFilePathSelector)
     62        return QString();
     63    return m_pISOFilePathSelector->path();
     64}
     65
     66void UIWizardNewVMPageGAInstall::setGuestAdditionsISOPath(const QString &strISOPath)
     67{
     68    if (m_pISOFilePathSelector)
     69        m_pISOFilePathSelector->setPath(strISOPath);
     70}
     71
     72UIWizardNewVMPageBasicGAInstall::UIWizardNewVMPageBasicGAInstall()
     73    : UIWizardNewVMPageGAInstall()
     74{
     75    /* Create widgets: */
    5076    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    5177    {
    5278        m_pLabel = new QIRichTextLabel(this);
    53         QGridLayout *pGridLayout = new QGridLayout;
     79        m_pInstallGACheckBox = new QCheckBox;
     80        connect(m_pInstallGACheckBox, &QCheckBox::toggled, this, &UIWizardNewVMPageBasicGAInstall::sltInstallGACheckBoxToggle);
     81        m_pISOPathLabel = new QLabel;
    5482        {
    55             m_pHostnameLabel = new QLabel;
    56             m_pProductKeyLineEdit = new QLineEdit;
    57             m_pProductKeyLineEdit->setInputMask(">NNNNN-NNNNN-NNNNN-NNNNN-NNNNN;#");
    58             pGridLayout->addWidget(m_pHostnameLabel, 3, 0, 1, 1, Qt::AlignRight);
    59             pGridLayout->addWidget(m_pProductKeyLineEdit, 3, 1, 1, 3);
     83            m_pISOPathLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
     84            m_pISOPathLabel->setEnabled(false);
    6085        }
    61         if (m_pLabel)
    62             pMainLayout->addWidget(m_pLabel);
    63         pMainLayout->addLayout(pGridLayout);
     86        m_pISOFilePathSelector = new UIFilePathSelector;
     87        {
     88            m_pISOFilePathSelector->setResetEnabled(false);
     89            m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open);
     90            m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO");
     91            m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
     92            m_pISOFilePathSelector->setEnabled(false);
     93            connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged, this, &UIWizardNewVMPageBasicGAInstall::sltPathChanged);
     94        }
     95        pMainLayout->addWidget(m_pLabel);
     96
     97        QGridLayout *pISOSelectorLayout = new QGridLayout;
     98        pISOSelectorLayout->addWidget(m_pInstallGACheckBox, 0, 0, 1, 5);
     99        pISOSelectorLayout->addWidget(m_pISOPathLabel, 1, 1, 1, 1);
     100        pISOSelectorLayout->addWidget(m_pISOFilePathSelector, 1, 2, 1, 4);
     101
     102        pMainLayout->addLayout(pISOSelectorLayout);
    64103        pMainLayout->addStretch();
    65104    }
    66105
    67106    /* Register fields: */
    68     registerField("productKey", this, "productKey");
     107    registerField("installGuestAdditions", this, "installGuestAdditions");
     108    registerField("guestAdditionsISOPath", this, "guestAdditionsISOPath");
    69109}
    70110
    71 void UIWizardNewVMPageBasicProductKey::retranslateUi()
     111bool UIWizardNewVMPageBasicGAInstall::isComplete() const
     112{
     113    return checkISOFile();
     114}
     115
     116int UIWizardNewVMPageBasicGAInstall::nextId() const
     117{
     118    UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard());
     119    if (!pWizard || !pWizard->isUnattendedInstallEnabled() || !pWizard->isGuestOSTypeWindows())
     120        return UIWizardNewVM::PageHardware;
     121    return UIWizardNewVM::PageProductKey;
     122}
     123
     124void UIWizardNewVMPageBasicGAInstall::sltInstallGACheckBoxToggle(bool fEnabled)
     125{
     126    if (m_pISOPathLabel)
     127        m_pISOPathLabel->setEnabled(fEnabled);
     128    if (m_pISOFilePathSelector)
     129        m_pISOFilePathSelector->setEnabled(fEnabled);
     130    emit completeChanged();
     131}
     132
     133void UIWizardNewVMPageBasicGAInstall::sltPathChanged(const QString &strPath)
     134{
     135    Q_UNUSED(strPath);
     136    emit completeChanged();
     137}
     138
     139void UIWizardNewVMPageBasicGAInstall::retranslateUi()
    72140{
    73141    /* Translate page: */
    74     setTitle(UIWizardNewVM::tr("Product Key"));
     142    setTitle(UIWizardNewVM::tr("Unattended Guest OS Install"));
    75143
    76144    /* Translate widgets: */
    77     if (m_pLabel)
    78         m_pLabel->setText(UIWizardNewVM::tr("<p>You can enter the product key for the guest OS."));
    79     if (m_pHostnameLabel)
    80         m_pHostnameLabel->setText(UIWizardNewVM::tr("Hostname:"));
     145    m_pLabel->setText(UIWizardNewVM::tr("<p>Guest Additions install</p>"));
     146    m_pInstallGACheckBox->setText(UIWizardNewVM::tr("Install guest additions"));
     147    m_pISOPathLabel->setText(UIWizardNewVM::tr("Installation medium:"));
     148    m_pISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)"));
    81149}
    82150
    83 void UIWizardNewVMPageBasicProductKey::initializePage()
     151bool UIWizardNewVMPageGAInstall::checkISOFile() const
     152{
     153    if (m_pInstallGACheckBox && m_pInstallGACheckBox->isChecked())
     154    {
     155        QString strISOFilePath = m_pISOFilePathSelector ? m_pISOFilePathSelector->path() : QString();
     156        if (!QFileInfo(strISOFilePath).exists())
     157            return false;
     158    }
     159    return true;
     160}
     161
     162void UIWizardNewVMPageBasicGAInstall::initializePage()
    84163{
    85164    /* Translate page: */
    86165    retranslateUi();
     166    if (m_pInstallGACheckBox)
     167        m_pInstallGACheckBox->setFocus();
    87168}
    88169
    89 bool UIWizardNewVMPageBasicProductKey::isComplete() const
    90 {
    91     return true;
    92 }
     170// void UIWizardNewVMPageBasicGAInstall::cleanupPage()
     171// {
     172//     UIWizardPage::cleanupPage();
     173// }
     174
     175// bool UIWizardNewVMPageBasicGAInstall::validatePage()
     176// {
     177//     return checkISOFile();
     178// }
     179
     180// void UIWizardNewVMPageBasicGAInstall::updateStatusLabel()
     181// {
     182//     UIWizardNewVMPageGAInstall::updateStatusLabel();
     183//     emit sigDetectedOSTypeChanged();
     184// }
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicGAInstall.h

    r84965 r85001  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIWizardNewVMPageBasicProductKey class declaration.
     3 * VBox Qt GUI - UIWizardNewVMPageBasicGAInstall class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicProductKey_h
    19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicProductKey_h
     18#ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicGAInstall_h
     19#define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicGAInstall_h
    2020#ifndef RT_WITHOUT_PRAGMA_ONCE
    2121# pragma once
     
    2828
    2929/* Forward declarations: */
     30class QCheckBox;
    3031class QLabel;
    3132class QLineEdit;
    3233class QIRichTextLabel;
     34class UIFilePathSelector;
    3335
    34 class UIWizardNewVMPageProductKey : public UIWizardPageBase
     36class UIWizardNewVMPageGAInstall : public UIWizardPageBase
    3537{
    3638public:
    3739
    38     UIWizardNewVMPageProductKey();
     40    UIWizardNewVMPageGAInstall();
    3941
    4042    /** @name Property getters
    4143      * @{ */
    42     QString productKey() const;
     44        QString productKey() const;
     45        bool installGuestAdditions() const;
     46        void setInstallGuestAdditions(bool fInstallGA);
     47        QString guestAdditionsISOPath() const;
     48        void setGuestAdditionsISOPath(const QString &strISOPath);
    4349    /** @} */
    4450
    4551protected:
    4652
    47     /* Widgets: */
    48     QLineEdit *m_pProductKeyLineEdit;
    49     QLabel  *m_pHostnameLabel;
     53    bool checkISOFile() const;
     54
     55    /** @name Widgets
     56      * @{ */
     57        QCheckBox *m_pInstallGACheckBox;
     58        QLabel  *m_pISOPathLabel;
     59        UIFilePathSelector *m_pISOFilePathSelector;
     60    /** @} */
     61
    5062};
    5163
    52 /* 2nd page of the New Virtual Machine wizard (basic extension): */
    53 class UIWizardNewVMPageBasicProductKey : public UIWizardPage, public UIWizardNewVMPageProductKey
     64class UIWizardNewVMPageBasicGAInstall : public UIWizardPage, public UIWizardNewVMPageGAInstall
    5465{
    5566    Q_OBJECT;
    56     Q_PROPERTY(QString productKey READ productKey);
     67    Q_PROPERTY(bool installGuestAdditions READ installGuestAdditions WRITE setInstallGuestAdditions);
     68    Q_PROPERTY(QString guestAdditionsISOPath READ guestAdditionsISOPath WRITE setGuestAdditionsISOPath);
    5769
    5870public:
    5971
    60     /* Constructor: */
    61     UIWizardNewVMPageBasicProductKey();
     72    UIWizardNewVMPageBasicGAInstall();
     73    virtual int nextId() const /* override */;
    6274
    6375private slots:
    6476
     77    void sltInstallGACheckBoxToggle(bool fChecked);
     78    void sltPathChanged(const QString &strPath);
     79
    6580private:
    6681
    67     /* Translation stuff: */
    6882    void retranslateUi();
    69 
    70     /* Prepare stuff: */
    7183    void initializePage();
    72 
    73     /* Validation stuff: */
    7484    bool isComplete() const;
    7585
    76     /* Widgets: */
    7786    QIRichTextLabel *m_pLabel;
    7887};
    7988
    80 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicProductKey_h */
     89#endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicGAInstall_h */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicNameType.cpp

    r84961 r85001  
    358358    if (!pWizard || !pWizard->isUnattendedInstallEnabled())
    359359        return UIWizardNewVM::PageHardware;
    360     return UIWizardNewVM::PageInstallSetup;
     360    return UIWizardNewVM::PageUserNameHostname;
    361361}
    362362
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicProductKey.cpp

    r84965 r85001  
    4747    : m_pLabel(0)
    4848{
    49     /* Create widget: */
    5049    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    5150    {
     
    6564    }
    6665
    67     /* Register fields: */
    6866    registerField("productKey", this, "productKey");
    6967}
     
    7169void UIWizardNewVMPageBasicProductKey::retranslateUi()
    7270{
    73     /* Translate page: */
    7471    setTitle(UIWizardNewVM::tr("Product Key"));
    7572
    76     /* Translate widgets: */
    7773    if (m_pLabel)
    7874        m_pLabel->setText(UIWizardNewVM::tr("<p>You can enter the product key for the guest OS."));
     
    8379void UIWizardNewVMPageBasicProductKey::initializePage()
    8480{
    85     /* Translate page: */
    8681    retranslateUi();
    8782}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicProductKey.h

    r84965 r85001  
    4040    /** @name Property getters
    4141      * @{ */
    42     QString productKey() const;
     42        QString productKey() const;
    4343    /** @} */
    4444
    4545protected:
    4646
    47     /* Widgets: */
    48     QLineEdit *m_pProductKeyLineEdit;
    49     QLabel  *m_pHostnameLabel;
     47    /** @name Widgets
     48      * @{ */
     49        QLineEdit *m_pProductKeyLineEdit;
     50        QLabel  *m_pHostnameLabel;
     51    /** @} */
     52
    5053};
    5154
    52 /* 2nd page of the New Virtual Machine wizard (basic extension): */
    5355class UIWizardNewVMPageBasicProductKey : public UIWizardPage, public UIWizardNewVMPageProductKey
    5456{
     
    5860public:
    5961
    60     /* Constructor: */
    6162    UIWizardNewVMPageBasicProductKey();
    6263
     
    6566private:
    6667
    67     /* Translation stuff: */
    6868    void retranslateUi();
    69 
    70     /* Prepare stuff: */
    7169    void initializePage();
    72 
    73     /* Validation stuff: */
    7470    bool isComplete() const;
    7571
    76     /* Widgets: */
    7772    QIRichTextLabel *m_pLabel;
    7873};
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicUnattended.cpp

    r84961 r85001  
    3535/* COM includes: */
    3636#include "CHost.h"
    37 #include "CSystemProperties.h"
    3837#include "CUnattended.h"
    3938
     
    167166        pISOSelectorLayout->addWidget(m_pISOSelectorLabel, 1, 1, 1, 1);
    168167        pISOSelectorLayout->addWidget(m_pISOFilePathSelector, 1, 2, 1, 4);
    169         pISOSelectorLayout->addWidget(m_pStartHeadlessCheckBox, 2, 2, 1, 5);
    170         pISOSelectorLayout->addWidget(m_pStatusLabel, 3, 2, 1, 5);
     168        pISOSelectorLayout->addWidget(m_pStartHeadlessCheckBox, 2, 2, 1, 1);
     169        pISOSelectorLayout->addWidget(m_pStatusLabel, 3, 2, 1, 1);
    171170
    172171        pMainLayout->addLayout(pISOSelectorLayout);
     
    218217    m_pLabel->setText(UIWizardNewVM::tr("You can enable the unattended (automated) guest OS install "
    219218                                        "and select an installation medium. The guest OS will be "
    220                                         "installed after this window is closed. "));
     219                                        "installed after this wizard is closed. "));
    221220    m_pUnattendedCheckBox->setText(UIWizardNewVM::tr("Enable unattended guest OS Install"));
    222221    m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Installation medium:"));
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicUnattended.h

    r84955 r85001  
    3232class UIFilePathSelector;
    3333
    34 /* 1st page of the New Virtual Machine wizard (base part): */
    3534class UIWizardNewVMPageUnattended : public UIWizardPageBase
    3635{
     
    9998public:
    10099
    101     /* Constructor: */
    102100    UIWizardNewVMPageBasicUnattended();
    103101    virtual bool isComplete() const; /* override */
     
    105103protected:
    106104
    107     /* Wrapper to access 'this' from base part: */
    108105    UIWizardPage* thisImp() { return this; }
    109106    virtual void updateStatusLabel();
     
    118115    /** Returns false if user selects unattended install and does not provide a valid ISO file path. Else returns true. */
    119116    bool checkISOFile() const;
    120 
    121     /* Translation stuff: */
    122117    void retranslateUi();
    123 
    124     /* Prepare stuff: */
    125118    void initializePage();
    126119    void cleanupPage();
    127 
    128     /* Validation stuff: */
    129120    virtual bool validatePage() /* override */;
    130121
    131     /* Widgets: */
    132122    QIRichTextLabel *m_pLabel;
    133123};
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicUserNameHostname.cpp

    r85000 r85001  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIWizardNewVMPageBasicInstallSetup class implementation.
     3 * VBox Qt GUI - UIWizardNewVMPageBasicUserNameHostname class implementation.
    44 */
    55
     
    2424#include "QIRichTextLabel.h"
    2525#include "UIUserNamePasswordEditor.h"
    26 #include "UIWizardNewVMPageBasicInstallSetup.h"
     26#include "UIWizardNewVMPageBasicUserNameHostname.h"
    2727#include "UIWizardNewVM.h"
    2828
    2929
    30 UIWizardNewVMPageInstallSetup::UIWizardNewVMPageInstallSetup()
     30UIWizardNewVMPageUserNameHostname::UIWizardNewVMPageUserNameHostname()
    3131    : m_pUserNamePasswordEditor(0)
    3232    , m_pHostnameLineEdit(0)
     
    3535}
    3636
    37 QString UIWizardNewVMPageInstallSetup::userName() const
     37QString UIWizardNewVMPageUserNameHostname::userName() const
    3838{
    3939    if (m_pUserNamePasswordEditor)
     
    4242}
    4343
    44 void UIWizardNewVMPageInstallSetup::setUserName(const QString &strName)
     44void UIWizardNewVMPageUserNameHostname::setUserName(const QString &strName)
    4545{
    4646    if (m_pUserNamePasswordEditor)
     
    4848}
    4949
    50 QString UIWizardNewVMPageInstallSetup::password() const
     50QString UIWizardNewVMPageUserNameHostname::password() const
    5151{
    5252    if (m_pUserNamePasswordEditor)
     
    5555}
    5656
    57 void UIWizardNewVMPageInstallSetup::setPassword(const QString &strPassword)
     57void UIWizardNewVMPageUserNameHostname::setPassword(const QString &strPassword)
    5858{
    5959    if (m_pUserNamePasswordEditor)
     
    6161}
    6262
    63 QString UIWizardNewVMPageInstallSetup::hostname() const
     63QString UIWizardNewVMPageUserNameHostname::hostname() const
    6464{
    6565    if (m_pHostnameLineEdit)
     
    6868}
    6969
    70 void UIWizardNewVMPageInstallSetup::setHostname(const QString &strHostName)
     70void UIWizardNewVMPageUserNameHostname::setHostname(const QString &strHostName)
    7171{
    7272    if (m_pHostnameLineEdit)
     
    7474}
    7575
    76 UIWizardNewVMPageBasicInstallSetup::UIWizardNewVMPageBasicInstallSetup()
     76UIWizardNewVMPageBasicUserNameHostname::UIWizardNewVMPageBasicUserNameHostname()
    7777    : m_pLabel(0)
    7878{
    79     /* Create widget: */
    8079    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
    8180    {
     
    8685            pGridLayout->addWidget(m_pUserNamePasswordEditor, 0, 0, 3, 4);
    8786            connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged,
    88                     this, &UIWizardNewVMPageBasicInstallSetup::completeChanged);
     87                    this, &UIWizardNewVMPageBasicUserNameHostname::completeChanged);
    8988            m_pHostnameLabel = new QLabel;
    9089            m_pHostnameLineEdit = new QLineEdit;
     
    9897    }
    9998
    100     /* Register fields: */
    10199    registerField("userName", this, "userName");
    102100    registerField("password", this, "password");
     
    104102}
    105103
    106 void UIWizardNewVMPageBasicInstallSetup::retranslateUi()
     104void UIWizardNewVMPageBasicUserNameHostname::retranslateUi()
    107105{
    108     /* Translate page: */
    109106    setTitle(UIWizardNewVM::tr("User Name/Password and Hostname Settings"));
    110 
    111     /* Translate widgets: */
    112107    if (m_pLabel)
    113108        m_pLabel->setText(UIWizardNewVM::tr("<p>Here you can specify the user name/password and hostname. "
     
    117112}
    118113
    119 void UIWizardNewVMPageBasicInstallSetup::initializePage()
     114void UIWizardNewVMPageBasicUserNameHostname::initializePage()
    120115{
    121     /* Translate page: */
    122116    retranslateUi();
    123117}
    124118
    125 bool UIWizardNewVMPageBasicInstallSetup::isComplete() const
     119bool UIWizardNewVMPageBasicUserNameHostname::isComplete() const
    126120{
    127121    if (m_pUserNamePasswordEditor)
     
    130124}
    131125
    132 int UIWizardNewVMPageBasicInstallSetup::nextId() const
     126void UIWizardNewVMPageBasicUserNameHostname::cleanupPage()
    133127{
    134     UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard());
    135     if (!pWizard || !pWizard->isUnattendedInstallEnabled() || !pWizard->isGuestOSTypeWindows())
    136         return UIWizardNewVM::PageHardware;
    137     return UIWizardNewVM::PageProductKey;
    138128}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicUserNameHostname.h

    r85000 r85001  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIWizardNewVMPageBasicInstallSetup class declaration.
     3 * VBox Qt GUI - UIWizardNewVMPageBasicUserNameHostname class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicInstallSetup_h
    19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicInstallSetup_h
     18#ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicUserNameHostname_h
     19#define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicUserNameHostname_h
    2020#ifndef RT_WITHOUT_PRAGMA_ONCE
    2121# pragma once
     
    3535
    3636
    37 class UIWizardNewVMPageInstallSetup : public UIWizardPageBase
     37class UIWizardNewVMPageUserNameHostname : public UIWizardPageBase
    3838{
    3939public:
    4040
    41     UIWizardNewVMPageInstallSetup();
     41    UIWizardNewVMPageUserNameHostname();
    4242
    4343    /** @name Property getters/setters
     
    5353protected:
    5454
    55     /* Widgets: */
    5655    UIUserNamePasswordEditor *m_pUserNamePasswordEditor;
    5756    QLineEdit *m_pHostnameLineEdit;
     
    5958};
    6059
    61 class UIWizardNewVMPageBasicInstallSetup : public UIWizardPage, public UIWizardNewVMPageInstallSetup
     60class UIWizardNewVMPageBasicUserNameHostname : public UIWizardPage, public UIWizardNewVMPageUserNameHostname
    6261{
    6362    Q_OBJECT;
     
    6867public:
    6968
    70     /* Constructor: */
    71     UIWizardNewVMPageBasicInstallSetup();
    72     virtual int nextId() const /* override */;
     69    UIWizardNewVMPageBasicUserNameHostname();
    7370
    7471private slots:
     
    7673private:
    7774
    78     /* Translation stuff: */
    7975    void retranslateUi();
    80 
    81     /* Prepare stuff: */
    8276    void initializePage();
    83 
    84     /* Validation stuff: */
    8577    bool isComplete() const;
    8678
    87     /* Widgets: */
     79    /** Override the default behavior which resets the fields to proginal values. */
     80    void cleanupPage() /* override */;
     81
    8882    QIRichTextLabel *m_pLabel;
    8983};
    9084
    91 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicInstallSetup_h */
     85#endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicUserNameHostname_h */
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