VirtualBox

Changeset 91259 in vbox


Ignore:
Timestamp:
Sep 15, 2021 6:47:38 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996: Export Appliance wizard: Move custom button click handling from wizard to particular page; This will help us to get rid of public appliance widget reference.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp

    r90564 r91259  
    187187    setOption(QWizard::HaveCustomButton2,    (mode() == WizardMode_Basic && iId == Page3)
    188188                                          || (mode() == WizardMode_Expert && iId == PageExpert));
    189 }
    190 
    191 void UIWizardExportApp::sltCustomButtonClicked(int iId)
    192 {
    193     /* Call to base-class: */
    194     UIWizard::sltCustomButtonClicked(iId);
    195 
    196     /* Handle 2nd button: */
    197     if (iId == CustomButton2)
    198     {
    199         /* Get appliance widget and make sure it's valid: */
    200         ExportAppliancePointer pApplianceWidget = field("applianceWidget").value<ExportAppliancePointer>();
    201         AssertMsg(!pApplianceWidget.isNull(), ("Appliance Widget is not set!\n"));
    202         /* Reset it to default: */
    203         pApplianceWidget->restoreDefaults();
    204     }
    205189}
    206190
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.h

    r82968 r91259  
    6565    virtual void sltCurrentIdChanged(int iId) /* override */;
    6666
    67     /** Handles custom button @a iId click. */
    68     virtual void sltCustomButtonClicked(int iId) /* override */;
    69 
    7067protected:
    7168
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp

    r82968 r91259  
    201201    else
    202202        refreshApplianceSettingsWidget();
     203
     204    /* Listen for custom button clicks: */
     205    connect(wizard(), &UIWizard::customButtonClicked,
     206            this, &UIWizardExportAppPageBasic3::sltHandleCustomButtonClicked,
     207            Qt::UniqueConnection);
     208}
     209
     210void UIWizardExportAppPageBasic3::cleanupPage()
     211{
     212    /* Call to base-class: */
     213    UIWizardPage::cleanupPage();
     214
     215    /* Stop listen for custom button clicks: */
     216    disconnect(wizard(), &UIWizard::customButtonClicked,
     217               this, &UIWizardExportAppPageBasic3::sltHandleCustomButtonClicked);
    203218}
    204219
     
    265280    }
    266281}
     282
     283void UIWizardExportAppPageBasic3::sltHandleCustomButtonClicked(int iId)
     284{
     285    /* Handle 2nd button: */
     286    if (iId == QWizard::CustomButton2)
     287    {
     288        /* Reset widget to default: */
     289        AssertPtrReturnVoid(m_pApplianceWidget.data());
     290        m_pApplianceWidget->restoreDefaults();
     291    }
     292}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h

    r82968 r91259  
    9292    /** Performs page initialization. */
    9393    virtual void initializePage() /* override */;
     94    /** Performs page cleanup. */
     95    virtual void cleanupPage() /* override */;
    9496
    9597    /** Performs page validation. */
     
    98100    /** Updates page appearance. */
    99101    virtual void updatePageAppearance() /* override */;
     102
     103private slots:
     104
     105    /** Handles custom button clicked.
     106      * @param  iId  Brings clicked button id. */
     107    void sltHandleCustomButtonClicked(int iId);
    100108
    101109private:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp

    r91220 r91259  
    561561    /* Choose default cloud export option: */
    562562    m_pRadioExportThenAsk->setChecked(true);
     563
     564    /* Listen for custom button clicks: */
     565    connect(wizard(), &UIWizard::customButtonClicked,
     566            this, &UIWizardExportAppPageExpert::sltHandleCustomButtonClicked,
     567            Qt::UniqueConnection);
    563568}
    564569
    565570void UIWizardExportAppPageExpert::cleanupPage()
    566571{
    567     /* Do nothing, we don't want field values to be reseted. */
     572    /* Do not pass call to base-class, we don't want field values to be reseted. */
     573
     574    /* Stop listen for custom button clicks: */
     575    disconnect(wizard(), &UIWizard::customButtonClicked,
     576               this, &UIWizardExportAppPageExpert::sltHandleCustomButtonClicked);
    568577}
    569578
     
    696705}
    697706
     707void UIWizardExportAppPageExpert::sltHandleCustomButtonClicked(int iId)
     708{
     709    /* Handle 2nd button: */
     710    if (iId == QWizard::CustomButton2)
     711    {
     712        /* Reset widget to default: */
     713        m_pApplianceWidget->restoreDefaults();
     714    }
     715}
     716
    698717void UIWizardExportAppPageExpert::sltHandleProfileComboChange()
    699718{
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h

    r86346 r91259  
    9696    void sltHandleMACAddressExportPolicyComboChange();
    9797
     98    /** Handles custom button clicked.
     99      * @param  iId  Brings clicked button id. */
     100    void sltHandleCustomButtonClicked(int iId);
     101
    98102    /** Handles change in profile combo-box. */
    99103    void sltHandleProfileComboChange();
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