VirtualBox

Changeset 84887 in vbox for trunk


Ignore:
Timestamp:
Jun 21, 2020 3:25:49 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9515. Overriding nextId() of the wizard to make it non-linear.

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

Legend:

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

    r84886 r84887  
    6969        case WizardMode_Basic:
    7070        {
    71             setPage(Page1, new UIWizardNewVMPageBasicUnattended);
    72             setPage(Page2, new UIWizardNewVMPageBasicNameType(m_strGroup));
    73             setPage(Page3, new UIWizardNewVMPageBasicHardware);
    74             setPage(Page4, new UIWizardNewVMPageBasicDisk);
     71            setPage(PageUnattended, new UIWizardNewVMPageBasicUnattended);
     72            setPage(PageNameType, new UIWizardNewVMPageBasicNameType(m_strGroup));
     73            setPage(PageHardware, new UIWizardNewVMPageBasicHardware);
     74            setPage(PageDisk, new UIWizardNewVMPageBasicDisk);
    7575            break;
    7676        }
     
    373373}
    374374
     375int UIWizardNewVM::nextId() const
     376{
     377    switch (currentId())
     378    {
     379        case PageUnattended:
     380            return PageNameType;
     381            break;
     382        case PageNameType:
     383            return PageHardware;
     384            break;
     385        case PageHardware:
     386            return PageDisk;
     387            break;
     388        case PageDisk:
     389            return UIWizard::nextId();
     390        case PageMax:
     391        default:
     392            return PageUnattended;
     393            break;
     394    }
     395    return UIWizard::nextId();
     396}
     397
    375398void UIWizardNewVM::sltHandleWizardCancel()
    376399{
     
    379402        case WizardMode_Basic:
    380403        {
    381             UIWizardNewVMPageBasicNameType *pPage = qobject_cast<UIWizardNewVMPageBasicNameType*> (page(Page2));
     404            UIWizardNewVMPageBasicNameType *pPage = qobject_cast<UIWizardNewVMPageBasicNameType*> (page(PageNameType));
    382405            /* Make sure that we were able to find the page that created the folder. */
    383406            Assert(pPage);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h

    r84886 r84887  
    3939    enum
    4040    {
    41         Page1,
    42         Page2,
    43         Page3,
    44         Page4
     41        PageUnattended,
     42        PageNameType,
     43        PageHardware,
     44        PageDisk,
     45        PageMax
    4546    };
    4647
     
    7172    /* Attaches default devices: */
    7273    bool attachDefaultDevices(const CGuestOSType &comGuestType);
     74    virtual int nextId() const /* override */;
    7375
    7476    /* Who will be able to create virtual-machine: */
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