VirtualBox

Changeset 90217 in vbox


Ignore:
Timestamp:
Jul 15, 2021 6:02:01 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996. Resurrecting some connections in expert page

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

Legend:

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

    r90206 r90217  
    4949{
    5050    prepare();
     51}
     52
     53CMediumFormat UIDiskFormatsGroupBox::mediumFormat() const
     54{
     55    return m_pFormatButtonGroup && m_pFormatButtonGroup->checkedButton() ? m_formats[m_pFormatButtonGroup->checkedId()] : CMediumFormat();
     56}
     57
     58void UIDiskFormatsGroupBox::setMediumFormat(const CMediumFormat &mediumFormat)
     59{
     60    int iPosition = m_formats.indexOf(mediumFormat);
     61    if (iPosition >= 0)
     62    {
     63        m_pFormatButtonGroup->button(iPosition)->click();
     64        m_pFormatButtonGroup->button(iPosition)->setFocus();
     65    }
    5166}
    5267
     
    258273    setTitle(tr("Hard Disk File Location and Size"));
    259274}
     275
     276QString UIDiskSizeAndLocationGroupBox::location() const
     277{
     278    if (m_pLocationEditor)
     279        return m_pLocationEditor->text();
     280    return QString();
     281}
     282
     283void UIDiskSizeAndLocationGroupBox::setLocation(const QString &strLocation)
     284{
     285    if (m_pLocationEditor)
     286        m_pLocationEditor->setText(strLocation);
     287}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.h

    r90206 r90217  
    5959
    6060    UIDiskFormatsGroupBox(QWidget *pParent = 0);
    61 
     61    CMediumFormat mediumFormat() const;
     62    void setMediumFormat(const CMediumFormat &mediumFormat);
    6263
    6364private:
     
    107108    UIDiskSizeAndLocationGroupBox(QWidget *pParent = 0);
    108109
     110    QString location() const;
     111    void setLocation(const QString &strLocation);
     112
    109113private:
    110114
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp

    r90210 r90217  
    4646#include "UIWizardNewVMEditors.h"
    4747#include "UIWizardNewVMPageExpert.h"
     48#include "UIWizardNewVMNameOSTypePageBasic.h"
     49#include "UIWizardNewVMDiskPageBasic.h"
    4850
    4951/* COM includes: */
     
    116118}
    117119
    118 void UIWizardNewVMPageExpert::sltNameChanged(const QString &strNewText)
    119 {
    120     Q_UNUSED(strNewText);
    121     // onNameChanged(strNewText);
    122     // composeMachineFilePath();
    123     // updateVirtualDiskPathFromMachinePathName();
    124     // emit completeChanged();
     120void UIWizardNewVMPageExpert::sltNameChanged(const QString &strNewName)
     121{
     122    UIWizardNewVMNameOSTypePage::onNameChanged(m_pNameAndSystemEditor, strNewName);
     123    UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, qobject_cast<UIWizardNewVM*>(wizard()));
     124    updateVirtualDiskPathFromMachinePathName();
     125    emit completeChanged();
    125126}
    126127
     
    128129{
    129130    Q_UNUSED(strNewPath);
    130     // composeMachineFilePath();
    131     // updateVirtualDiskPathFromMachinePathName();
     131    UIWizardNewVMNameOSTypePage::composeMachineFilePath(m_pNameAndSystemEditor, qobject_cast<UIWizardNewVM*>(wizard()));
     132    updateVirtualDiskPathFromMachinePathName();
    132133}
    133134
     
    197198        m_pDiskSelectionButton->setToolTip(UIWizardNewVM::tr("Choose a Virtual Hard Fisk File..."));
    198199
    199 
    200 
    201     // if (m_pFormatButtonGroup)
    202     // {
    203     //     QList<QAbstractButton*> buttons = m_pFormatButtonGroup->buttons();
    204     //     for (int i = 0; i < buttons.size(); ++i)
    205     //     {
    206     //         QAbstractButton *pButton = buttons[i];
    207     //         UIMediumFormat enmFormat = gpConverter->fromInternalString<UIMediumFormat>(m_formatNames[m_pFormatButtonGroup->id(pButton)]);
    208     //         pButton->setText(gpConverter->toString(enmFormat));
    209     //     }
    210     // }
    211     // if (m_pLocationLabel)
    212     //     m_pLocationLabel->setText(UIWizardNewVM::tr("Disk &Location:"));
    213 
    214200    if (m_pNameAndSystemLayout && m_pNameAndSystemEditor)
    215201        m_pNameAndSystemLayout->setColumnMinimumWidth(0, m_pNameAndSystemEditor->firstColumnWidth());
     
    226212{
    227213    /* Connections for Name, OS Type, and unattended install stuff: */
    228     // if (m_pNameAndSystemEditor)
    229     // {
    230     //     connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged,
    231     //             this, &UIWizardNewVMPageExpert::sltNameChanged);
     214    if (m_pNameAndSystemEditor)
     215    {
     216        connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged,
     217                this, &UIWizardNewVMPageExpert::sltNameChanged);
    232218    //     connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged,
    233219    //             this, &UIWizardNewVMPageExpert::sltPathChanged);
     
    238224    //     connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigImageChanged,
    239225    //             this, &UIWizardNewVMPageExpert::sltISOPathChanged);
    240     // }
     226    }
    241227
    242228    // /* Connections for username, password, and hostname: */
     
    353339void UIWizardNewVMPageExpert::initializePage()
    354340{
     341    UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard());
     342    AssertReturnVoid(pWizard);
     343    /* Initialize wizard properties: */
     344    if (m_pFormatButtonGroup)
     345        newVMWizardPropertySet(MediumFormat, m_pFormatButtonGroup->mediumFormat());
     346
     347
    355348    // disableEnableUnattendedRelatedWidgets(isUnattendedEnabled());
    356349    // setOSTypeDependedValues();
    357350    // disableEnableUnattendedRelatedWidgets(isUnattendedEnabled());
    358     // updateVirtualDiskPathFromMachinePathName();
     351    updateVirtualDiskPathFromMachinePathName();
    359352    // updateWidgetAterMediumFormatChange();
    360353    // setSkipCheckBoxEnable();
     
    651644void UIWizardNewVMPageExpert::updateVirtualDiskPathFromMachinePathName()
    652645{
    653     // QString strDiskFileName = machineBaseName().isEmpty() ? QString("NewVirtualDisk1") : machineBaseName();
    654     // QString strDiskPath = machineFolder();
    655     // if (strDiskPath.isEmpty())
    656     // {
    657     //     if (m_pNameAndSystemEditor)
    658     //         strDiskPath = m_pNameAndSystemEditor->path();
    659     //     else
    660     //         strDiskPath = uiCommon().virtualBox().GetSystemProperties().GetDefaultMachineFolder();
    661     // }
    662     // QString strExtension = defaultExtension(mediumFormat());
    663     // if (m_pLocationEditor)
    664     //     m_pLocationEditor->setText(absoluteFilePath(strDiskFileName, strDiskPath, strExtension));
     646    UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(wizard());
     647    AssertReturnVoid(pWizard);
     648    QString strDiskFileName = pWizard->machineBaseName().isEmpty() ? QString("NewVirtualDisk1") : pWizard->machineBaseName();
     649    QString strDiskPath = pWizard->machineFolder();
     650    if (strDiskPath.isEmpty())
     651    {
     652        if (m_pNameAndSystemEditor)
     653            strDiskPath = m_pNameAndSystemEditor->path();
     654        else
     655            strDiskPath = uiCommon().virtualBox().GetSystemProperties().GetDefaultMachineFolder();
     656    }
     657    QString strExtension = UIWizardNewVMDiskPage::defaultExtension(pWizard->mediumFormat());
     658
     659
     660    if (m_pSizeAndLocationGroup)
     661    {
     662        QString strMediumPath =
     663            UIWizardNewVMDiskPage::absoluteFilePath(UIWizardNewVMDiskPage::toFileName(strDiskFileName,
     664                                                                                      strExtension), strDiskPath);
     665        m_pSizeAndLocationGroup->setLocation(strMediumPath);
     666    }
    665667}
    666668
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h

    r90210 r90217  
    7070private slots:
    7171
    72     void sltNameChanged(const QString &strNewText);
     72    void sltNameChanged(const QString &strNewName);
    7373    void sltPathChanged(const QString &strNewPath);
    7474    void sltOsTypeChanged();
     
    140140        UIGAInstallationGroupBox *m_pGAInstallationISOContainer;
    141141        UIUserNamePasswordGroupBox *m_pUserNamePasswordGroupBox;
    142 
    143 
    144     QButtonGroup *m_pDiskSourceButtonGroup;
    145     QRadioButton *m_pDiskEmpty;
    146     QRadioButton *m_pDiskNew;
    147     QRadioButton *m_pDiskExisting;
    148     UIMediaComboBox *m_pDiskSelector;
    149     QIToolButton *m_pDiskSelectionButton;
    150 
    151 
     142        QButtonGroup *m_pDiskSourceButtonGroup;
     143        QRadioButton *m_pDiskEmpty;
     144        QRadioButton *m_pDiskNew;
     145        QRadioButton *m_pDiskExisting;
     146        UIMediaComboBox *m_pDiskSelector;
     147        QIToolButton *m_pDiskSelectionButton;
     148        QSet<QString> m_userModifiedParameters;
    152149    /** @} */
    153150};
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