VirtualBox

Changeset 92044 in vbox for trunk


Ignore:
Timestamp:
Oct 25, 2021 3:45:00 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9996: UINativeWizard: Crash fixes in prepare/cleanup cascade, notification-center stuff.

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

Legend:

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

    r92041 r92044  
    7979#endif /* VBOX_WS_MAC */
    8080
    81 
    82 UINotificationCenter *UINativeWizard::notificationCenter() const
    83 {
    84     return m_pNotificationCenter;
    85 }
    86 
    87 bool UINativeWizard::handleNotificationProgressNow(UINotificationProgress *pProgress)
    88 {
    89     return m_pNotificationCenter->handleNow(pProgress);
    90 }
    91 
    92 int UINativeWizard::exec()
    93 {
    94     /* Init wizard: */
    95     init();
    96 
    97     /* Call to base-class: */
    98     return QIWithRetranslateUI<QDialog>::exec();
    99 }
    10081
    10182UINativeWizard::UINativeWizard(QWidget *pParent,
     
    119100}
    120101
     102UINativeWizard::~UINativeWizard()
     103{
     104    cleanup();
     105}
     106
     107UINotificationCenter *UINativeWizard::notificationCenter() const
     108{
     109    return m_pNotificationCenter;
     110}
     111
     112bool UINativeWizard::handleNotificationProgressNow(UINotificationProgress *pProgress)
     113{
     114    return m_pNotificationCenter->handleNow(pProgress);
     115}
     116
     117int UINativeWizard::exec()
     118{
     119    /* Init wizard: */
     120    init();
     121
     122    /* Call to base-class: */
     123    return QIWithRetranslateUI<QDialog>::exec();
     124}
     125
    121126QPushButton *UINativeWizard::wizardButton(const WizardButtonType &enmType) const
    122127{
     
    325330    gEDataManager->setModeForWizardType(m_enmType, m_enmMode);
    326331
    327     /* Cleanup/init again: */
    328     cleanup();
     332    /* Reinit everything: */
     333    deinit();
    329334    init();
    330335}
     
    565570    delete m_pNotificationCenter;
    566571    m_pNotificationCenter = 0;
    567 
     572}
     573
     574void UINativeWizard::init()
     575{
     576    /* Populate pages: */
     577    populatePages();
     578
     579    /* Translate wizard: */
     580    retranslateUi();
     581    /* Translate wizard pages: */
     582    retranslatePages();
     583
     584    /* Resize wizard to 'golden ratio': */
     585    resizeToGoldenRatio();
     586
     587    /* Make sure current page initialized: */
     588    sltCurrentIndexChanged();
     589}
     590
     591void UINativeWizard::deinit()
     592{
    568593    /* Remove all the pages: */
    569594    m_pWidgetStack->blockSignals(true);
     
    581606    m_invisiblePages.clear();
    582607    wizardClean();
    583 }
    584 
    585 void UINativeWizard::init()
    586 {
    587     /* Populate pages: */
    588     populatePages();
    589 
    590     /* Translate wizard: */
    591     retranslateUi();
    592     /* Translate wizard pages: */
    593     retranslatePages();
    594 
    595     /* Resize wizard to 'golden ratio': */
    596     resizeToGoldenRatio();
    597 
    598     /* Make sure current page initialized: */
    599     sltCurrentIndexChanged();
    600608}
    601609
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.h

    r92035 r92044  
    8080public:
    8181
    82     /** Returns local notification-center reference. */
    83     UINotificationCenter *notificationCenter() const;
    84     /** Immediately handles notification @a pProgress object. */
    85     bool handleNotificationProgressNow(UINotificationProgress *pProgress);
    86 
    87 public slots:
    88 
    89     /** Executes wizard in window modal mode.
    90       * @note You shouldn't have to override it! */
    91     virtual int exec() /* final */;
    92 
    93 protected:
    94 
    9582    /** Constructs wizard passing @a pParent to the base-class.
    9683      * @param  enmType         Brings the wizard type.
     
    10188                   WizardMode enmMode = WizardMode_Auto,
    10289                   const QString &strHelpHashtag = QString());
     90    /** Destructs wizard. */
     91    virtual ~UINativeWizard() /* override */;
     92
     93    /** Returns local notification-center reference. */
     94    UINotificationCenter *notificationCenter() const;
     95    /** Immediately handles notification @a pProgress object. */
     96    bool handleNotificationProgressNow(UINotificationProgress *pProgress);
     97
     98public slots:
     99
     100    /** Executes wizard in window modal mode.
     101      * @note You shouldn't have to override it! */
     102    virtual int exec() /* final */;
     103
     104protected:
    103105
    104106    /** Returns wizard type. */
     
    166168    /** Inits all. */
    167169    void init();
     170    /** Deinits all. */
     171    void deinit();
    168172
    169173    /** Performs pages translation. */
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