- Timestamp:
- May 22, 2014 11:31:45 AM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r51322 r51345 944 944 UIMachineSettingsSystem *pSystemPage = qobject_cast<UIMachineSettingsSystem*>(m_pSelector->idToPage(MachineSettingsPageType_System)); 945 945 if (pUsbPage && pSystemPage) 946 pSystemPage->set OHCIEnabled(pUsbPage->isOHCIEnabled());946 pSystemPage->setUSBEnabled(pUsbPage->isUSBEnabled()); 947 947 break; 948 948 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r49912 r51345 37 37 : m_uMinGuestCPU(0), m_uMaxGuestCPU(0) 38 38 , m_uMinGuestCPUExecCap(0), m_uMedGuestCPUExecCap(0), m_uMaxGuestCPUExecCap(0) 39 , m_f OHCIEnabled(false)39 , m_fIsUSBEnabled(false) 40 40 { 41 41 /* Prepare: */ … … 58 58 } 59 59 60 void UIMachineSettingsSystem::set OHCIEnabled(bool fEnabled)61 { 62 /* Make sure OHCIstatus has changed: */63 if (m_f OHCIEnabled == fEnabled)60 void UIMachineSettingsSystem::setUSBEnabled(bool fEnabled) 61 { 62 /* Make sure USB status has changed: */ 63 if (m_fIsUSBEnabled == fEnabled) 64 64 return; 65 65 66 /* Update OHCIstatus value: */67 m_f OHCIEnabled = fEnabled;66 /* Update USB status value: */ 67 m_fIsUSBEnabled = fEnabled; 68 68 69 69 /* Revalidate: */ … … 325 325 } 326 326 327 /* HID vs OHCItest: */328 if (isHIDEnabled() && !m_f OHCIEnabled)327 /* HID vs USB test: */ 328 if (isHIDEnabled() && !m_fIsUSBEnabled) 329 329 { 330 330 message.second << tr( -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r47944 r51345 131 131 bool isHIDEnabled() const; 132 132 KChipsetType chipsetType() const; 133 void set OHCIEnabled(bool fEnabled);133 void setUSBEnabled(bool fEnabled); 134 134 135 135 protected: … … 211 211 212 212 /* Variable: Correlation stuff: */ 213 bool m_f OHCIEnabled;213 bool m_fIsUSBEnabled; 214 214 215 215 /* Cache: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp
r48022 r51345 228 228 } 229 229 230 bool UIMachineSettingsUSB::is OHCIEnabled() const230 bool UIMachineSettingsUSB::isUSBEnabled() const 231 231 { 232 232 return mGbUSB->isChecked(); … … 247 247 248 248 /* Gather USB values: */ 249 usbData.m_fUSBEnabled = m_machine.GetUSBControllerCountByType(KUSBControllerType_OHCI) > 0; 250 usbData.m_fEHCIEnabled = m_machine.GetUSBControllerCountByType(KUSBControllerType_EHCI) > 0; 249 usbData.m_fUSBEnabled = !m_machine.GetUSBControllers().isEmpty(); 250 usbData.m_USBControllerType = m_machine.GetUSBControllerCountByType(KUSBControllerType_XHCI) > 0 ? KUSBControllerType_XHCI : 251 m_machine.GetUSBControllerCountByType(KUSBControllerType_EHCI) > 0 ? KUSBControllerType_EHCI : 252 m_machine.GetUSBControllerCountByType(KUSBControllerType_OHCI) > 0 ? KUSBControllerType_OHCI : 253 KUSBControllerType_Null; 251 254 252 255 /* Check if controller is valid: */ … … 301 304 /* Load USB data to page: */ 302 305 mGbUSB->setChecked(usbData.m_fUSBEnabled); 303 mCbUSB2->setChecked(usbData.m_fEHCIEnabled); 306 switch (usbData.m_USBControllerType) 307 { 308 default: 309 case KUSBControllerType_OHCI: mRbUSB1->setChecked(true); break; 310 case KUSBControllerType_EHCI: mRbUSB2->setChecked(true); break; 311 case KUSBControllerType_XHCI: mRbUSB3->setChecked(true); break; 312 } 304 313 305 314 /* For each USB filter => load it to the page: */ … … 327 336 UIDataSettingsMachineUSB usbData = m_cache.base(); 328 337 329 /* USB 1.0 (OHCI):*/338 /* Is USB controller enabled? */ 330 339 usbData.m_fUSBEnabled = mGbUSB->isChecked(); 331 /* USB 2.0 (EHCI): */ 332 usbData.m_fEHCIEnabled = mCbUSB2->isChecked(); 340 /* Of which type? */ 341 if (!usbData.m_fUSBEnabled) 342 usbData.m_USBControllerType = KUSBControllerType_Null; 343 else 344 { 345 if (mRbUSB1->isChecked()) 346 usbData.m_USBControllerType = KUSBControllerType_OHCI; 347 else if (mRbUSB2->isChecked()) 348 usbData.m_USBControllerType = KUSBControllerType_EHCI; 349 else if (mRbUSB3->isChecked()) 350 usbData.m_USBControllerType = KUSBControllerType_XHCI; 351 } 333 352 334 353 /* Update USB cache: */ … … 361 380 ULONG cOhciCtls = m_machine.GetUSBControllerCountByType(KUSBControllerType_OHCI); 362 381 ULONG cEhciCtls = m_machine.GetUSBControllerCountByType(KUSBControllerType_EHCI); 363 364 if (!cOhciCtls && usbData.m_fUSBEnabled) 365 m_machine.AddUSBController("OHCI", KUSBControllerType_OHCI); 366 else if (cOhciCtls && !usbData.m_fUSBEnabled) 367 m_machine.RemoveUSBController("OHCI"); 368 369 if (!cEhciCtls && usbData.m_fEHCIEnabled) 370 m_machine.AddUSBController("EHCI", KUSBControllerType_EHCI); 371 else if (cEhciCtls && !usbData.m_fEHCIEnabled) 372 m_machine.RemoveUSBController("EHCI"); 382 ULONG cXhciCtls = m_machine.GetUSBControllerCountByType(KUSBControllerType_XHCI); 383 384 /* Removing USB controllers: */ 385 if (!usbData.m_fUSBEnabled) 386 { 387 if (cXhciCtls) 388 m_machine.RemoveUSBController("XHCI"); 389 if (cEhciCtls) 390 m_machine.RemoveUSBController("EHCI"); 391 if (cOhciCtls) 392 m_machine.RemoveUSBController("OHCI"); 393 } 394 /* Creating/replacing USB controllers: */ 395 else 396 { 397 switch (usbData.m_USBControllerType) 398 { 399 case KUSBControllerType_OHCI: 400 { 401 if (cEhciCtls) 402 m_machine.RemoveUSBController("EHCI"); 403 if (cXhciCtls) 404 m_machine.RemoveUSBController("XHCI"); 405 if (!cOhciCtls) 406 m_machine.AddUSBController("OHCI", KUSBControllerType_OHCI); 407 break; 408 } 409 case KUSBControllerType_EHCI: 410 { 411 if (cXhciCtls) 412 m_machine.RemoveUSBController("XHCI"); 413 if (!cOhciCtls) 414 m_machine.AddUSBController("OHCI", KUSBControllerType_OHCI); 415 if (!cEhciCtls) 416 m_machine.AddUSBController("EHCI", KUSBControllerType_EHCI); 417 break; 418 } 419 case KUSBControllerType_XHCI: 420 { 421 if (cEhciCtls) 422 m_machine.RemoveUSBController("EHCI"); 423 if (cOhciCtls) 424 m_machine.RemoveUSBController("OHCI"); 425 if (!cXhciCtls) 426 m_machine.AddUSBController("XHCI", KUSBControllerType_XHCI); 427 break; 428 } 429 default: 430 break; 431 } 432 } 373 433 } 374 434 /* Store USB filters data: */ … … 432 492 /* USB 2.0 Extension Pack presence test: */ 433 493 CExtPack extPack = vboxGlobal().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName); 434 if (mGbUSB->isChecked() && mCbUSB2->isChecked() && (extPack.isNull() || !extPack.GetUsable())) 494 if ( mGbUSB->isChecked() 495 && (mRbUSB2->isChecked() || mRbUSB3->isChecked()) 496 && (extPack.isNull() || !extPack.GetUsable())) 435 497 { 436 498 /* Prepare message: */ … … 454 516 { 455 517 setTabOrder (aWidget, mGbUSB); 456 setTabOrder (mGbUSB, mCbUSB2); 457 setTabOrder (mCbUSB2, mTwFilters); 518 setTabOrder (mGbUSB, mRbUSB1); 519 setTabOrder (mRbUSB1, mRbUSB2); 520 setTabOrder (mRbUSB2, mRbUSB3); 521 setTabOrder (mRbUSB3, mTwFilters); 458 522 } 459 523 … … 502 566 /* Enable/disable USB children: */ 503 567 mUSBChild->setEnabled(isMachineInValidMode() && fEnabled); 504 mCbUSB2->setEnabled(isMachineOffline() && fEnabled); 568 mRbUSB1->setEnabled(isMachineOffline() && fEnabled); 569 mRbUSB2->setEnabled(isMachineOffline() && fEnabled); 570 mRbUSB3->setEnabled(isMachineOffline() && fEnabled); 505 571 if (fEnabled) 506 572 { … … 730 796 /* Prepare validation: */ 731 797 connect(mGbUSB, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 732 connect(mCbUSB2, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 798 connect(mRbUSB1, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 799 connect(mRbUSB2, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 800 connect(mRbUSB3, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 733 801 } 734 802 … … 798 866 mGbUSB->setEnabled(isMachineOffline()); 799 867 mUSBChild->setEnabled(isMachineInValidMode() && mGbUSB->isChecked()); 800 mCbUSB2->setEnabled(isMachineOffline() && mGbUSB->isChecked()); 868 mRbUSB1->setEnabled(isMachineOffline() && mGbUSB->isChecked()); 869 mRbUSB2->setEnabled(isMachineOffline() && mGbUSB->isChecked()); 870 mRbUSB3->setEnabled(isMachineOffline() && mGbUSB->isChecked()); 801 871 } 802 872 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h
r47944 r51345 88 88 UIDataSettingsMachineUSB() 89 89 : m_fUSBEnabled(false) 90 , m_ fEHCIEnabled(false) {}90 , m_USBControllerType(KUSBControllerType_Null) {} 91 91 /* Functions: */ 92 92 bool equal(const UIDataSettingsMachineUSB &other) const 93 93 { 94 94 return (m_fUSBEnabled == other.m_fUSBEnabled) && 95 (m_ fEHCIEnabled == other.m_fEHCIEnabled);95 (m_USBControllerType == other.m_USBControllerType); 96 96 } 97 97 /* Operators: */ … … 100 100 /* Variables: */ 101 101 bool m_fUSBEnabled; 102 bool m_fEHCIEnabled;102 KUSBControllerType m_USBControllerType; 103 103 }; 104 104 typedef UISettingsCachePool<UIDataSettingsMachineUSB, UICacheSettingsMachineUSBFilter> UICacheSettingsMachineUSB; … … 121 121 UIMachineSettingsUSB(); 122 122 123 bool is OHCIEnabled() const;123 bool isUSBEnabled() const; 124 124 125 125 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.ui
r45196 r51345 23 23 </rect> 24 24 </property> 25 <layout class="QGridLayout" >25 <layout class="QGridLayout" columnstretch="0,1,0"> 26 26 <item row="0" column="0" colspan="2" > 27 27 <widget class="QCheckBox" name="mGbUSB" > … … 48 48 <size> 49 49 <width>20</width> 50 <height> 20</height>50 <height>0</height> 51 51 </size> 52 52 </property> 53 53 </spacer> 54 54 </item> 55 <item row="1" column="1" >56 <widget class="QWidget" na tive="1" name="mUSBChild" >57 <layout class="Q GridLayout" >55 <item row="1" column="1" colspan="2" > 56 <widget class="QWidget" name="mUSBChild" > 57 <layout class="QVBoxLayout" > 58 58 <property name="leftMargin" > 59 59 <number>0</number> … … 68 68 <number>0</number> 69 69 </property> 70 <item row="0" column="0" > 71 <widget class="QCheckBox" name="mCbUSB2" > 72 <property name="whatsThis" > 73 <string>When checked, enables the virtual USB EHCI controller of this machine. The USB EHCI controller provides USB 2.0 support.</string> 74 </property> 75 <property name="text" > 76 <string>Enable USB 2.0 (E&HCI) Controller</string> 77 </property> 70 <item> 71 <widget class="QWidget" native="1" name="mRbContainer" > 72 <layout class="QVBoxLayout"> 73 <property name="leftMargin" > 74 <number>0</number> 75 </property> 76 <property name="topMargin" > 77 <number>0</number> 78 </property> 79 <property name="rightMargin" > 80 <number>0</number> 81 </property> 82 <property name="bottomMargin" > 83 <number>0</number> 84 </property> 85 <item> 86 <widget class="QRadioButton" name="mRbUSB1"> 87 <property name="whatsThis"> 88 <string>When checked, enables the virtual USB OHCI controller of this machine. The USB OHCI controller provides USB 1.0 support.</string> 89 </property> 90 <property name="text"> 91 <string>USB &1.0 (OHCI) Controller</string> 92 </property> 93 </widget> 94 </item> 95 <item> 96 <widget class="QRadioButton" name="mRbUSB2"> 97 <property name="whatsThis"> 98 <string>When checked, enables the virtual USB EHCI controller of this machine. The USB EHCI controller provides USB 2.0 support.</string> 99 </property> 100 <property name="text"> 101 <string>USB &2.0 (EHCI) Controller</string> 102 </property> 103 </widget> 104 </item> 105 <item> 106 <widget class="QRadioButton" name="mRbUSB3"> 107 <property name="whatsThis"> 108 <string>When checked, enables the virtual USB xHCI controller of this machine. The USB xHCI controller provides USB 3.0 support.</string> 109 </property> 110 <property name="text"> 111 <string>USB &3.0 (xHCI) Controller</string> 112 </property> 113 </widget> 114 </item> 115 </layout> 78 116 </widget> 79 117 </item> 80 <item row="1" column="0">118 <item> 81 119 <widget class="QILabelSeparator" name="mGbUSBFilters" > 82 120 <property name="text" > … … 88 126 </widget> 89 127 </item> 90 <item row="2" column="0">128 <item> 91 129 <widget class="QWidget" native="1" name="mWtFilterHandler" > 92 130 <layout class="QHBoxLayout" >
Note:
See TracChangeset
for help on using the changeset viewer.