VirtualBox

Ignore:
Timestamp:
Jul 5, 2021 8:05:25 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145534
Message:

FE/Qt: bugref:9996: Cleaning on unattended page.

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

Legend:

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

    r90039 r90040  
    6262    , m_iUSBCount(0)
    6363    , m_fInstallGuestAdditions(false)
     64    , m_fStartHeadless(false)
     65    , m_fSkipUnattendedInstall(false)
    6466{
    6567#ifndef VBOX_WS_MAC
     
    7476
    7577    connect(this, &UIWizardNewVM::rejected, this, &UIWizardNewVM::sltHandleWizardCancel);
    76 }
    77 
    78 void UIWizardNewVM::prepare()
    79 {
    80     // enableHelpButton("gui-createvm");
    81     // /* Create corresponding pages: */
    82     // switch (mode())
    83     // {
    84     //     case WizardMode_Basic:
    85     //     {
    86     //         // setPage(Page1, new UIWizardNewVMPageNameOSType(m_strMachineGroup));
    87     //         // setPage(Page2, new UIWizardNewVMPageUnattended);
    88     //         // setPage(Page3, new UIWizardNewVMPageHardware);
    89     //         // setPage(Page4, new UIWizardNewVMPageDisk);
    90 
    91     //         // setStartId(Page1);
    92     //         break;
    93     //     }
    94     //     case WizardMode_Expert:
    95     //     {
    96     //         setPage(PageExpert, new UIWizardNewVMPageExpert(m_strMachineGroup));
    97     //         break;
    98     //     }
    99     //     default:
    100     //     {
    101     //         AssertMsgFailed(("Invalid mode: %d", mode()));
    102     //         break;
    103     //     }
    104     // }
    105     // /* Call to base-class: */
    106     // UIWizard::prepare();
    10778}
    10879
     
    525496}
    526497
    527 // void UIWizardNewVM::sltHandleDetectedOSTypeChange()
    528 // {
    529 //     // UIWizardNewVMPageNameOSType *pPage = qobject_cast<UIWizardNewVMPageNameOSType*>(page(Page1));
    530 //     // if (!pPage)
    531 //     //     return;
    532 //     // pPage->setTypeByISODetectedOSType(getStringFieldValue("detectedOSTypeId"));
    533 // }
    534 
    535 void UIWizardNewVM::sltCustomButtonClicked(int iId)
    536 {
    537     Q_UNUSED(iId);
    538     // UIWizard::sltCustomButtonClicked(iId);
    539     // setFieldsFromDefaultUnttendedInstallData();
    540 }
    541 
    542498void UIWizardNewVM::retranslateUi()
    543499{
    544     /* Call to base-class: */
    545500    UINativeWizard::retranslateUi();
    546 
    547501    setWindowTitle(tr("Create Virtual Machine"));
    548502    // setButtonText(QWizard::FinishButton, tr("Create"));
     
    722676{
    723677    m_fInstallGuestAdditions = fInstallGA;
     678}
     679
     680bool UIWizardNewVM::startHeadless() const
     681{
     682    return m_fStartHeadless;
     683}
     684
     685void UIWizardNewVM::setStartHeadless(bool fStartHeadless)
     686{
     687    m_fStartHeadless = fStartHeadless;
     688}
     689
     690bool UIWizardNewVM::skipUnattendedInstall() const
     691{
     692    return m_fSkipUnattendedInstall;
     693}
     694
     695void UIWizardNewVM::setSkipUnattendedInstall(bool fSkipUnattendedInstall)
     696{
     697    m_fSkipUnattendedInstall = fSkipUnattendedInstall;
    724698}
    725699
     
    799773    m_unattendedInstallData.m_strGuestAdditionsISOPath = m_strGuestAdditionsISOPath;
    800774
    801     // m_unattendedInstallData.m_fUnattendedEnabled = getBoolFieldValue("isUnattendedEnabled");
    802     // m_unattendedInstallData.m_fStartHeadless = getBoolFieldValue("startHeadless");
     775    m_unattendedInstallData.m_fUnattendedEnabled = isUnattendedEnabled();
     776    m_unattendedInstallData.m_fStartHeadless = m_fStartHeadless;
    803777    m_unattendedInstallData.m_fInstallGuestAdditions = m_fInstallGuestAdditions;
    804778    // m_unattendedInstallData.m_uMachineUid = createdMachineId();
     
    809783bool UIWizardNewVM::isUnattendedEnabled() const
    810784{
    811     // QVariant fieldValue = field("isUnattendedEnabled");
    812     // if (fieldValue.isNull() || !fieldValue.isValid() || !fieldValue.canConvert(QMetaType::Bool))
    813     //     return false;
    814     // return fieldValue.toBool();
     785    if (!m_fSkipUnattendedInstall)
     786        return false;
     787    if (m_strISOFilePath.isEmpty() || m_strISOFilePath.isNull())
     788        return false;
    815789    return true;
    816790}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r90039 r90040  
    7171public:
    7272
    73 
    74     /** Constructor: */
    7573    UIWizardNewVM(QWidget *pParent, const QString &strMachineGroup = QString(), WizardMode enmMode = WizardMode_Auto);
    76 
    77     /** Prepare routine. */
    78     void prepare();
    79 
    8074    /** Returns the Id of newly created VM. */
    8175    QUuid createdMachineId() const;
     76    bool isUnattendedEnabled() const;
    8277    void setDefaultUnattendedInstallData(const UIUnattendedInstallData &unattendedInstallData);
    8378    const UIUnattendedInstallData &unattendedInstallData() const;
    84     bool isUnattendedEnabled() const;
    8579    bool isGuestOSTypeWindows() const;
    8680    CMedium &virtualDisk();
     
    111105    void setInstallGuestAdditions(bool fInstallGA);
    112106
     107    bool startHeadless() const;
     108    void setStartHeadless(bool fStartHeadless);
     109
     110    bool skipUnattendedInstall() const;
     111    void setSkipUnattendedInstall(bool fSkipUnattendedInstall);
     112
    113113    const QString &ISOFilePath() const;
    114114    void setISOFilePath(const QString &strISOFilePath);
     
    132132
    133133    /** Populates pages. */
    134     virtual void populatePages() /* final */;
     134    virtual void populatePages() /* final override */;
    135135
    136136    bool createVM();
     
    149149private:
    150150
    151     /* Translation stuff: */
    152151    void retranslateUi();
    153 
    154 
    155     /* Helping stuff: */
    156152    QString getNextControllerName(KStorageBus type);
    157153    void setFieldsFromDefaultUnttendedInstallData();
     
    193189    /** True if guest additions are to be installed during unattended install. */
    194190    bool m_fInstallGuestAdditions;
     191    bool m_fStartHeadless;
     192    bool m_fSkipUnattendedInstall;
    195193
    196194    QString m_strUserName;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp

    r90039 r90040  
    4040#include "CUnattended.h"
    4141
    42 // QString UIWizardNewVMUnattendedPage::productKey() const
    43 // {
    44 //     if (!m_pProductKeyLineEdit || !m_pProductKeyLineEdit->hasAcceptableInput())
    45 //         return QString();
    46 //     return m_pProductKeyLineEdit->text();
    47 // }
    48 
    49 
    5042bool UIWizardNewVMUnattendedPage::checkGAISOFile(UIFilePathSelector *pGAISOFilePathSelector)
    5143{
     
    6153    return true;
    6254}
    63 
    64 
    65 
    66 // bool UIWizardNewVMUnattendedPage::startHeadless() const
    67 // {
    68 //     if (!m_pStartHeadlessCheckBox)
    69 //         return false;
    70 //     return m_pStartHeadlessCheckBox->isChecked();
    71 // }
    72 
    7355
    7456UIWizardNewVMUnattendedPageBasic::UIWizardNewVMUnattendedPageBasic()
     
    11496                this, &UIWizardNewVMUnattendedPageBasic::sltUserNameChanged);
    11597    }
    116 
    11798    if (m_pGAISOFilePathSelector)
    11899        connect(m_pGAISOFilePathSelector, &UIFilePathSelector::pathChanged,
     
    127108        connect(m_pProductKeyLineEdit, &QLineEdit::textChanged,
    128109                this, &UIWizardNewVMUnattendedPageBasic::sltProductKeyChanged);
    129 
     110    if (m_pStartHeadlessCheckBox)
     111        connect(m_pStartHeadlessCheckBox, &QCheckBox::toggled,
     112                this, &UIWizardNewVMUnattendedPageBasic::sltStartHeadlessChanged);
    130113}
    131114
     
    149132        m_pGAInstallationISOContainer->setTitle(UIWizardNewVM::tr("Gu&est Additions"));
    150133        m_pGAInstallationISOContainer->setToolTip(UIWizardNewVM::tr("<p>When checked the guest additions will be installed "
    151                                                            "after the OS install.</p>"));
     134                                                                    "after the OS install.</p>"));
    152135    }
    153136    if (m_pProductKeyLabel)
     
    239222    if (m_pWizard)
    240223        m_pWizard->setProductKey(strProductKey);
     224}
     225
     226void UIWizardNewVMUnattendedPageBasic::sltStartHeadlessChanged(bool fStartHeadless)
     227{
     228    if (m_pWizard)
     229        m_pWizard->setStartHeadless(fStartHeadless);
    241230}
    242231
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h

    r90039 r90040  
    4141namespace UIWizardNewVMUnattendedPage
    4242{
     43    /** Returns false if ISO path selector is non empty but has invalid file path. */
    4344    bool checkGAISOFile(UIFilePathSelector *pGAISOFilePathSelector);
    44 //     UIWizardNewVMUnattendedPage();
    45 
    46 //     /** @name Property getters/setters
    47 //       * @{ */
    48 //         QString userName() const;
    49 //         void setUserName(const QString &strName);
    50 //         QString password() const;
    51 //         void setPassword(const QString &strPassword);
    52 //         QString hostname() const;
    53 //         void setHostname(const QString &strHostName);
    54 //         QString guestAdditionsISOPath() const;
    55 //         void setGuestAdditionsISOPath(const QString &strISOPath);
    56 //         QString productKey() const;
    57 //     /** @} */
    58 
    59 
    60 //     /** Returns false if ISO path selector is non empty but has invalid file path. */
    61 //     bool checkGAISOFile() const;
    62 
    63 //     void retranslateWidgets();
    64 
    65 
    66 //     bool startHeadless() const;
    67 
    68 
    6945}
    7046
     
    9167    void sltHostnameChanged(const QString &strHostname);
    9268    void sltProductKeyChanged(const QString &strProductKey);
     69    void sltStartHeadlessChanged(bool fStartHeadless);
    9370
    9471private:
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