Changeset 98829 in vbox
- Timestamp:
- Mar 3, 2023 12:20:45 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156151
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98811 r98829 794 794 { 795 795 return uisession()->updateMachineStorage(target, pActionPool); 796 } 797 798 void UIMachine::acquireWhetherUSBControllerEnabled(bool &fEnabled) 799 { 800 return uisession()->acquireWhetherUSBControllerEnabled(fEnabled); 801 } 802 803 void UIMachine::acquireWhetherVideoInputDevicesEnabled(bool &fEnabled) 804 { 805 return uisession()->acquireWhetherVideoInputDevicesEnabled(fEnabled); 796 806 } 797 807 … … 1815 1825 { 1816 1826 /* Get host and prepare restrictions: */ 1817 const CHost comHost = uiCommon().host();1818 1827 UIExtraDataMetaDefs::RuntimeMenuMachineActionType restrictionForMachine = 1819 1828 UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Invalid; … … 1885 1894 { 1886 1895 /* Check whether there is at least one USB controller with an available proxy. */ 1887 const bool fUSBEnabled = !uisession()->machine().GetUSBDeviceFilters().isNull() 1888 && !uisession()->machine().GetUSBControllers().isEmpty() 1889 && uisession()->machine().GetUSBProxyAvailable(); 1896 bool fUSBEnabled = false; 1897 acquireWhetherUSBControllerEnabled(fUSBEnabled); 1890 1898 if (!fUSBEnabled) 1891 1899 restrictionForDevices = (UIExtraDataMetaDefs::RuntimeMenuDevicesActionType) … … 1896 1904 { 1897 1905 /* Check whether there is an accessible video input devices pool: */ 1898 comHost.GetVideoInputDevices();1899 const bool fWebCamsEnabled = comHost.isOk() && !uisession()->machine().GetUSBControllers().isEmpty();1906 bool fWebCamsEnabled = false; 1907 acquireWhetherVideoInputDevicesEnabled(fWebCamsEnabled); 1900 1908 if (!fWebCamsEnabled) 1901 1909 restrictionForDevices = (UIExtraDataMetaDefs::RuntimeMenuDevicesActionType) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98811 r98829 544 544 /** @name USB stuff. 545 545 ** @{ */ 546 /** Acquires whether USB controller is enabled. */ 547 void acquireWhetherUSBControllerEnabled(bool &fEnabled); 548 /** Acquires whether video input devices are enabled. */ 549 void acquireWhetherVideoInputDevicesEnabled(bool &fEnabled); 550 546 551 /** Returns a list of USB devices. */ 547 552 bool usbDevices(QList<USBDeviceInfo> &guiUSBDevices); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98811 r98829 909 909 CMachine comMachine = machine(); 910 910 uiCommon().updateMachineStorage(comMachine, target, pActionPool); 911 } 912 913 void UISession::acquireWhetherUSBControllerEnabled(bool &fEnabled) 914 { 915 fEnabled = false; 916 917 /* Check whether USB device filters are available: */ 918 CMachine comMachine = machine(); 919 CUSBDeviceFilters comUSBDeviceFilters = comMachine.GetUSBDeviceFilters(); 920 if (!comMachine.isOk() || comUSBDeviceFilters.isNull()) 921 return; 922 /* Check whether USB controllers are available: */ 923 CUSBControllerVector comUSBControllers = comMachine.GetUSBControllers(); 924 if (!comMachine.isOk() || comUSBControllers.isEmpty()) 925 return; 926 /* Check whether USB proxy is available: */ 927 const BOOL fUSBProxyAvailable = comMachine.GetUSBProxyAvailable(); 928 if (!comMachine.isOk() || fUSBProxyAvailable == FALSE) 929 return; 930 931 fEnabled = true; 932 } 933 934 void UISession::acquireWhetherVideoInputDevicesEnabled(bool &fEnabled) 935 { 936 fEnabled = false; 937 938 /* Check whether video input devices are available: */ 939 CHost comHost = uiCommon().host(); 940 CHostVideoInputDeviceVector comVideoInputDevices = comHost.GetVideoInputDevices(); 941 if (!comHost.isOk() || comVideoInputDevices.isEmpty()) 942 return; 943 /* Check whether USB controllers are available: */ 944 CMachine comMachine = machine(); 945 CUSBControllerVector comUSBControllers = comMachine.GetUSBControllers(); 946 if (!comMachine.isOk() || comUSBControllers.isEmpty()) 947 return; 948 949 fEnabled = true; 911 950 } 912 951 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98811 r98829 354 354 /** @name USB stuff. 355 355 ** @{ */ 356 /** Acquires whether USB controller is enabled. */ 357 void acquireWhetherUSBControllerEnabled(bool &fEnabled); 358 /** Acquires whether video input devices are enabled. */ 359 void acquireWhetherVideoInputDevicesEnabled(bool &fEnabled); 360 356 361 /** Returns a list of USB devices. */ 357 362 bool usbDevices(QList<USBDeviceInfo> &guiUSBDevices);
Note:
See TracChangeset
for help on using the changeset viewer.