Changeset 54145 in vbox
- Timestamp:
- Feb 11, 2015 3:42:49 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r53320 r54145 69 69 70 70 /** Constructor which remembers passed @a session object. */ 71 UISessionStateStatusBarIndicator( CSession &session) : m_session(session) {}71 UISessionStateStatusBarIndicator(UISession *pSession) : m_pSession(pSession) {} 72 72 73 73 /** Abstract update routine. */ … … 76 76 protected: 77 77 78 /** Holds the session reference. */79 CSession &m_session;78 /** Holds the session UI reference. */ 79 UISession *m_pSession; 80 80 }; 81 81 … … 87 87 public: 88 88 89 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */90 UIIndicatorHardDrive( CSession &session)91 : UISessionStateStatusBarIndicator( session)89 /** Constructor, passes @a pSession to the UISessionStateStatusBarIndicator constructor. */ 90 UIIndicatorHardDrive(UISession *pSession) 91 : UISessionStateStatusBarIndicator(pSession) 92 92 { 93 93 /* Assign state-icons: */ … … 112 112 { 113 113 /* Get machine: */ 114 const CMachine machine = m_ session.GetMachine();114 const CMachine machine = m_pSession->machine(); 115 115 116 116 /* Prepare tool-tip: */ … … 160 160 public: 161 161 162 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */163 UIIndicatorOpticalDisks( CSession &session)164 : UISessionStateStatusBarIndicator( session)162 /** Constructor, passes @a pSession to the UISessionStateStatusBarIndicator constructor. */ 163 UIIndicatorOpticalDisks(UISession *pSession) 164 : UISessionStateStatusBarIndicator(pSession) 165 165 { 166 166 /* Assign state-icons: */ … … 185 185 { 186 186 /* Get machine: */ 187 const CMachine machine = m_ session.GetMachine();187 const CMachine machine = m_pSession->machine(); 188 188 189 189 /* Prepare tool-tip: */ … … 237 237 public: 238 238 239 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */240 UIIndicatorFloppyDisks( CSession &session)241 : UISessionStateStatusBarIndicator( session)239 /** Constructor, passes @a pSession to the UISessionStateStatusBarIndicator constructor. */ 240 UIIndicatorFloppyDisks(UISession *pSession) 241 : UISessionStateStatusBarIndicator(pSession) 242 242 { 243 243 /* Assign state-icons: */ … … 262 262 { 263 263 /* Get machine: */ 264 const CMachine machine = m_ session.GetMachine();264 const CMachine machine = m_pSession->machine(); 265 265 266 266 /* Prepare tool-tip: */ … … 314 314 public: 315 315 316 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */316 /** Constructor, passes @a pSession to the UISessionStateStatusBarIndicator constructor. */ 317 317 UIIndicatorNetwork(UISession *pSession) 318 : UISessionStateStatusBarIndicator(pSession->session()) 319 , m_pSession(pSession) 318 : UISessionStateStatusBarIndicator(pSession) 320 319 , m_pTimerAutoUpdate(0) 321 320 { … … 374 373 { 375 374 /* Get machine: */ 376 const CMachine machine = m_ session.GetMachine();375 const CMachine machine = m_pSession->machine(); 377 376 378 377 /* Prepare tool-tip: */ … … 452 451 } 453 452 454 /** Holds the session UI reference. */455 UISession *m_pSession;456 453 /** Holds the auto-update timer instance. */ 457 454 QTimer *m_pTimerAutoUpdate; … … 465 462 public: 466 463 467 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */468 UIIndicatorUSB( CSession &session)469 : UISessionStateStatusBarIndicator( session)464 /** Constructor, passes @a pSession to the UISessionStateStatusBarIndicator constructor. */ 465 UIIndicatorUSB(UISession *pSession) 466 : UISessionStateStatusBarIndicator(pSession) 470 467 { 471 468 /* Assign state-icons: */ … … 490 487 { 491 488 /* Get machine: */ 492 const CMachine machine = m_ session.GetMachine();489 const CMachine machine = m_pSession->machine(); 493 490 494 491 /* Prepare tool-tip: */ … … 505 502 { 506 503 /* Enumerate all the USB devices: */ 507 const CConsole &console = m_session.GetConsole();504 const CConsole console = m_pSession->console(); 508 505 foreach (const CUSBDevice &usbDevice, console.GetUSBDevices()) 509 506 strFullData += QString("<br><b><nobr>%1</nobr></b>").arg(vboxGlobal().details(usbDevice)); … … 531 528 public: 532 529 533 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */534 UIIndicatorSharedFolders( CSession &session)535 : UISessionStateStatusBarIndicator( session)530 /** Constructor, passes @a pSession to the UISessionStateStatusBarIndicator constructor. */ 531 UIIndicatorSharedFolders(UISession *pSession) 532 : UISessionStateStatusBarIndicator(pSession) 536 533 { 537 534 /* Assign state-icons: */ … … 555 552 void updateAppearance() 556 553 { 557 /* Get machine: */ 558 const CMachine machine = m_session.GetMachine(); 559 const CConsole console = m_session.GetConsole(); 554 /* Get objects: */ 555 const CMachine machine = m_pSession->machine(); 556 const CConsole console = m_pSession->console(); 557 const CGuest guest = m_pSession->guest(); 560 558 561 559 /* Prepare tool-tip: */ … … 576 574 { 577 575 /* Select slashes depending on the OS type: */ 578 if (VBoxGlobal::isDOSType( console.GetGuest().GetOSTypeId()))576 if (VBoxGlobal::isDOSType(guest.GetOSTypeId())) 579 577 strFullData += QString("<br><nobr><b>\\\\vboxsvr\\%1 </b></nobr><nobr>%2</nobr>") 580 578 .arg(it.key(), it.value()); … … 601 599 public: 602 600 603 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */604 UIIndicatorDisplay( CSession &session)605 : UISessionStateStatusBarIndicator( session)601 /** Constructor, passes @a pSession to the UISessionStateStatusBarIndicator constructor. */ 602 UIIndicatorDisplay(UISession *pSession) 603 : UISessionStateStatusBarIndicator(pSession) 606 604 { 607 605 /* Assign state-icons: */ … … 625 623 { 626 624 /* Get machine: */ 627 const CMachine machine = m_ session.GetMachine();625 const CMachine machine = m_pSession->machine(); 628 626 629 627 /* Prepare tool-tip: */ … … 683 681 public: 684 682 685 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */686 UIIndicatorVideoCapture( CSession &session)687 : UISessionStateStatusBarIndicator( session)683 /** Constructor, passes @a pSession to the UISessionStateStatusBarIndicator constructor. */ 684 UIIndicatorVideoCapture(UISession *pSession) 685 : UISessionStateStatusBarIndicator(pSession) 688 686 , m_pAnimation(0) 689 687 , m_dRotationAngle(0) … … 756 754 { 757 755 /* Get machine: */ 758 const CMachine machine = m_ session.GetMachine();756 const CMachine machine = m_pSession->machine(); 759 757 760 758 /* Prepare tool-tip: */ … … 805 803 public: 806 804 807 /** Constructor, passes @a session to the UISessionStateStatusBarIndicator constructor. */808 UIIndicatorFeatures( CSession &session)809 : UISessionStateStatusBarIndicator( session)805 /** Constructor, passes @a pSession to the UISessionStateStatusBarIndicator constructor. */ 806 UIIndicatorFeatures(UISession *pSession) 807 : UISessionStateStatusBarIndicator(pSession) 810 808 { 811 809 /* Assign state-icons: */ … … 827 825 void updateAppearance() 828 826 { 829 /* Get console: */ 830 const CConsole console = m_session.GetConsole(); 831 if (console.isNull()) 832 return; 833 834 /* Get debugger: */ 835 const CMachineDebugger debugger = console.GetDebugger(); 836 if (debugger.isNull()) 837 return; 827 /* Get objects: */ 828 const CMachine machine = m_pSession->machine(); 829 const CMachineDebugger debugger = m_pSession->debugger(); 838 830 839 831 /* VT-x/AMD-V feature: */ … … 854 846 VBoxGlobal::tr("Enabled", "details report (Unrestricted Execution)") : 855 847 VBoxGlobal::tr("Disabled", "details report (Unrestricted Execution)"); 856 857 /* Get machine: */858 const CMachine machine = console.GetMachine();859 if (machine.isNull())860 return;861 848 862 849 /* CPU Execution Cap feature: */ … … 898 885 /** Constructor, using @a pSession for state-update routine. */ 899 886 UIIndicatorMouse(UISession *pSession) 900 : UISessionStateStatusBarIndicator(pSession ->session())887 : UISessionStateStatusBarIndicator(pSession) 901 888 { 902 889 /* Assign state-icons: */ … … 958 945 /** Constructor, using @a pSession for state-update routine. */ 959 946 UIIndicatorKeyboard(UISession *pSession) 960 : UISessionStateStatusBarIndicator(pSession ->session())947 : UISessionStateStatusBarIndicator(pSession) 961 948 { 962 949 /* Assign state-icons: */ … … 1029 1016 : QWidget(pParent) 1030 1017 , m_pSession(pSession) 1031 , m_session(m_pSession->session())1032 1018 , m_fEnabled(false) 1033 1019 , m_pTimerAutoUpdate(0) … … 1103 1089 1104 1090 /* Acquire current states from the console: */ 1105 CConsole console = m_ session.GetConsole();1106 if ( !m_session.isOk() || console.isNull())1091 CConsole console = m_pSession->console(); 1092 if (console.isNull() || !console.isOk()) 1107 1093 return; 1108 1094 const QVector<KDeviceActivity> states = console.GetDeviceActivity(deviceTypes); … … 1258 1244 switch (indicatorType) 1259 1245 { 1260 case IndicatorType_HardDisks: m_pool[indicatorType] = new UIIndicatorHardDrive(m_ session); break;1261 case IndicatorType_OpticalDisks: m_pool[indicatorType] = new UIIndicatorOpticalDisks(m_ session); break;1262 case IndicatorType_FloppyDisks: m_pool[indicatorType] = new UIIndicatorFloppyDisks(m_ session); break;1246 case IndicatorType_HardDisks: m_pool[indicatorType] = new UIIndicatorHardDrive(m_pSession); break; 1247 case IndicatorType_OpticalDisks: m_pool[indicatorType] = new UIIndicatorOpticalDisks(m_pSession); break; 1248 case IndicatorType_FloppyDisks: m_pool[indicatorType] = new UIIndicatorFloppyDisks(m_pSession); break; 1263 1249 case IndicatorType_Network: m_pool[indicatorType] = new UIIndicatorNetwork(m_pSession); break; 1264 case IndicatorType_USB: m_pool[indicatorType] = new UIIndicatorUSB(m_ session); break;1265 case IndicatorType_SharedFolders: m_pool[indicatorType] = new UIIndicatorSharedFolders(m_ session); break;1266 case IndicatorType_Display: m_pool[indicatorType] = new UIIndicatorDisplay(m_ session); break;1267 case IndicatorType_VideoCapture: m_pool[indicatorType] = new UIIndicatorVideoCapture(m_ session); break;1268 case IndicatorType_Features: m_pool[indicatorType] = new UIIndicatorFeatures(m_ session); break;1269 case IndicatorType_Mouse: m_pool[indicatorType] = new UIIndicatorMouse(m_pSession); break;1270 case IndicatorType_Keyboard: m_pool[indicatorType] = new UIIndicatorKeyboard(m_pSession); break;1271 case IndicatorType_KeyboardExtension: m_pool[indicatorType] = new UIIndicatorKeyboardExtension; break;1250 case IndicatorType_USB: m_pool[indicatorType] = new UIIndicatorUSB(m_pSession); break; 1251 case IndicatorType_SharedFolders: m_pool[indicatorType] = new UIIndicatorSharedFolders(m_pSession); break; 1252 case IndicatorType_Display: m_pool[indicatorType] = new UIIndicatorDisplay(m_pSession); break; 1253 case IndicatorType_VideoCapture: m_pool[indicatorType] = new UIIndicatorVideoCapture(m_pSession); break; 1254 case IndicatorType_Features: m_pool[indicatorType] = new UIIndicatorFeatures(m_pSession); break; 1255 case IndicatorType_Mouse: m_pool[indicatorType] = new UIIndicatorMouse(m_pSession); break; 1256 case IndicatorType_Keyboard: m_pool[indicatorType] = new UIIndicatorKeyboard(m_pSession); break; 1257 case IndicatorType_KeyboardExtension: m_pool[indicatorType] = new UIIndicatorKeyboardExtension; break; 1272 1258 default: break; 1273 1259 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h
r53320 r54145 106 106 /** Holds the UI session reference. */ 107 107 UISession *m_pSession; 108 /** Holds the session reference. */109 CSession &m_session;110 108 /** Holds whether status-bar is enabled. */ 111 109 bool m_fEnabled;
Note:
See TracChangeset
for help on using the changeset viewer.