VirtualBox

Changeset 99139 in vbox for trunk


Ignore:
Timestamp:
Mar 23, 2023 12:16:07 PM (19 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10322: Runtime UI: Initialize notification-center before session UI stuff, cleanup accordingly.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r99135 r99139  
    14621462bool UIMachine::prepare()
    14631463{
    1464     /* Create session UI: */
    1465     m_pSession = new UISession(this);
    1466     AssertPtrReturn(uisession(), false);
    1467     /* And make sure it's prepared: */
    1468     if (!uisession()->prepare())
     1464    /* Prepare stuff unrelated to VM: */
     1465    prepareNotificationCenter();
     1466
     1467    /* Prepare VM session: */
     1468    if (!prepareSession())
    14691469        return false;
    14701470
    1471     /* Prepare stuff: */
    1472     prepareNotificationCenter();
     1471    /* Prepare VM related stuff: */
    14731472    prepareBranding();
    1474     prepareSessionConnections();
    14751473    prepareActions();
    14761474    prepareScreens();
     
    14791477    prepareMachineLogic();
    14801478
    1481     /* Try to initialize session UI: */
     1479    /* Try to initialize VM session: */
    14821480    if (!uisession()->initialize())
    14831481        return false;
     
    15011499}
    15021500
    1503 void UIMachine::prepareBranding()
    1504 {
    1505     /* Create the icon dynamically: */
    1506     m_pMachineWindowIcon = new QIcon;
    1507     acquireUserMachineIcon(*m_pMachineWindowIcon);
    1508 
    1509 #ifndef VBOX_WS_MAC
    1510     /* Load user's machine-window name postfix: */
    1511     const QUuid uMachineID = uiCommon().managedVMUuid();
    1512     m_strMachineWindowNamePostfix = gEDataManager->machineWindowNamePostfix(uMachineID);
    1513 #endif /* !VBOX_WS_MAC */
    1514 }
    1515 
    1516 void UIMachine::prepareSessionConnections()
    1517 {
     1501bool UIMachine::prepareSession()
     1502{
     1503    /* Create session UI: */
     1504    m_pSession = new UISession(this);
     1505    AssertPtrReturn(uisession(), false);
     1506
    15181507    /* Console events stuff: */
    15191508    connect(uisession(), &UISession::sigAudioAdapterChange,
     
    15671556    connect(uisession(), &UISession::sigCursorPositionChange,
    15681557            this, &UIMachine::sltCursorPositionChange);
     1558
     1559    /* Make sure session prepared: */
     1560    return uisession()->prepare();
     1561}
     1562
     1563void UIMachine::prepareBranding()
     1564{
     1565    /* Create the icon dynamically: */
     1566    m_pMachineWindowIcon = new QIcon;
     1567    acquireUserMachineIcon(*m_pMachineWindowIcon);
     1568
     1569#ifndef VBOX_WS_MAC
     1570    /* Load user's machine-window name postfix: */
     1571    const QUuid uMachineID = uiCommon().managedVMUuid();
     1572    m_strMachineWindowNamePostfix = gEDataManager->machineWindowNamePostfix(uMachineID);
     1573#endif /* !VBOX_WS_MAC */
    15691574}
    15701575
     
    18421847    cleanupActions();
    18431848    cleanupBranding();
     1849    cleanupSession();
    18441850    cleanupNotificationCenter();
    1845 
    1846     /* Cleanup session UI: */
    1847     cleanupSession();
    18481851}
    18491852
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r99135 r99139  
    844844    /** Prepares notification-center. */
    845845    void prepareNotificationCenter();
     846    /** Prepare routine: Session stuff. */
     847    bool prepareSession();
    846848    /** Prepare routine: Branding. */
    847849    void prepareBranding();
    848     /** Prepare routine: Session connection stuff. */
    849     void prepareSessionConnections();
    850850    /** Prepare routine: Actions stuff. */
    851851    void prepareActions();
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