- Timestamp:
- May 12, 2015 1:31:09 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r55567 r55827 1203 1203 ControllerItem *ctr = static_cast <ControllerItem*> (item); 1204 1204 CSystemProperties sp = vboxGlobal().virtualBox().GetSystemProperties(); 1205 switch (m_configurationAccessLevel) 1205 const bool fIsMoreAttachmentsPossible = (ULONG)rowCount(aIndex) < 1206 (sp.GetMaxPortCountForStorageBus(ctr->ctrBusType()) * 1207 sp.GetMaxDevicesPerPortForStorageBus(ctr->ctrBusType())); 1208 if (fIsMoreAttachmentsPossible) 1206 1209 { 1207 case ConfigurationAccessLevel_Full: return ((uint)rowCount(aIndex) < sp.GetMaxPortCountForStorageBus(ctr->ctrBusType()) * 1208 sp.GetMaxDevicesPerPortForStorageBus(ctr->ctrBusType())); 1209 case ConfigurationAccessLevel_Runtime: return (ctr->ctrBusType() == KStorageBus_SATA) && 1210 ((uint)rowCount(aIndex) < ctr->portCount()); 1211 default: break; 1210 switch (m_configurationAccessLevel) 1211 { 1212 case ConfigurationAccessLevel_Full: 1213 return true; 1214 case ConfigurationAccessLevel_Runtime: 1215 { 1216 switch (ctr->ctrBusType()) 1217 { 1218 case KStorageBus_USB: 1219 return true; 1220 case KStorageBus_SATA: 1221 return (uint)rowCount(aIndex) < ctr->portCount(); 1222 default: 1223 break; 1224 } 1225 } 1226 default: 1227 break; 1228 } 1212 1229 } 1213 return false;1214 1230 } 1215 1231 } … … 2783 2799 2784 2800 /* Fetch hot-pluggable state: */ 2785 m_pCheckBoxHotPluggable->setVisible( slt.bus == KStorageBus_SATA);2801 m_pCheckBoxHotPluggable->setVisible((slt.bus == KStorageBus_SATA) || (slt.bus == KStorageBus_USB)); 2786 2802 m_pCheckBoxHotPluggable->setChecked(fIsHotPluggable); 2787 2803 … … 3787 3803 } 3788 3804 } 3789 if ( controllerBus == KStorageBus_SATA)3805 if ((controllerBus == KStorageBus_SATA) || (controllerBus == KStorageBus_USB)) 3790 3806 { 3791 3807 if (fSuccess && isMachineOffline()) … … 3876 3892 } 3877 3893 } 3878 if ( controllerBus == KStorageBus_SATA)3894 if ((controllerBus == KStorageBus_SATA) || (controllerBus == KStorageBus_USB)) 3879 3895 { 3880 3896 if (fSuccess && isMachineOffline()) … … 3890 3906 /* Show error message: */ 3891 3907 msgCenter().cannotAttachDevice(m_machine, mediumTypeToLocal(attachmentDeviceType), 3892 3893 3908 vboxMedium.location(), 3909 StorageSlot(controllerBus, iAttachmentPort, iAttachmentDevice), this); 3894 3910 } 3895 3911 }
Note:
See TracChangeset
for help on using the changeset viewer.