Changeset 105233 in vbox
- Timestamp:
- Jul 9, 2024 11:04:57 AM (5 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r105150 r105233 1376 1376 1377 1377 void UIDetailsGenerator::acquireUsbStatusInfo(CMachine &comMachine, CConsole &comConsole, 1378 QString &strInfo, bool &fUsbEnabled )1378 QString &strInfo, bool &fUsbEnabled, uint &cUsbFilterCount) 1379 1379 { 1380 1380 /* Check whether there is at least one USB controller with an available proxy: */ … … 1386 1386 /* Enumerate all the USB devices: */ 1387 1387 foreach (const CUSBDevice &comUsbDevice, comConsole.GetUSBDevices()) 1388 { 1389 ++cUsbFilterCount; 1388 1390 strInfo += e_strTableRow1.arg(usbDetails(comUsbDevice)); 1391 } 1389 1392 /* Handle 'no-usb-devices' case: */ 1390 1393 if (strInfo.isNull()) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.h
r104917 r105233 105 105 106 106 SHARED_LIBRARY_STUFF void acquireUsbStatusInfo(CMachine &comMachine, CConsole &comConsole, 107 QString &strInfo, bool &fUsbEnabled s);107 QString &strInfo, bool &fUsbEnabled, uint &cUsbFilterCount); 108 108 109 109 SHARED_LIBRARY_STUFF void acquireSharedFoldersStatusInfo(CMachine &comMachine, CConsole &comConsole, CGuest &comGuest, -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r105197 r105233 568 568 UIIndicatorUSB(UIMachine *pMachine) 569 569 : UISessionStateStatusBarIndicator(IndicatorType_USB, pMachine) 570 , m_fUsbEnabled(false) 571 , m_cUsbFilterCount(0) 570 572 { 571 573 /* Assign state-icons: */ … … 591 593 { 592 594 QString strFullData; 593 bool fUsbEnabled = false; 594 m_pMachine->acquireUsbStatusInfo(strFullData, fUsbEnabled); 595 m_fUsbEnabled = false; 596 m_cUsbFilterCount = 0; 597 m_pMachine->acquireUsbStatusInfo(strFullData, m_fUsbEnabled, m_cUsbFilterCount); 595 598 596 599 /* Show/hide indicator if there are no attachments … … 598 601 if ( parentWidget() 599 602 && parentWidget()->isVisible()) 600 setVisible( fUsbEnabled);603 setVisible(m_fUsbEnabled); 601 604 602 605 /* Update tool-tip: */ … … 604 607 setToolTip(s_strTable.arg(strFullData)); 605 608 /* Update indicator state: */ 606 setState( fUsbEnabled ? KDeviceActivity_Idle : KDeviceActivity_Null);609 setState(m_fUsbEnabled ? KDeviceActivity_Idle : KDeviceActivity_Null); 607 610 608 611 /* Retranslate finally: */ 609 612 sltRetranslateUI(); 610 613 } 614 615 /** Handles translation event. */ 616 virtual void sltRetranslateUI() RT_OVERRIDE 617 { 618 /* Call to base-class: */ 619 UISessionStateStatusBarIndicator::sltRetranslateUI(); 620 621 /* Append description with more info: */ 622 const QString strUsbStatus = m_fUsbEnabled ? tr("USB enabled") : tr("USB disabled"); 623 const QString strFilterCount = m_cUsbFilterCount ? tr("%1 USB devices attached").arg(m_cUsbFilterCount) 624 : tr("No USB devices attached", "USB tooltip"); 625 m_strDescription = QString("%1, %2, %3").arg(m_strDescription, strUsbStatus, strFilterCount); 626 } 627 628 private: 629 630 /** Holds whether USB subsystem is enabled. */ 631 bool m_fUsbEnabled; 632 /** Holds USB device filter count. */ 633 uint m_cUsbFilterCount; 634 611 635 }; 612 636 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r105081 r105233 927 927 } 928 928 929 void UIMachine::acquireUsbStatusInfo(QString &strInfo, bool &fUsbEnabled s)930 { 931 uisession()->acquireUsbStatusInfo(strInfo, fUsbEnabled s);929 void UIMachine::acquireUsbStatusInfo(QString &strInfo, bool &fUsbEnabled, uint &cUsbFilterCount) 930 { 931 uisession()->acquireUsbStatusInfo(strInfo, fUsbEnabled, cUsbFilterCount); 932 932 } 933 933 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r104917 r105233 635 635 void acquireNetworkStatusInfo(QString &strInfo, bool &fAdaptersPresent, bool &fCablesDisconnected); 636 636 /** Acquires status info for USB indicator. */ 637 void acquireUsbStatusInfo(QString &strInfo, bool &fUsbEnabled s);637 void acquireUsbStatusInfo(QString &strInfo, bool &fUsbEnabled, uint &cUsbFilterCount); 638 638 /** Acquires status info for Shared Folders indicator. */ 639 639 void acquireSharedFoldersStatusInfo(QString &strInfo, bool &fFoldersPresent); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r105150 r105233 2018 2018 } 2019 2019 2020 void UISession::acquireUsbStatusInfo(QString &strInfo, bool &fUsbEnabled s)2020 void UISession::acquireUsbStatusInfo(QString &strInfo, bool &fUsbEnabled, uint &cUsbFilterCount) 2021 2021 { 2022 2022 CMachine comMachine = machine(); … … 2026 2026 if (comConsole.isNull()) 2027 2027 return; 2028 UIDetailsGenerator::acquireUsbStatusInfo(comMachine, comConsole, strInfo, fUsbEnabled s);2028 UIDetailsGenerator::acquireUsbStatusInfo(comMachine, comConsole, strInfo, fUsbEnabled, cUsbFilterCount); 2029 2029 } 2030 2030 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r104917 r105233 517 517 void acquireNetworkStatusInfo(QString &strInfo, bool &fAdaptersPresent, bool &fCablesDisconnected); 518 518 /** Acquires status info for USB indicator. */ 519 void acquireUsbStatusInfo(QString &strInfo, bool &fUsbEnabled s);519 void acquireUsbStatusInfo(QString &strInfo, bool &fUsbEnabled, uint &cUsbFilterCount); 520 520 /** Acquires status info for Shared Folders indicator. */ 521 521 void acquireSharedFoldersStatusInfo(QString &strInfo, bool &fFoldersPresent);
Note:
See TracChangeset
for help on using the changeset viewer.