VirtualBox

Ignore:
Timestamp:
Feb 7, 2023 12:18:02 PM (2 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10322: Runtime UI: Reworking UIIndicatorsPool itself to get rid of UISession finally.

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

Legend:

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

    r98490 r98491  
    4444#include "UIIndicatorsPool.h"
    4545#include "UIMachine.h"
    46 #include "UISession.h"
    4746
    4847
     
    5554
    5655    /** Constructor which remembers passed @a session object. */
    57     UISessionStateStatusBarIndicator(IndicatorType enmType, UIMachine *pMachine, UISession *pSession);
     56    UISessionStateStatusBarIndicator(IndicatorType enmType, UIMachine *pMachine);
    5857
    5958    /** Returns the indicator type. */
     
    7675    /** Holds the machine UI reference. */
    7776    UIMachine *m_pMachine;
    78     /** Holds the session UI reference. */
    79     UISession *m_pSession;
    8077
    8178    /** Holds the indicator description. */
     
    145142
    146143
    147 UISessionStateStatusBarIndicator::UISessionStateStatusBarIndicator(IndicatorType enmType, UIMachine *pMachine, UISession *pSession)
     144UISessionStateStatusBarIndicator::UISessionStateStatusBarIndicator(IndicatorType enmType, UIMachine *pMachine)
    148145    : m_enmType(enmType)
    149146    , m_pMachine(pMachine)
    150     , m_pSession(pSession)
    151147{
    152148    /* Install UISessionStateStatusBarIndicator accessibility interface factory: */
     
    173169
    174170    /** Constructs indicator passing @a pMachine to the base-class. */
    175     UIIndicatorHardDrive(UIMachine *pMachine, UISession *pSession)
    176         : UISessionStateStatusBarIndicator(IndicatorType_HardDisks, pMachine, pSession)
     171    UIIndicatorHardDrive(UIMachine *pMachine)
     172        : UISessionStateStatusBarIndicator(IndicatorType_HardDisks, pMachine)
    177173    {
    178174        /* Assign state-icons: */
     
    225221
    226222    /** Constructs indicator passing @a pMachine to the base-class. */
    227     UIIndicatorOpticalDisks(UIMachine *pMachine, UISession *pSession)
    228         : UISessionStateStatusBarIndicator(IndicatorType_OpticalDisks, pMachine, pSession)
     223    UIIndicatorOpticalDisks(UIMachine *pMachine)
     224        : UISessionStateStatusBarIndicator(IndicatorType_OpticalDisks, pMachine)
    229225    {
    230226        /* Assign state-icons: */
     
    266262
    267263    /** Constructs indicator passing @a pMachine to the base-class. */
    268     UIIndicatorFloppyDisks(UIMachine *pMachine, UISession *pSession)
    269         : UISessionStateStatusBarIndicator(IndicatorType_FloppyDisks, pMachine, pSession)
     264    UIIndicatorFloppyDisks(UIMachine *pMachine)
     265        : UISessionStateStatusBarIndicator(IndicatorType_FloppyDisks, pMachine)
    270266    {
    271267        /* Assign state-icons: */
     
    316312
    317313    /** Constructs indicator passing @a pMachine to the base-class. */
    318     UIIndicatorAudio(UIMachine *pMachine, UISession *pSession)
    319         : UISessionStateStatusBarIndicator(IndicatorType_Audio, pMachine, pSession)
     314    UIIndicatorAudio(UIMachine *pMachine)
     315        : UISessionStateStatusBarIndicator(IndicatorType_Audio, pMachine)
    320316    {
    321317        /* Assign state-icons: */
     
    363359
    364360    /** Constructs indicator passing @a pMachine to the base-class. */
    365     UIIndicatorNetwork(UIMachine *pMachine, UISession *pSession)
    366         : UISessionStateStatusBarIndicator(IndicatorType_Network, pMachine, pSession)
     361    UIIndicatorNetwork(UIMachine *pMachine)
     362        : UISessionStateStatusBarIndicator(IndicatorType_Network, pMachine)
    367363        , m_pTimerAutoUpdate(0)
    368364    {
     
    441437
    442438    /** Constructs indicator passing @a pMachine to the base-class. */
    443     UIIndicatorUSB(UIMachine *pMachine, UISession *pSession)
    444         : UISessionStateStatusBarIndicator(IndicatorType_USB, pMachine, pSession)
     439    UIIndicatorUSB(UIMachine *pMachine)
     440        : UISessionStateStatusBarIndicator(IndicatorType_USB, pMachine)
    445441    {
    446442        /* Assign state-icons: */
     
    481477
    482478    /** Constructs indicator passing @a pMachine to the base-class. */
    483     UIIndicatorSharedFolders(UIMachine *pMachine, UISession *pSession)
    484         : UISessionStateStatusBarIndicator(IndicatorType_SharedFolders, pMachine, pSession)
     479    UIIndicatorSharedFolders(UIMachine *pMachine)
     480        : UISessionStateStatusBarIndicator(IndicatorType_SharedFolders, pMachine)
    485481    {
    486482        /* Assign state-icons: */
     
    518514
    519515    /** Constructs indicator passing @a pMachine to the base-class. */
    520     UIIndicatorDisplay(UIMachine *pMachine, UISession *pSession)
    521         : UISessionStateStatusBarIndicator(IndicatorType_Display, pMachine, pSession)
     516    UIIndicatorDisplay(UIMachine *pMachine)
     517        : UISessionStateStatusBarIndicator(IndicatorType_Display, pMachine)
    522518    {
    523519        /* Assign state-icons: */
     
    565561
    566562    /** Constructs indicator passing @a pMachine to the base-class. */
    567     UIIndicatorRecording(UIMachine *pMachine, UISession *pSession)
    568         : UISessionStateStatusBarIndicator(IndicatorType_Recording, pMachine, pSession)
     563    UIIndicatorRecording(UIMachine *pMachine)
     564        : UISessionStateStatusBarIndicator(IndicatorType_Recording, pMachine)
    569565        , m_pAnimation(0)
    570566        , m_dRotationAngle(0)
     
    674670
    675671    /** Constructs indicator passing @a pMachine to the base-class. */
    676     UIIndicatorFeatures(UIMachine *pMachine, UISession *pSession)
    677         : UISessionStateStatusBarIndicator(IndicatorType_Features, pMachine, pSession)
     672    UIIndicatorFeatures(UIMachine *pMachine)
     673        : UISessionStateStatusBarIndicator(IndicatorType_Features, pMachine)
    678674        , m_iCPULoadPercentage(0)
    679675    {
     
    781777
    782778    /** Constructor, using @a pMachine for state-update routine. */
    783     UIIndicatorMouse(UIMachine *pMachine, UISession *pSession)
    784         : UISessionStateStatusBarIndicator(IndicatorType_Mouse, pMachine, pSession)
     779    UIIndicatorMouse(UIMachine *pMachine)
     780        : UISessionStateStatusBarIndicator(IndicatorType_Mouse, pMachine)
    785781    {
    786782        /* Assign state-icons: */
     
    857853
    858854    /** Constructor, using @a pMachine for state-update routine. */
    859     UIIndicatorKeyboard(UIMachine *pMachine, UISession *pSession)
    860         : UISessionStateStatusBarIndicator(IndicatorType_Keyboard, pMachine, pSession)
     855    UIIndicatorKeyboard(UIMachine *pMachine)
     856        : UISessionStateStatusBarIndicator(IndicatorType_Keyboard, pMachine)
    861857    {
    862858        /* Assign state-icons: */
     
    939935
    940936
    941 UIIndicatorsPool::UIIndicatorsPool(UIMachine *pMachine, UISession *pSession, QWidget *pParent /* = 0 */)
     937UIIndicatorsPool::UIIndicatorsPool(UIMachine *pMachine, QWidget *pParent /* = 0 */)
    942938    : QWidget(pParent)
    943939    , m_pMachine(pMachine)
    944     , m_pSession(pSession)
    945940    , m_fEnabled(false)
     941    , m_pMainLayout(0)
    946942    , m_pTimerAutoUpdate(0)
    947943{
     
    11821178            switch (indicatorType)
    11831179            {
    1184                 case IndicatorType_HardDisks:         m_pool[indicatorType] = new UIIndicatorHardDrive(m_pMachine, m_pSession);     break;
    1185                 case IndicatorType_OpticalDisks:      m_pool[indicatorType] = new UIIndicatorOpticalDisks(m_pMachine, m_pSession);  break;
    1186                 case IndicatorType_FloppyDisks:       m_pool[indicatorType] = new UIIndicatorFloppyDisks(m_pMachine, m_pSession);   break;
    1187                 case IndicatorType_Audio:             m_pool[indicatorType] = new UIIndicatorAudio(m_pMachine, m_pSession);         break;
    1188                 case IndicatorType_Network:           m_pool[indicatorType] = new UIIndicatorNetwork(m_pMachine, m_pSession);       break;
    1189                 case IndicatorType_USB:               m_pool[indicatorType] = new UIIndicatorUSB(m_pMachine, m_pSession);           break;
    1190                 case IndicatorType_SharedFolders:     m_pool[indicatorType] = new UIIndicatorSharedFolders(m_pMachine, m_pSession); break;
    1191                 case IndicatorType_Display:           m_pool[indicatorType] = new UIIndicatorDisplay(m_pMachine, m_pSession);       break;
    1192                 case IndicatorType_Recording:         m_pool[indicatorType] = new UIIndicatorRecording(m_pMachine, m_pSession);     break;
    1193                 case IndicatorType_Features:          m_pool[indicatorType] = new UIIndicatorFeatures(m_pMachine, m_pSession);      break;
    1194                 case IndicatorType_Mouse:             m_pool[indicatorType] = new UIIndicatorMouse(m_pMachine, m_pSession);         break;
    1195                 case IndicatorType_Keyboard:          m_pool[indicatorType] = new UIIndicatorKeyboard(m_pMachine, m_pSession);      break;
    1196                 case IndicatorType_KeyboardExtension: m_pool[indicatorType] = new UIIndicatorKeyboardExtension;                     break;
     1180                case IndicatorType_HardDisks:         m_pool[indicatorType] = new UIIndicatorHardDrive(m_pMachine);     break;
     1181                case IndicatorType_OpticalDisks:      m_pool[indicatorType] = new UIIndicatorOpticalDisks(m_pMachine);  break;
     1182                case IndicatorType_FloppyDisks:       m_pool[indicatorType] = new UIIndicatorFloppyDisks(m_pMachine);   break;
     1183                case IndicatorType_Audio:             m_pool[indicatorType] = new UIIndicatorAudio(m_pMachine);         break;
     1184                case IndicatorType_Network:           m_pool[indicatorType] = new UIIndicatorNetwork(m_pMachine);       break;
     1185                case IndicatorType_USB:               m_pool[indicatorType] = new UIIndicatorUSB(m_pMachine);           break;
     1186                case IndicatorType_SharedFolders:     m_pool[indicatorType] = new UIIndicatorSharedFolders(m_pMachine); break;
     1187                case IndicatorType_Display:           m_pool[indicatorType] = new UIIndicatorDisplay(m_pMachine);       break;
     1188                case IndicatorType_Recording:         m_pool[indicatorType] = new UIIndicatorRecording(m_pMachine);     break;
     1189                case IndicatorType_Features:          m_pool[indicatorType] = new UIIndicatorFeatures(m_pMachine);      break;
     1190                case IndicatorType_Mouse:             m_pool[indicatorType] = new UIIndicatorMouse(m_pMachine);         break;
     1191                case IndicatorType_Keyboard:          m_pool[indicatorType] = new UIIndicatorKeyboard(m_pMachine);      break;
     1192                case IndicatorType_KeyboardExtension: m_pool[indicatorType] = new UIIndicatorKeyboardExtension;         break;
    11971193                default: break;
    11981194            }
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h

    r98482 r98491  
    4747class QIStatusBarIndicator;
    4848class UIMachine;
    49 class UISession;
    5049
    5150/** QWidget extension
     
    6463public:
    6564
    66     /** Constructor, passes @a pParent to the QWidget constructor.
    67       * @param  pMachine  Brings the machine UI reference.
    68       * @param  pSession  Brings the session UI reference. */
    69     UIIndicatorsPool(UIMachine *pMachine, UISession *pSession, QWidget *pParent = 0);
    70     /** Destructor. */
    71     ~UIIndicatorsPool();
     65    /** Constructs indicator-pool passing @a pParent to the base-class.
     66      * @param  pMachine  Brings the machine UI reference. */
     67    UIIndicatorsPool(UIMachine *pMachine, QWidget *pParent = 0);
     68    /** Destructs indicator-pool. */
     69    virtual ~UIIndicatorsPool() RT_OVERRIDE;
    7270
    7371    /** Updates appearance for passed @a indicatorType. */
     
    123121    /** Holds the machine UI reference. */
    124122    UIMachine *m_pMachine;
    125     /** Holds the session UI reference. */
    126     UISession *m_pSession;
     123
    127124    /** Holds whether status-bar is enabled. */
    128     bool m_fEnabled;
     125    bool  m_fEnabled;
     126
    129127    /** Holds the cached restrictions. */
    130     QList<IndicatorType> m_restrictions;
     128    QList<IndicatorType>  m_restrictions;
    131129    /** Holds the cached order. */
    132     QList<IndicatorType> m_order;
     130    QList<IndicatorType>  m_order;
     131
    133132    /** Holds cached indicator instances. */
    134     QMap<IndicatorType, QIStatusBarIndicator*> m_pool;
     133    QMap<IndicatorType, QIStatusBarIndicator*>  m_pool;
     134
    135135    /** Holds the main-layout instance. */
    136136    QHBoxLayout *m_pMainLayout;
     137
    137138    /** Holds the auto-update timer instance. */
    138139    QTimer *m_pTimerAutoUpdate;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r98450 r98491  
    311311                this, &UIMachineWindowNormal::sltHandleStatusBarContextMenuRequest);
    312312        /* Create indicator-pool: */
    313         m_pIndicatorsPool = new UIIndicatorsPool(machineLogic()->uimachine(), machineLogic()->uisession());
     313        m_pIndicatorsPool = new UIIndicatorsPool(machineLogic()->uimachine());
    314314        AssertPtrReturnVoid(m_pIndicatorsPool);
    315315        {
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