VirtualBox

Changeset 91563 in vbox


Ignore:
Timestamp:
Oct 5, 2021 11:04:45 AM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996: UIWizardImportApp: Refactoring init stuff a bit; Populate stuff when page get initialized, not before.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp

    r91561 r91563  
    6868void UIWizardImportAppPage1::populateSources()
    6969{
    70     /* To be executed just once, so combo should be empty: */
    71     AssertReturnVoid(m_pSourceComboBox->count() == 0);
     70    /* Block signals while updating: */
     71    m_pSourceComboBox->blockSignals(true);
     72
     73    /* Clear combo initially: */
     74    m_pSourceComboBox->clear();
    7275
    7376    /* Compose hardcoded sources list, there might be few of list items: */
     
    110113    else
    111114        setSource("local");
     115
     116    /* Unblock signals after update: */
     117    m_pSourceComboBox->blockSignals(false);
    112118}
    113119
     
    301307void UIWizardImportAppPage1::updateSourceComboToolTip()
    302308{
    303     const int iCurrentIndex = m_pSourceComboBox->currentIndex();
    304     const QString strCurrentToolTip = m_pSourceComboBox->itemData(iCurrentIndex, Qt::ToolTipRole).toString();
    305     AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!"));
     309    const QString strCurrentToolTip = m_pSourceComboBox->currentData(Qt::ToolTipRole).toString();
    306310    m_pSourceComboBox->setToolTip(strCurrentToolTip);
    307311}
     
    525529    }
    526530
    527     /* Populate sources: */
    528     populateSources();
    529     /* Populate profiles: */
    530     populateProfiles();
    531     /* Populate profile: */
    532     populateProfile();
    533     /* Populate profile instances: */
    534     populateProfileInstances();
    535 
    536531    /* Setup connections: */
    537532    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProfileRegistered,
     
    551546
    552547    /* Register fields: */
    553     registerField("source", this, "source");
    554548    registerField("isSourceCloudOne", this, "isSourceCloudOne");
    555549    registerField("profile", this, "profile");
     
    616610void UIWizardImportAppPageBasic1::initializePage()
    617611{
     612    /* Populate sources: */
     613    populateSources();
     614    /* Populate profiles: */
     615    populateProfiles();
     616    /* Populate profile: */
     617    populateProfile();
     618    /* Populate profile instances: */
     619    populateProfileInstances();
     620
    618621    /* Translate page: */
    619622    retranslateUi();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h

    r91547 r91563  
    157157{
    158158    Q_OBJECT;
    159     Q_PROPERTY(QString source READ source WRITE setSource);
    160159    Q_PROPERTY(bool isSourceCloudOne READ isSourceCloudOne);
    161160    Q_PROPERTY(CCloudProfile profile READ profile);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp

    r91561 r91563  
    212212    }
    213213
    214     /* Populate sources: */
    215     populateSources();
    216     /* Populate profiles: */
    217     populateProfiles();
    218     /* Populate profile: */
    219     populateProfile();
    220     /* Populate profile instances: */
    221     populateProfileInstances();
    222     /* Populate form properties: */
    223     populateFormProperties();
    224     refreshFormPropertiesTable();
    225 
    226214    /* Setup connections: */
    227215    connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigCloudProfileRegistered,
     
    243231    qRegisterMetaType<ImportAppliancePointer>();
    244232    /* Register fields: */
    245     registerField("source", this, "source");
    246233    registerField("isSourceCloudOne", this, "isSourceCloudOne");
    247234    registerField("profile", this, "profile");
     
    289276void UIWizardImportAppPageExpert::initializePage()
    290277{
     278    /* Populate sources: */
     279    populateSources();
     280    /* Populate profiles: */
     281    populateProfiles();
     282    /* Populate profile: */
     283    populateProfile();
     284    /* Populate profile instances: */
     285    populateProfileInstances();
     286    /* Populate form properties: */
     287    populateFormProperties();
     288    refreshFormPropertiesTable();
     289
    291290    /* Translate page: */
    292291    retranslateUi();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.h

    r91521 r91563  
    3535{
    3636    Q_OBJECT;
    37     Q_PROPERTY(QString source READ source WRITE setSource);
    3837    Q_PROPERTY(bool isSourceCloudOne READ isSourceCloudOne);
    3938    Q_PROPERTY(CCloudProfile profile READ profile);
     
    5150protected:
    5251
     52    /** Allows access wizard from base part. */
     53    UIWizard *wizardImp() const { return UIWizardPage::wizard(); }
    5354    /** Allows to access 'field()' from base part. */
    5455    virtual QVariant fieldImp(const QString &strFieldName) const /* override */ { return UIWizardPage::field(strFieldName); }
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