VirtualBox

Changeset 99265 in vbox for trunk/src


Ignore:
Timestamp:
Apr 3, 2023 3:38:36 PM (22 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6669: More accurate handling for Notification-center cleanup in Native wizard; We have to make sure all pending blocking operations finished.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.cpp

    r99263 r99265  
    290290}
    291291
     292bool UINotificationCenter::hasOperationsPending() const
     293{
     294    return m_pEventLoop;
     295}
     296
     297void UINotificationCenter::abortOperations()
     298{
     299    m_pEventLoop->exit();
     300    emit sigOperationsAborted();
     301}
     302
    292303void UINotificationCenter::retranslateUi()
    293304{
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.h

    r99263 r99265  
    6767    void sigClose();
    6868
     69    /** Notifies listener about all operations aborted. */
     70    void sigOperationsAborted();
     71
    6972public:
    7073
     
    9598      * @note It's a blocking call finished by sltHandleProgressFinished(). */
    9699    bool handleNow(UINotificationProgress *pProgress);
     100    /** Returns whether center has blocking operation. */
     101    bool hasOperationsPending() const;
     102    /** Aborts blocking operations being performed. */
     103    void abortOperations();
    97104
    98105protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.cpp

    r99205 r99265  
    289289        pEvent->ignore();
    290290
     291        /* Let the notification-center abort blocking operations: */
     292        if (m_pNotificationCenter->hasOperationsPending())
     293            m_pNotificationCenter->abortOperations();
     294        else
    291295        /* Tell the listener to close us (once): */
    292296        if (!m_fClosed)
     
    589593    /* Prepare local notification-center: */
    590594    m_pNotificationCenter = new UINotificationCenter(this);
     595    if (m_pNotificationCenter)
     596        connect(m_pNotificationCenter, &UINotificationCenter::sigOperationsAborted,
     597                this, &UINativeWizard::close, Qt::QueuedConnection);
    591598}
    592599
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