VirtualBox

Changeset 90232 in vbox


Ignore:
Timestamp:
Jul 16, 2021 2:27:18 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145770
Message:

FE/Qt: bugref:9996. More initialization fixes and some more connections.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards
Files:
5 edited

Legend:

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

    r90208 r90232  
    191191
    192192    if (m_pGAISOFilePathSelector)
    193         m_pGAISOFilePathSelector->setEnabled(m_pGAISOFilePathSelector);
     193        m_pGAISOFilePathSelector->setEnabled(fEnabled);
    194194}
    195195
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardNewVMEditors.h

    r90230 r90232  
    9393    /** @} */
    9494
    95 public slots:
     95private slots:
    9696
    9797    void sltToggleWidgetsEnabled(bool fEnabled);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r90230 r90232  
    125125    if (!m_userModifiedParameters.contains("MediumPath"))
    126126        updateVirtualMediumPathFromMachinePathName();
     127    if (!m_userModifiedParameters.contains("HostnameDomainName"))
     128        updateHostnameDomainNameFromMachineName();
    127129    emit completeChanged();
    128130}
     
    173175    m_userModifiedParameters << "GuestAdditionsISOPath";
    174176    newVMWizardPropertySet(GuestAdditionsISOPath, strPath);
     177    emit completeChanged();
     178}
     179
     180void UIWizardNewVMPageExpert::sltInstallGACheckBoxToggle(bool fEnabled)
     181{
     182    newVMWizardPropertySet(InstallGuestAdditions, fEnabled);
     183    m_userModifiedParameters << "InstallGuestAdditions";
    175184    emit completeChanged();
    176185}
     
    213222    if (m_pNameAndSystemLayout && m_pNameAndSystemEditor)
    214223        m_pNameAndSystemLayout->setColumnMinimumWidth(0, m_pNameAndSystemEditor->firstColumnWidth());
    215 }
    216 
    217 void UIWizardNewVMPageExpert::sltInstallGACheckBoxToggle(bool fEnabled)
    218 {
    219     Q_UNUSED(fEnabled);
    220     emit completeChanged();
    221224}
    222225
     
    256259
    257260    }
    258     // if (m_pUserNamePasswordGroupBox)
    259     //     connect(m_pUserNamePasswordGroupBox, &UIUserNamePasswordEditor::sigSomeTextChanged,
    260     //             this, &UIWizardNewVMPageExpert::completeChanged);
     261
     262    if (m_pUserNamePasswordGroupBox)
     263    {
     264        connect(m_pUserNamePasswordGroupBox, &UIUserNamePasswordGroupBox::sigPasswordChanged,
     265                this, &UIWizardNewVMPageExpert::sltPasswordChanged);
     266        connect(m_pUserNamePasswordGroupBox, &UIUserNamePasswordGroupBox::sigUserNameChanged,
     267                this, &UIWizardNewVMPageExpert::sltUserNameChanged);
     268    }
     269
     270
     271    if (m_pAdditionalOptionsContainer)
     272    {
     273        connect(m_pAdditionalOptionsContainer, &UIAdditionalUnattendedOptions::sigHostnameDomainNameChanged,
     274                this, &UIWizardNewVMPageExpert::sltHostnameDomainNameChanged);
     275        connect(m_pAdditionalOptionsContainer, &UIAdditionalUnattendedOptions::sigProductKeyChanged,
     276                this, &UIWizardNewVMPageExpert::sltProductKeyChanged);
     277        connect(m_pAdditionalOptionsContainer, &UIAdditionalUnattendedOptions::sigStartHeadlessChanged,
     278                this, &UIWizardNewVMPageExpert::sltStartHeadlessChanged);
     279    }
    261280
    262281
     
    356375    AssertReturnVoid(pWizard);
    357376    /* Initialize wizard properties: */
    358     if (m_pNameAndSystemEditor)
    359     {
    360         /* Guest OS type: */
    361         newVMWizardPropertySet(GuestOSFamilyId, m_pNameAndSystemEditor->familyId());
    362         newVMWizardPropertySet(GuestOSType, m_pNameAndSystemEditor->type());
    363         /* Vm name, folder, file path etc. will be initilized by composeMachineFilePath: */
    364     }
    365 
    366     /* Medium related properties: */
    367     if (m_pFormatButtonGroup)
    368         newVMWizardPropertySet(MediumFormat, m_pFormatButtonGroup->mediumFormat());
    369     if (!m_userModifiedParameters.contains("MediumPath"))
    370         updateVirtualMediumPathFromMachinePathName();
     377    {
     378        if (m_pNameAndSystemEditor)
     379        {
     380            /* Guest OS type: */
     381            newVMWizardPropertySet(GuestOSFamilyId, m_pNameAndSystemEditor->familyId());
     382            newVMWizardPropertySet(GuestOSType, m_pNameAndSystemEditor->type());
     383            /* Vm name, folder, file path etc. will be initilized by composeMachineFilePath: */
     384        }
     385
     386        /* Medium related properties: */
     387        if (m_pFormatButtonGroup)
     388            newVMWizardPropertySet(MediumFormat, m_pFormatButtonGroup->mediumFormat());
     389        if (!m_userModifiedParameters.contains("MediumPath"))
     390            updateVirtualMediumPathFromMachinePathName();
     391    }
     392
     393    /* Initialize user/password if they are not modified by the user: */
     394    if (m_pUserNamePasswordGroupBox)
     395    {
     396        m_pUserNamePasswordGroupBox->blockSignals(true);
     397        if (!m_userModifiedParameters.contains("UserName"))
     398            m_pUserNamePasswordGroupBox->setUserName(pWizard->userName());
     399        if (!m_userModifiedParameters.contains("Password"))
     400            m_pUserNamePasswordGroupBox->setPassword(pWizard->password());
     401        m_pUserNamePasswordGroupBox->blockSignals(false);
     402    }
     403    if (!m_userModifiedParameters.contains("HostnameDomainName"))
     404        updateHostnameDomainNameFromMachineName();
     405
    371406
    372407    // disableEnableUnattendedRelatedWidgets(isUnattendedEnabled());
     
    674709}
    675710
     711void UIWizardNewVMPageExpert::sltPasswordChanged(const QString &strPassword)
     712{
     713    newVMWizardPropertySet(Password, strPassword);
     714    m_userModifiedParameters << "Password";
     715    emit completeChanged();
     716}
     717
     718void UIWizardNewVMPageExpert::sltUserNameChanged(const QString &strUserName)
     719{
     720    newVMWizardPropertySet(UserName, strUserName);
     721    m_userModifiedParameters << "UserName";
     722    emit completeChanged();
     723}
     724
     725void UIWizardNewVMPageExpert::sltHostnameDomainNameChanged(const QString &strHostnameDomainName)
     726{
     727    newVMWizardPropertySet(HostnameDomainName, strHostnameDomainName);
     728    m_userModifiedParameters << "HostnameDomainName";
     729    emit completeChanged();
     730}
     731
     732void UIWizardNewVMPageExpert::sltProductKeyChanged(const QString &strProductKey)
     733{
     734    m_userModifiedParameters << "ProductKey";
     735    newVMWizardPropertySet(ProductKey, strProductKey);
     736}
     737
     738void UIWizardNewVMPageExpert::sltStartHeadlessChanged(bool fStartHeadless)
     739{
     740    m_userModifiedParameters << "StartHeadless";
     741    newVMWizardPropertySet(StartHeadless, fStartHeadless);
     742}
     743
     744
    676745void UIWizardNewVMPageExpert::updateVirtualMediumPathFromMachinePathName()
    677746{
     
    756825    }
    757826}
     827
     828void UIWizardNewVMPageExpert::updateHostnameDomainNameFromMachineName()
     829{
     830    if (!m_pAdditionalOptionsContainer)
     831        return;
     832    UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard());
     833    AssertReturnVoid(pWizard);
     834
     835    m_pAdditionalOptionsContainer->blockSignals(true);
     836    m_pAdditionalOptionsContainer->setHostname(pWizard->machineBaseName());
     837    m_pAdditionalOptionsContainer->setDomainName("myguest.virtualbox.org");
     838    /* Initialize unattended hostname here since we cannot get the default value from CUnattended this early (unlike username etc): */
     839    newVMWizardPropertySet(HostnameDomainName, m_pAdditionalOptionsContainer->hostnameDomainName());
     840
     841    m_pAdditionalOptionsContainer->blockSignals(false);
     842}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r90225 r90232  
    8888    void sltCPUCountChanged(int iCount);
    8989    void sltEFIEnabledChanged(bool fEnabled);
     90    void sltPasswordChanged(const QString &strPassword);
     91    void sltUserNameChanged(const QString &strUserName);
    9092
     93    void sltHostnameDomainNameChanged(const QString &strHostnameDomainName);
     94    void sltProductKeyChanged(const QString &strProductKey);
     95    void sltStartHeadlessChanged(bool fStartHeadless);
    9196
    9297private:
     
    128133    void updateVirtualMediumPathFromMachinePathName();
    129134    void updateWidgetAterMediumFormatChange();
     135    void updateHostnameDomainNameFromMachineName();
    130136    void setEnableNewDiskWidgets(bool fEnable);
    131137    void setVirtualDiskFromDiskCombo();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp

    r90174 r90232  
    130130    if (m_pAdditionalOptionsContainer)
    131131        m_pAdditionalOptionsContainer->disableEnableProductKeyWidgets(isProductKeyWidgetEnabled());
    132     if (m_pGAInstallationISOContainer)
    133         m_pGAInstallationISOContainer->sltToggleWidgetsEnabled(m_pGAInstallationISOContainer->isChecked());
    134132    retranslateUi();
    135133
     
    157155            newVMWizardPropertySet(HostnameDomainName, m_pAdditionalOptionsContainer->hostnameDomainName());
    158156        }
    159 
    160157        m_pAdditionalOptionsContainer->blockSignals(false);
    161158    }
     
    201198void UIWizardNewVMUnattendedPageBasic::sltInstallGACheckBoxToggle(bool fEnabled)
    202199{
    203     if (m_pGAInstallationISOContainer)
    204         m_pGAInstallationISOContainer->sltToggleWidgetsEnabled(fEnabled);
    205200    newVMWizardPropertySet(InstallGuestAdditions, fEnabled);
    206201    m_userModifiedParameters << "InstallGuestAdditions";
     
    246241void UIWizardNewVMUnattendedPageBasic::sltProductKeyChanged(const QString &strProductKey)
    247242{
     243    m_userModifiedParameters << "ProductKey";
    248244    newVMWizardPropertySet(ProductKey, strProductKey);
    249245}
     
    251247void UIWizardNewVMUnattendedPageBasic::sltStartHeadlessChanged(bool fStartHeadless)
    252248{
     249    m_userModifiedParameters << "StartHeadless";
    253250    newVMWizardPropertySet(StartHeadless, fStartHeadless);
    254251}
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