VirtualBox

Ignore:
Timestamp:
Aug 30, 2011 1:35:09 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt4: don't show the variant page if the user don't have a choice

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.cpp

    r38571 r38572  
    197197    /* Create & add pages: */
    198198    if (wizardType() == UINewHDWizardType_Copying)
    199         addPage(new UINewHDWizardPageWelcome(sourceHardDisk));
    200     addPage(new UINewHDWizardPageFormat);
    201     addPage(new UINewHDWizardPageVariant);
    202     addPage(new UINewHDWizardPageOptions(strDefaultName, strDefaultPath, uDefaultSize));
    203     addPage(new UINewHDWizardPageSummary);
     199        setPage(PageWelcome, new UINewHDWizardPageWelcome(sourceHardDisk));
     200    setPage(PageFormat, new UINewHDWizardPageFormat);
     201    setPage(PageVariant, new UINewHDWizardPageVariant);
     202    setPage(PageOptions, new UINewHDWizardPageOptions(strDefaultName, strDefaultPath, uDefaultSize));
     203    setPage(PageSummary, new UINewHDWizardPageSummary);
    204204
    205205    /* Translate wizard: */
     
    454454}
    455455
     456int UINewHDWizardPageFormat::nextId() const
     457{
     458    CMediumFormat mediumFormat = field("mediumFormat").value<CMediumFormat>();
     459    ULONG uCapabilities = mediumFormat.GetCapabilities();
     460    int cTest = 0;
     461    if (uCapabilities & KMediumFormatCapabilities_CreateDynamic)
     462        ++cTest;
     463    if (uCapabilities & KMediumFormatCapabilities_CreateFixed)
     464        ++cTest;
     465    if (uCapabilities & KMediumFormatCapabilities_CreateSplit2G)
     466        ++cTest;
     467    if (cTest > 1)
     468        return UINewHDWizard::PageVariant;
     469
     470    return UINewHDWizard::PageOptions;
     471}
     472
    456473void UINewHDWizardPageFormat::processFormat(CMediumFormat mediumFormat)
    457474{
     
    488505    registerField("mediumVariant", this, "mediumVariant");
    489506
    490     /* Unfortuanelly, KMediumVariant is very messy,
     507    /* Default */
     508    setMediumVariant(KMediumVariant_Standard);
     509
     510    /* Unfortunately, KMediumVariant is very messy,
    491511     * so we can't enumerate it to make sure GUI will not hard-code its values,
    492512     * we can only use hard-coded values that we need: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.h

    r37655 r38572  
    5050public:
    5151
     52    enum
     53    {
     54        PageWelcome,
     55        PageFormat,
     56        PageVariant,
     57        PageOptions,
     58        PageSummary
     59    };
     60
    5261    /* Constructor: */
    5362    UINewHDWizard(QWidget *pParent,
     
    155164    /* Completeness validator: */
    156165    bool isComplete() const;
     166
     167    int nextId() const;
    157168
    158169    /* Helping stuff: */
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