Changeset 98491 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 7, 2023 12:18:02 PM (2 years ago)
- 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 44 44 #include "UIIndicatorsPool.h" 45 45 #include "UIMachine.h" 46 #include "UISession.h"47 46 48 47 … … 55 54 56 55 /** Constructor which remembers passed @a session object. */ 57 UISessionStateStatusBarIndicator(IndicatorType enmType, UIMachine *pMachine , UISession *pSession);56 UISessionStateStatusBarIndicator(IndicatorType enmType, UIMachine *pMachine); 58 57 59 58 /** Returns the indicator type. */ … … 76 75 /** Holds the machine UI reference. */ 77 76 UIMachine *m_pMachine; 78 /** Holds the session UI reference. */79 UISession *m_pSession;80 77 81 78 /** Holds the indicator description. */ … … 145 142 146 143 147 UISessionStateStatusBarIndicator::UISessionStateStatusBarIndicator(IndicatorType enmType, UIMachine *pMachine , UISession *pSession)144 UISessionStateStatusBarIndicator::UISessionStateStatusBarIndicator(IndicatorType enmType, UIMachine *pMachine) 148 145 : m_enmType(enmType) 149 146 , m_pMachine(pMachine) 150 , m_pSession(pSession)151 147 { 152 148 /* Install UISessionStateStatusBarIndicator accessibility interface factory: */ … … 173 169 174 170 /** 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) 177 173 { 178 174 /* Assign state-icons: */ … … 225 221 226 222 /** 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) 229 225 { 230 226 /* Assign state-icons: */ … … 266 262 267 263 /** 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) 270 266 { 271 267 /* Assign state-icons: */ … … 316 312 317 313 /** 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) 320 316 { 321 317 /* Assign state-icons: */ … … 363 359 364 360 /** 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) 367 363 , m_pTimerAutoUpdate(0) 368 364 { … … 441 437 442 438 /** 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) 445 441 { 446 442 /* Assign state-icons: */ … … 481 477 482 478 /** 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) 485 481 { 486 482 /* Assign state-icons: */ … … 518 514 519 515 /** 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) 522 518 { 523 519 /* Assign state-icons: */ … … 565 561 566 562 /** 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) 569 565 , m_pAnimation(0) 570 566 , m_dRotationAngle(0) … … 674 670 675 671 /** 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) 678 674 , m_iCPULoadPercentage(0) 679 675 { … … 781 777 782 778 /** 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) 785 781 { 786 782 /* Assign state-icons: */ … … 857 853 858 854 /** 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) 861 857 { 862 858 /* Assign state-icons: */ … … 939 935 940 936 941 UIIndicatorsPool::UIIndicatorsPool(UIMachine *pMachine, UISession *pSession,QWidget *pParent /* = 0 */)937 UIIndicatorsPool::UIIndicatorsPool(UIMachine *pMachine, QWidget *pParent /* = 0 */) 942 938 : QWidget(pParent) 943 939 , m_pMachine(pMachine) 944 , m_pSession(pSession)945 940 , m_fEnabled(false) 941 , m_pMainLayout(0) 946 942 , m_pTimerAutoUpdate(0) 947 943 { … … 1182 1178 switch (indicatorType) 1183 1179 { 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; 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; 1197 1193 default: break; 1198 1194 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h
r98482 r98491 47 47 class QIStatusBarIndicator; 48 48 class UIMachine; 49 class UISession;50 49 51 50 /** QWidget extension … … 64 63 public: 65 64 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; 72 70 73 71 /** Updates appearance for passed @a indicatorType. */ … … 123 121 /** Holds the machine UI reference. */ 124 122 UIMachine *m_pMachine; 125 /** Holds the session UI reference. */ 126 UISession *m_pSession; 123 127 124 /** Holds whether status-bar is enabled. */ 128 bool m_fEnabled; 125 bool m_fEnabled; 126 129 127 /** Holds the cached restrictions. */ 130 QList<IndicatorType> m_restrictions;128 QList<IndicatorType> m_restrictions; 131 129 /** Holds the cached order. */ 132 QList<IndicatorType> m_order; 130 QList<IndicatorType> m_order; 131 133 132 /** Holds cached indicator instances. */ 134 QMap<IndicatorType, QIStatusBarIndicator*> m_pool; 133 QMap<IndicatorType, QIStatusBarIndicator*> m_pool; 134 135 135 /** Holds the main-layout instance. */ 136 136 QHBoxLayout *m_pMainLayout; 137 137 138 /** Holds the auto-update timer instance. */ 138 139 QTimer *m_pTimerAutoUpdate; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r98450 r98491 311 311 this, &UIMachineWindowNormal::sltHandleStatusBarContextMenuRequest); 312 312 /* Create indicator-pool: */ 313 m_pIndicatorsPool = new UIIndicatorsPool(machineLogic()->uimachine() , machineLogic()->uisession());313 m_pIndicatorsPool = new UIIndicatorsPool(machineLogic()->uimachine()); 314 314 AssertPtrReturnVoid(m_pIndicatorsPool); 315 315 {
Note:
See TracChangeset
for help on using the changeset viewer.