VirtualBox

Changeset 98398 in vbox for trunk


Ignore:
Timestamp:
Feb 1, 2023 2:46:54 PM (2 years ago)
Author:
vboxsync
Message:

Merging r155311 from gui4 branch: FE/Qt: Runtime UI: A bit of cleanup for branding and UIMachine/UISession factory stuff.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3:79645-79692
        21 /branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288
         21/branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311
        2222/trunk/src:92342,154921
  • trunk/src/VBox

    • Property svn:mergeinfo
      •  

        old new  
        1919/branches/dsen/gui2/src/VBox:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        2020/branches/dsen/gui3/src/VBox:79645-79692
        21 /branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288
         21/branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311
  • trunk/src/VBox/Frontends

    • Property svn:mergeinfo
      •  

        old new  
        1616/branches/dsen/gui2/src/VBox/Frontends:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644
        1717/branches/dsen/gui3/src/VBox/Frontends:79645-79692
        18 /branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288
         18/branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98386 r98398  
    615615    if (!UISession::create(m_pSession, this))
    616616        return false;
    617 
    618     /* Make sure session UI created: */
    619     AssertReturn(m_pSession, false);
     617    AssertPtrReturn(m_pSession, false);
    620618
    621619    /* Cache media data early if necessary: */
     
    626624    prepareSessionConnections();
    627625    prepareScreens();
    628     prepareMachineWindowIcon();
     626    prepareBranding();
    629627    prepareMachineLogic();
    630 
    631     /* Load settings: */
    632     loadSettings();
    633628
    634629    /* Try to initialize session UI: */
     
    787782}
    788783
    789 void UIMachine::prepareMachineWindowIcon()
     784void UIMachine::prepareBranding()
    790785{
    791786    /* Acquire user machine-window icon: */
     
    799794    /* Store the icon dynamically: */
    800795    m_pMachineWindowIcon = new QIcon(icon);
     796
     797#ifndef VBOX_WS_MAC
     798    /* Load user's machine-window name postfix: */
     799    const QUuid uMachineID = uiCommon().managedVMUuid();
     800    m_strMachineWindowNamePostfix = gEDataManager->machineWindowNamePostfix(uMachineID);
     801#endif /* !VBOX_WS_MAC */
    801802}
    802803
     
    843844}
    844845
    845 void UIMachine::loadSettings()
    846 {
    847     /* Load extra-data settings: */
    848     {
    849         /* Get machine ID: */
    850         const QUuid uMachineID = uiCommon().managedVMUuid();
    851         Q_UNUSED(uMachineID);
    852 
    853 #ifndef VBOX_WS_MAC
    854         /* Load user's machine-window name postfix: */
    855         m_strMachineWindowNamePostfix = gEDataManager->machineWindowNamePostfix(uMachineID);
    856 #endif
    857     }
    858 }
    859 
    860 void UIMachine::cleanupMachineWindowIcon()
     846void UIMachine::cleanupBranding()
    861847{
    862848    /* Cleanup machine-window icon: */
     
    887873    /* Cleanup stuff: */
    888874    cleanupMachineLogic();
    889     cleanupMachineWindowIcon();
     875    cleanupBranding();
    890876    cleanupScreens();
    891877
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98386 r98398  
    4444#include "COMEnums.h"
    4545#include "CMediumAttachment.h"
    46 #include "CNetworkAdapter.h"
    47 #include "CUSBDevice.h"
    4846
    4947/* Forward declarations: */
     
    372370    /** Prepare routine: Screens stuff. */
    373371    void prepareScreens();
    374     /** Prepare routine: Machine-window icon. */
    375     void prepareMachineWindowIcon();
     372    /** Prepare routine: Branding. */
     373    void prepareBranding();
    376374    /** Prepare routine: Machine-logic stuff. */
    377375    void prepareMachineLogic();
    378376
    379     /** Performs settings loading. */
    380     void loadSettings();
    381 
    382377    /** Cleanup routine: Machine-logic stuff. */
    383378    void cleanupMachineLogic();
    384     /** Cleanup routine: Machine-window icon. */
    385     void cleanupMachineWindowIcon();
     379    /** Cleanup routine: Branding. */
     380    void cleanupBranding();
    386381    /** Cleanup routine: Screens stuff. */
    387382    void cleanupScreens();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98386 r98398  
    8989bool UISession::create(UISession *&pSession, UIMachine *pMachine)
    9090{
    91     /* Make sure null pointer passed: */
    92     AssertReturn(pSession == 0, false);
     91    /* Make sure NULL pointer passed: */
     92    AssertReturn(!pSession, false);
    9393
    9494    /* Create session UI: */
    9595    pSession = new UISession(pMachine);
     96    AssertPtrReturn(pSession, false);
     97
    9698    /* Make sure it's prepared: */
    9799    if (!pSession->prepare())
     
    102104        return false;
    103105    }
     106
    104107    /* True by default: */
    105108    return true;
     
    110113{
    111114    /* Make sure valid pointer passed: */
    112     AssertReturnVoid(pSession != 0);
    113 
    114     /* Cleanup session UI: */
    115     pSession->cleanup();
    116     /* Destroy session: */
     115    AssertPtrReturnVoid(pSession);
     116
     117    /* Delete session: */
    117118    delete pSession;
    118119    pSession = 0;
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