VirtualBox

Changeset 85090 in vbox


Ignore:
Timestamp:
Jul 7, 2020 5:20:27 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9515. Still kicking the expert mode page.

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

Legend:

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

    r85081 r85090  
    187187    , m_pStartHeadlessCheckBox(0)
    188188    , m_pNameAndSystemEditor(0)
     189    , m_pUnattendedLabel(0)
     190    , m_pNameOSTypeLabel(0)
    189191    , m_strGroup(strGroup)
    190192{
     
    281283}
    282284
    283 void UIWizardNewVMPage1::createWidgets(QGridLayout *pGridLayout)
     285void UIWizardNewVMPage1::createNameOSTypeWidgets(QGridLayout *pGridLayout, bool fCreateLabels /* = true */)
    284286{
    285287    if (pGridLayout)
    286288    {
    287         m_pLabel1 = new QIRichTextLabel;
    288         if (m_pLabel1)
    289             pGridLayout->addWidget(m_pLabel1, 0, 0, 1, 3);
     289        if (fCreateLabels)
     290        {
     291            m_pUnattendedLabel = new QIRichTextLabel;
     292            if (m_pUnattendedLabel)
     293                pGridLayout->addWidget(m_pUnattendedLabel, 0, 0, 1, 3);
     294        }
    290295
    291296        m_pButtonGroup = new QButtonGroup;
     
    347352        }
    348353
    349         m_pLabel2 = new QIRichTextLabel;
    350         if (m_pLabel2)
    351             pGridLayout->addWidget(m_pLabel2, 5, 0, 1, 3);
     354        if (fCreateLabels)
     355        {
     356            m_pNameOSTypeLabel = new QIRichTextLabel;
     357            if (m_pNameOSTypeLabel)
     358                pGridLayout->addWidget(m_pNameOSTypeLabel, 5, 0, 1, 3);
     359        }
    352360
    353361        m_pNameAndSystemEditor = new UINameAndSystemEditor(0, true, true, true);
     
    488496{
    489497    QGridLayout *pMainLayout = new QGridLayout(this);;
    490     createWidgets(pMainLayout);
     498    createNameOSTypeWidgets(pMainLayout);
    491499    createConnections();
    492500    /* Register fields: */
     
    521529}
    522530
    523 void UIWizardNewVMPageBasic1::setTypeByISODetectedOSType(const QString &strDetectedOSType)
     531void UIWizardNewVMPage1::setTypeByISODetectedOSType(const QString &strDetectedOSType)
    524532{
    525533    if (!strDetectedOSType.isEmpty())
     
    570578    if (m_pStartHeadlessCheckBox)
    571579        m_pStartHeadlessCheckBox->setEnabled(fEnabled);
    572     // if (m_pStatusLabel)
    573     //     m_pStatusLabel->setEnabled(fEnabled);
    574580    emit completeChanged();
    575581}
     
    581587    setTitle(UIWizardNewVM::tr("Virtual machine name and operating system"));
    582588
    583     if (m_pLabel1)
    584         m_pLabel1->setText(UIWizardNewVM::tr("Please choose whether you want to start an unattended guest os install "
     589    if (m_pUnattendedLabel)
     590        m_pUnattendedLabel->setText(UIWizardNewVM::tr("Please choose whether you want to start an unattended guest os install "
    585591                                             "in which case you will have to select a valid installation medium. If not "
    586592                                             "your virtual disk will have an empty virtual hard disk. "
     
    609615    }
    610616
    611     if (m_pLabel2)
    612         m_pLabel2->setText(UIWizardNewVM::tr("Please choose a descriptive name and destination folder for the new virtual machine "
     617    if (m_pNameOSTypeLabel)
     618        m_pNameOSTypeLabel->setText(UIWizardNewVM::tr("Please choose a descriptive name and destination folder for the new virtual machine "
    613619                                             "and select the type of operating system you intend to install on it. "
    614620                                             "The name you choose will be used throughout VirtualBox "
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h

    r85079 r85090  
    7777    bool checkISOFile() const;
    7878    /** Creates the page widgets and adds them into the @p pGridLayout. */
    79     void createWidgets(QGridLayout *pGridLayout);
     79    void createNameOSTypeWidgets(QGridLayout *pGridLayout, bool fCreateLabels = true);
     80    void setTypeByISODetectedOSType(const QString &strDetectedOSType);
    8081
    8182    /** @name Widgets
     
    9596       /** Provides a path selector and a line edit field for path and name entry. */
    9697       UINameAndSystemEditor *m_pNameAndSystemEditor;
    97        QIRichTextLabel *m_pLabel1;
    98        QIRichTextLabel *m_pLabel2;
     98       QIRichTextLabel *m_pUnattendedLabel;
     99       QIRichTextLabel *m_pNameOSTypeLabel;
    99100       QButtonGroup *m_pButtonGroup;
    100101    /** @} */
     
    143144    UIWizardNewVMPageBasic1(const QString &strGroup);
    144145    virtual int nextId() const /* override */;
    145     void setTypeByISODetectedOSType(const QString &strDetectedOSType);
    146146    virtual bool isComplete() const; /* override */
    147147
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.cpp

    r85071 r85090  
    3434
    3535UIWizardNewVMPage2::UIWizardNewVMPage2()
    36     : m_pToolBox(0)
    37     , m_pUserNamePasswordEditor(0)
     36    : m_pUserNamePasswordEditor(0)
    3837    , m_pHostnameLineEdit(0)
    3938    , m_pHostnameLabel(0)
    4039    , m_pInstallGACheckBox(0)
    41     , m_pISOPathLabel(0)
    42     , m_pISOFilePathSelector(0)
     40    , m_pGAISOPathLabel(0)
     41    , m_pGAISOFilePathSelector(0)
    4342    , m_pProductKeyLineEdit(0)
    4443    , m_pProductKeyLabel(0)
     
    101100QString UIWizardNewVMPage2::guestAdditionsISOPath() const
    102101{
    103     if (!m_pISOFilePathSelector)
     102    if (!m_pGAISOFilePathSelector)
    104103        return QString();
    105     return m_pISOFilePathSelector->path();
     104    return m_pGAISOFilePathSelector->path();
    106105}
    107106
    108107void UIWizardNewVMPage2::setGuestAdditionsISOPath(const QString &strISOPath)
    109108{
    110     if (m_pISOFilePathSelector)
    111         m_pISOFilePathSelector->setPath(strISOPath);
     109    if (m_pGAISOFilePathSelector)
     110        m_pGAISOFilePathSelector->setPath(strISOPath);
    112111}
    113112
     
    121120QWidget *UIWizardNewVMPage2::createUserNameHostNameWidgets()
    122121{
    123     if (!m_pToolBox)
    124         return 0;
    125122    QWidget *pContainer = new QWidget;
    126123    QGridLayout *pGridLayout = new QGridLayout(pContainer);
     
    138135QWidget *UIWizardNewVMPage2::createGAInstallWidgets()
    139136{
    140     if (!m_pToolBox)
    141         return 0;
    142137    QWidget *pContainer = new QWidget;
    143138    QGridLayout *pContainerLayout = new QGridLayout(pContainer);
     
    145140
    146141    m_pInstallGACheckBox = new QCheckBox;
    147     m_pISOPathLabel = new QLabel;
    148     {
    149         m_pISOPathLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
    150         m_pISOPathLabel->setEnabled(false);
    151     }
    152     m_pISOFilePathSelector = new UIFilePathSelector;
    153     {
    154         m_pISOFilePathSelector->setResetEnabled(false);
    155         m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open);
    156         m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO");
    157         m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
    158         m_pISOFilePathSelector->setEnabled(false);
     142    m_pGAISOPathLabel = new QLabel;
     143    {
     144        m_pGAISOPathLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
     145        m_pGAISOPathLabel->setEnabled(false);
     146    }
     147    m_pGAISOFilePathSelector = new UIFilePathSelector;
     148    {
     149        m_pGAISOFilePathSelector->setResetEnabled(false);
     150        m_pGAISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open);
     151        m_pGAISOFilePathSelector->setFileDialogFilters("*.iso *.ISO");
     152        m_pGAISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
     153        m_pGAISOFilePathSelector->setEnabled(false);
    159154    }
    160155
    161156    pContainerLayout->addWidget(m_pInstallGACheckBox, 0, 0, 1, 5);
    162     pContainerLayout->addWidget(m_pISOPathLabel, 1, 1, 1, 1);
    163     pContainerLayout->addWidget(m_pISOFilePathSelector, 1, 2, 1, 4);
     157    pContainerLayout->addWidget(m_pGAISOPathLabel, 1, 1, 1, 1);
     158    pContainerLayout->addWidget(m_pGAISOFilePathSelector, 1, 2, 1, 4);
    164159    return pContainer;
    165160}
     
    167162QWidget *UIWizardNewVMPage2::createProductKeyWidgets()
    168163{
    169     if (!m_pToolBox)
    170         return 0;
    171164    QWidget *pContainer = new QWidget;
    172165    QGridLayout *pGridLayout = new QGridLayout(pContainer);
     
    185178    if (m_pInstallGACheckBox && m_pInstallGACheckBox->isChecked())
    186179    {
    187         QString strISOFilePath = m_pISOFilePathSelector ? m_pISOFilePathSelector->path() : QString();
     180        QString strISOFilePath = m_pGAISOFilePathSelector ? m_pGAISOFilePathSelector->path() : QString();
    188181        if (!QFileInfo(strISOFilePath).exists())
    189182            return false;
     
    194187UIWizardNewVMPageBasic2::UIWizardNewVMPageBasic2()
    195188    : m_pLabel(0)
     189    , m_pToolBox(0)
    196190{
    197191    prepare();
     
    237231        connect(m_pInstallGACheckBox, &QCheckBox::toggled, this,
    238232                &UIWizardNewVMPageBasic2::sltInstallGACheckBoxToggle);
    239     if (m_pISOFilePathSelector)
    240         connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged,
     233    if (m_pGAISOFilePathSelector)
     234        connect(m_pGAISOFilePathSelector, &UIFilePathSelector::pathChanged,
    241235                this, &UIWizardNewVMPageBasic2::sltGAISOPathChanged);
    242236}
     
    259253    if (m_pInstallGACheckBox)
    260254        m_pInstallGACheckBox->setText(UIWizardNewVM::tr("Install guest additions"));
    261     if (m_pISOPathLabel)
    262         m_pISOPathLabel->setText(UIWizardNewVM::tr("Installation medium:"));
    263     if (m_pISOFilePathSelector)
    264         m_pISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)"));
     255    if (m_pGAISOPathLabel)
     256        m_pGAISOPathLabel->setText(UIWizardNewVM::tr("Installation medium:"));
     257    if (m_pGAISOFilePathSelector)
     258        m_pGAISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)"));
    265259    if (m_pProductKeyLabel)
    266260        m_pProductKeyLabel->setText(UIWizardNewVM::tr("Product Key:"));
     
    296290}
    297291
    298 
    299292void UIWizardNewVMPageBasic2::sltInstallGACheckBoxToggle(bool fEnabled)
    300293{
    301     if (m_pISOPathLabel)
    302         m_pISOPathLabel->setEnabled(fEnabled);
    303     if (m_pISOFilePathSelector)
    304         m_pISOFilePathSelector->setEnabled(fEnabled);
     294    if (m_pGAISOPathLabel)
     295        m_pGAISOPathLabel->setEnabled(fEnabled);
     296    if (m_pGAISOFilePathSelector)
     297        m_pGAISOFilePathSelector->setEnabled(fEnabled);
    305298    emit completeChanged();
    306299}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.h

    r85067 r85090  
    7575    /** @name Widgets
    7676      * @{ */
    77         QToolBox *m_pToolBox;
    7877        UIUserNamePasswordEditor *m_pUserNamePasswordEditor;
    7978        QLineEdit *m_pHostnameLineEdit;
     
    8180        /** Guest additions iso selection widgets. */
    8281        QCheckBox *m_pInstallGACheckBox;
    83         QLabel  *m_pISOPathLabel;
    84         UIFilePathSelector *m_pISOFilePathSelector;
     82        QLabel  *m_pGAISOPathLabel;
     83        UIFilePathSelector *m_pGAISOFilePathSelector;
    8584        /** Product key stuff. */
    8685        QLineEdit *m_pProductKeyLineEdit;
     
    127126
    128127    QIRichTextLabel *m_pLabel;
     128    QToolBox *m_pToolBox;
    129129};
    130130
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp

    r85081 r85090  
    3939UIWizardNewVMPage3::UIWizardNewVMPage3()
    4040    : m_fRecommendedNoDisk(false)
    41     , m_pToolBox(0)
    4241    , m_pDiskSkip(0)
    4342    , m_pDiskCreate(0)
     
    201200
    202201UIWizardNewVMPageBasic3::UIWizardNewVMPageBasic3()
     202    : m_pLabel(0)
     203    , m_pToolBox(0)
    203204{
    204205    prepare();
     
    295296    retranslateUi();
    296297
    297     /* Prepare initial choice: */
     298    /* Prepare initial disk choice: */
    298299    if (field("type").value<CGuestOSType>().GetRecommendedHDD() != 0)
    299300    {
    300         m_pDiskCreate->setFocus();
    301         m_pDiskCreate->setChecked(true);
     301        if (m_pDiskCreate)
     302        {
     303            m_pDiskCreate->setFocus();
     304            m_pDiskCreate->setChecked(true);
     305        }
    302306        m_fRecommendedNoDisk = false;
    303307    }
    304308    else
    305309    {
    306         m_pDiskSkip->setFocus();
    307         m_pDiskSkip->setChecked(true);
     310        if (m_pDiskSkip)
     311        {
     312            m_pDiskSkip->setFocus();
     313            m_pDiskSkip->setChecked(true);
     314        }
    308315        m_fRecommendedNoDisk = true;
    309316    }
    310     m_pDiskSelector->setCurrentIndex(0);
     317    if (m_pDiskSelector)
     318        m_pDiskSelector->setCurrentIndex(0);
    311319}
    312320
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.h

    r85067 r85090  
    9696    /** @name Widgets
    9797     * @{ */
    98        QToolBox     *m_pToolBox;
    9998       QRadioButton *m_pDiskSkip;
    10099       QRadioButton *m_pDiskCreate;
     
    155154    /** Widgets. */
    156155    QIRichTextLabel *m_pLabel;
     156    QToolBox     *m_pToolBox;
    157157};
    158158
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r85081 r85090  
    1717
    1818/* Qt includes: */
     19#include <QButtonGroup>
     20#include <QCheckBox>
    1921#include <QGridLayout>
    20 #include <QGroupBox>
    2122#include <QHBoxLayout>
    2223#include <QLabel>
    23 #include <QLineEdit>
    2424#include <QRadioButton>
    2525#include <QSpacerItem>
     
    2929
    3030/* GUI includes: */
     31#include "QIRichTextLabel.h"
    3132#include "QIToolButton.h"
    3233#include "UIBaseMemorySlider.h"
    3334#include "UIBaseMemoryEditor.h"
     35#include "UIFilePathSelector.h"
    3436#include "UIIconPool.h"
    3537#include "UIMediaComboBox.h"
    3638#include "UIMedium.h"
    3739#include "UINameAndSystemEditor.h"
     40#include "UIUserNamePasswordEditor.h"
    3841#include "UIWizardNewVM.h"
    3942#include "UIWizardNewVMPageExpert.h"
     
    4245UIWizardNewVMPageExpert::UIWizardNewVMPageExpert(const QString &strGroup)
    4346    : UIWizardNewVMPage1(strGroup)
    44     , m_pNameAndSystemCnt(0)
    45     , m_pMemoryCnt(0)
    46     , m_pDiskCnt(0)
     47    , m_pNameAndSystemContainer(0)
    4748    , m_pToolBox(0)
    4849{
     
    5152    {
    5253        m_pToolBox = new QToolBox;
    53         m_pNameAndSystemCnt = new QWidget(this);
    54         {
    55             m_pNameAndSystemCnt->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
    56             QHBoxLayout *pNameAndSystemCntLayout = new QHBoxLayout(m_pNameAndSystemCnt);
    57             {
    58                 m_pNameAndSystemEditor = new UINameAndSystemEditor(m_pNameAndSystemCnt, true, true, true);
    59                 pNameAndSystemCntLayout->addWidget(m_pNameAndSystemEditor);
    60             }
    61         }
    62 
    63         pMainLayout->addWidget(m_pToolBox);
    64         m_pToolBox->insertItem(ExpertToolboxItems_NameAnsOSType, m_pNameAndSystemCnt, "");
     54        m_pNameAndSystemContainer = new QWidget(this);
     55        QGridLayout *pNameContainerLayout = new QGridLayout(m_pNameAndSystemContainer);
     56        createNameOSTypeWidgets(pNameContainerLayout, false);
     57        m_pToolBox->insertItem(ExpertToolboxItems_NameAndOSType, m_pNameAndSystemContainer, "");
     58        m_pToolBox->insertItem(ExpertToolboxItems_UsernameHostname, createUserNameHostNameWidgets(), "");
     59        m_pToolBox->insertItem(ExpertToolboxItems_GAInstall, createGAInstallWidgets(), "");
     60        m_pToolBox->insertItem(ExpertToolboxItems_ProductKey, createProductKeyWidgets(), "");
    6561        m_pToolBox->insertItem(ExpertToolboxItems_Disk, createDiskWidgets(), "");
    6662        m_pToolBox->insertItem(ExpertToolboxItems_Hardware, createHardwareWidgets(), "");
    67 
     63        pMainLayout->addWidget(m_pToolBox);
    6864        pMainLayout->addStretch();
    6965        updateVirtualDiskSource();
    7066    }
    7167
    72     /* Setup connections: */
    73     connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged,
    74             this, &UIWizardNewVMPageExpert::sltNameChanged);
    75     connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged,
    76             this, &UIWizardNewVMPageExpert::sltPathChanged);
    77     connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged,
    78             this, &UIWizardNewVMPageExpert::sltOsTypeChanged);
    79     connect(m_pDiskSkip, &QRadioButton::toggled,
    80             this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged);
    81     connect(m_pDiskCreate, &QRadioButton::toggled,
    82             this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged);
    83     connect(m_pDiskPresent, &QRadioButton::toggled,
    84             this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged);
    85     connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged),
    86             this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged);
    87     connect(m_pVMMButton, &QIToolButton::clicked,
    88             this, &UIWizardNewVMPageExpert::sltGetWithFileOpenDialog);
     68    createConnections();
    8969
    9070    /* Register classes: */
     
    10080    registerField("virtualDiskId", this, "virtualDiskId");
    10181    registerField("virtualDiskLocation", this, "virtualDiskLocation");
     82    registerField("guestOSFamiyId", this, "guestOSFamiyId");
     83    registerField("ISOFilePath", this, "ISOFilePath");
     84    registerField("isUnattendedEnabled", this, "isUnattendedEnabled");
     85    registerField("startHeadless", this, "startHeadless");
     86    registerField("detectedOSTypeId", this, "detectedOSTypeId");
     87    registerField("userName", this, "userName");
     88    registerField("password", this, "password");
     89    registerField("hostname", this, "hostname");
     90    registerField("installGuestAdditions", this, "installGuestAdditions");
     91    registerField("guestAdditionsISOPath", this, "guestAdditionsISOPath");
     92    registerField("productKey", this, "productKey");
     93    registerField("VCPUCount", this, "VCPUCount");
    10294}
    10395
     
    149141}
    150142
     143void UIWizardNewVMPageExpert::sltUnattendedCheckBoxToggle()
     144{
     145    const bool fEnabled = m_pButtonUnattended->isChecked();
     146    if (m_pISOSelectorLabel)
     147        m_pISOSelectorLabel->setEnabled(fEnabled);
     148    if (m_pISOFilePathSelector)
     149        m_pISOFilePathSelector->setEnabled(fEnabled);
     150    if (m_pStartHeadlessLabel)
     151        m_pStartHeadlessLabel->setEnabled(fEnabled);
     152    if (m_pStartHeadlessCheckBox)
     153        m_pStartHeadlessCheckBox->setEnabled(fEnabled);
     154    emit completeChanged();
     155}
     156
     157void UIWizardNewVMPageExpert::sltISOPathChanged(const QString &strPath)
     158{
     159    determineOSType(strPath);
     160    setTypeByISODetectedOSType(m_strDetectedOSTypeId);
     161    emit completeChanged();
     162}
     163
     164void UIWizardNewVMPageExpert::sltInstallGACheckBoxToggle(bool fEnabled)
     165{
     166    if (m_pGAISOPathLabel)
     167        m_pGAISOPathLabel->setEnabled(fEnabled);
     168    if (m_pGAISOFilePathSelector)
     169        m_pGAISOFilePathSelector->setEnabled(fEnabled);
     170    emit completeChanged();
     171}
     172
     173void UIWizardNewVMPageExpert::sltGAISOPathChanged(const QString &strPath)
     174{
     175    Q_UNUSED(strPath);
     176    emit completeChanged();
     177}
     178
    151179void UIWizardNewVMPageExpert::retranslateUi()
    152180{
    153     /* Translate widgets: */
    154 
    155     //m_pMemoryCnt->setTitle(UIWizardNewVM::tr("&Memory size"));
    156     //m_pDiskCnt->setTitle(UIWizardNewVM::tr("Hard disk"));
     181    if (m_pUnattendedLabel)
     182        m_pUnattendedLabel->setText(UIWizardNewVM::tr("Please choose whether you want to start an unattended guest os install "
     183                                             "in which case you will have to select a valid installation medium. If not "
     184                                             "your virtual disk will have an empty virtual hard disk. "
     185                                             "Additionally you can choose to start the unattended install as a headless vm process."));
     186    if (m_pButtonSimple)
     187    {
     188        m_pButtonSimple->setText(UIWizardNewVM::tr("Leave Disk Empty"));
     189        m_pButtonSimple->setToolTip(UIWizardNewVM::tr("When checked, no guest OS will be installed after this wizard is closed"));
     190    }
     191    if (m_pButtonUnattended)
     192    {
     193        m_pButtonUnattended->setText(UIWizardNewVM::tr("Unattended Install"));
     194        m_pButtonUnattended->setToolTip(UIWizardNewVM::tr("When checked, an unattended guest OS will be initialized after this wizard is closed"));
     195    }
     196
     197    if (m_pISOSelectorLabel)
     198        m_pISOSelectorLabel->setText(UIWizardNewVM::tr("Image:"));
     199
     200    if (m_pStartHeadlessLabel)
     201        m_pStartHeadlessLabel->setText(UIWizardNewVM::tr("Options:"));
     202    if (m_pStartHeadlessCheckBox)
     203    {
     204        m_pStartHeadlessCheckBox->setText(UIWizardNewVM::tr("Start VM Headless"));
     205        m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("When checked, the unattended install will start the virtual machine headless"));
     206    }
     207
     208
     209
    157210    m_pDiskSkip->setText(UIWizardNewVM::tr("&Do not add a virtual hard disk"));
    158211    m_pDiskCreate->setText(UIWizardNewVM::tr("&Create a virtual hard disk now"));
     
    161214    if (m_pToolBox)
    162215    {
    163         m_pToolBox->setItemText(ExpertToolboxItems_NameAnsOSType, UIWizardNewVM::tr("Name and operating system"));
     216        m_pToolBox->setItemText(ExpertToolboxItems_NameAndOSType, UIWizardNewVM::tr("Name and operating system"));
     217        m_pToolBox->setItemText(ExpertToolboxItems_UsernameHostname, UIWizardNewVM::tr("Username and hostname"));
     218        m_pToolBox->setItemText(ExpertToolboxItems_GAInstall, UIWizardNewVM::tr("Guest additions install"));
     219        m_pToolBox->setItemText(ExpertToolboxItems_ProductKey, UIWizardNewVM::tr("Product key"));
    164220        m_pToolBox->setItemText(ExpertToolboxItems_Disk, UIWizardNewVM::tr("Hard disk"));
    165221        m_pToolBox->setItemText(ExpertToolboxItems_Hardware, UIWizardNewVM::tr("Hardware"));
    166222    }
     223
     224    if (m_pHostnameLabel)
     225        m_pHostnameLabel->setText(UIWizardNewVM::tr("Hostname:"));
     226    if (m_pInstallGACheckBox)
     227        m_pInstallGACheckBox->setText(UIWizardNewVM::tr("Install guest additions"));
     228    if (m_pGAISOPathLabel)
     229        m_pGAISOPathLabel->setText(UIWizardNewVM::tr("Installation medium:"));
     230    if (m_pGAISOFilePathSelector)
     231        m_pGAISOFilePathSelector->setToolTip(UIWizardNewVM::tr("Please select an installation medium (ISO file)"));
     232    if (m_pProductKeyLabel)
     233        m_pProductKeyLabel->setText(UIWizardNewVM::tr("Product Key:"));
     234
     235}
     236
     237void UIWizardNewVMPageExpert::createConnections()
     238{
     239    /* Connections for Name, OS Type, and unattended install stuff: */
     240    connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged,
     241            this, &UIWizardNewVMPageExpert::sltNameChanged);
     242    connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged,
     243            this, &UIWizardNewVMPageExpert::sltPathChanged);
     244    connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged,
     245            this, &UIWizardNewVMPageExpert::sltOsTypeChanged);
     246    connect(m_pButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked),
     247            this, &UIWizardNewVMPageExpert::sltUnattendedCheckBoxToggle);
     248    connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged,
     249            this, &UIWizardNewVMPageExpert::sltISOPathChanged);
     250
     251    /* Connections for username, password, and hostname: */
     252    connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged,
     253            this, &UIWizardNewVMPageExpert::completeChanged);
     254    connect(m_pInstallGACheckBox, &QCheckBox::toggled, this,
     255            &UIWizardNewVMPageExpert::sltInstallGACheckBoxToggle);
     256    connect(m_pISOFilePathSelector, &UIFilePathSelector::pathChanged,
     257            this, &UIWizardNewVMPageExpert::sltGAISOPathChanged);
     258
     259    /* Connections for disk and hardware stuff: */
     260    connect(m_pDiskSkip, &QRadioButton::toggled,
     261            this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged);
     262    connect(m_pDiskCreate, &QRadioButton::toggled,
     263            this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged);
     264    connect(m_pDiskPresent, &QRadioButton::toggled,
     265            this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged);
     266    connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged),
     267            this, &UIWizardNewVMPageExpert::sltVirtualDiskSourceChanged);
     268    connect(m_pVMMButton, &QIToolButton::clicked,
     269            this, &UIWizardNewVMPageExpert::sltGetWithFileOpenDialog);
    167270}
    168271
     
    176279    ULONG recommendedRam = type.GetRecommendedRAM();
    177280    m_pBaseMemoryEditor->setValue(recommendedRam);
     281
     282    /* Prepare initial disk choice: */
     283    if (field("type").value<CGuestOSType>().GetRecommendedHDD() != 0)
     284    {
     285        if (m_pDiskCreate)
     286        {
     287            m_pDiskCreate->setFocus();
     288            m_pDiskCreate->setChecked(true);
     289        }
     290        m_fRecommendedNoDisk = false;
     291    }
     292    else
     293    {
     294        if (m_pDiskSkip)
     295        {
     296            m_pDiskSkip->setFocus();
     297            m_pDiskSkip->setChecked(true);
     298        }
     299        m_fRecommendedNoDisk = true;
     300    }
     301    if (m_pDiskSelector)
     302        m_pDiskSelector->setCurrentIndex(0);
    178303}
    179304
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r85081 r85090  
    2424/* Local includes: */
    2525#include "UIWizardNewVMPageBasic1.h"
     26#include "UIWizardNewVMPageBasic2.h"
    2627#include "UIWizardNewVMPageBasic3.h"
    2728
    2829/* Forward declarations: */
    29 class QGroupBox;
    3030class QToolBox;
    3131
     
    3333class UIWizardNewVMPageExpert : public UIWizardPage,
    3434                                public UIWizardNewVMPage1,
     35                                public UIWizardNewVMPage2,
    3536                                public UIWizardNewVMPage3
    3637{
     
    4344    Q_PROPERTY(QString virtualDiskLocation READ virtualDiskLocation WRITE setVirtualDiskLocation);
    4445    Q_PROPERTY(int baseMemory READ baseMemory);
     46    Q_PROPERTY(QString guestOSFamiyId READ guestOSFamiyId);
     47    Q_PROPERTY(QString ISOFilePath READ ISOFilePath);
     48    Q_PROPERTY(bool isUnattendedEnabled READ isUnattendedEnabled);
     49    Q_PROPERTY(bool startHeadless READ startHeadless);
     50    Q_PROPERTY(QString detectedOSTypeId READ detectedOSTypeId);
     51    Q_PROPERTY(QString userName READ userName WRITE setUserName);
     52    Q_PROPERTY(QString password READ password WRITE setPassword);
     53    Q_PROPERTY(QString hostname READ hostname WRITE setHostname);
     54    Q_PROPERTY(bool installGuestAdditions READ installGuestAdditions WRITE setInstallGuestAdditions);
     55    Q_PROPERTY(QString guestAdditionsISOPath READ guestAdditionsISOPath WRITE setGuestAdditionsISOPath);
     56    Q_PROPERTY(QString productKey READ productKey);
     57    Q_PROPERTY(int VCPUCount READ VCPUCount);
    4558
    4659public:
     
    6679    void sltVirtualDiskSourceChanged();
    6780    void sltGetWithFileOpenDialog();
     81    void sltUnattendedCheckBoxToggle();
     82    void sltISOPathChanged(const QString &strPath);
     83    void sltInstallGACheckBoxToggle(bool fChecked);
     84    void sltGAISOPathChanged(const QString &strPath);
    6885
    6986private:
    7087    enum ExpertToolboxItems
    7188    {
    72         ExpertToolboxItems_NameAnsOSType,
     89        ExpertToolboxItems_NameAndOSType,
     90        ExpertToolboxItems_UsernameHostname,
     91        ExpertToolboxItems_GAInstall,
     92        ExpertToolboxItems_ProductKey,
    7393        ExpertToolboxItems_Disk,
    7494        ExpertToolboxItems_Hardware
     
    7999
    80100    /** Prepare stuff. */
     101    void createConnections();
    81102    void initializePage();
    82103    void cleanupPage();
     
    87108
    88109    /** Widgets. */
    89     QWidget *m_pNameAndSystemCnt;
    90     QGroupBox *m_pMemoryCnt;
    91     QGroupBox *m_pDiskCnt;
     110    QWidget *m_pNameAndSystemContainer;
    92111    QToolBox  *m_pToolBox;
    93112};
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