Changeset 47269 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 19, 2013 3:53:05 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 87400
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r47268 r47269 153 153 sltValueChangedCPUExecCap(mSlCPUExecCap->value()); 154 154 155 /* Configure 'pointing HID type' combo: */ 156 mCbHIDType->setSizeAdjustPolicy(QComboBox::AdjustToContents); 157 155 158 /* Populate chipset combo: */ 156 159 mCbChipset->addItem(gpConverter->toString(KChipsetType_PIIX3), QVariant(KChipsetType_PIIX3)); … … 171 174 bool UIMachineSettingsSystem::isHIDEnabled() const 172 175 { 173 return mCbUseAbsHID->isChecked();176 return (KPointingHIDType)mCbHIDType->itemData(mCbHIDType->currentIndex()).toInt() != KPointingHIDType_PS2Mouse; 174 177 } 175 178 … … 231 234 /* Load other motherboard data: */ 232 235 systemData.m_chipsetType = m_machine.GetChipsetType(); 236 systemData.m_pointingHIDType = m_machine.GetPointingHIDType(); 233 237 systemData.m_fEnabledIoApic = m_machine.GetBIOSSettings().GetIOAPICEnabled(); 234 238 systemData.m_fEnabledEFI = m_machine.GetFirmwareType() >= KFirmwareType_EFI && m_machine.GetFirmwareType() <= KFirmwareType_EFIDUAL; 235 239 systemData.m_fEnabledUTC = m_machine.GetRTCUseUTC(); 236 systemData.m_fEnabledAbsoluteHID = m_machine.GetPointingHIDType() == KPointingHIDType_USBTablet;237 240 238 241 /* Load CPU data: */ … … 258 261 /* Get system data from cache: */ 259 262 const UIDataSettingsMachineSystem &systemData = m_cache.base(); 263 264 /* Repopulate 'pointing HID type' combo. 265 * We are doing that *now* because it has dynamical content 266 * which depends on recashed value: */ 267 repopulateComboPointingHIDType(); 260 268 261 269 /* Load motherboard data to page: */ … … 273 281 } 274 282 /* Load other motherboard data to page: */ 275 int iChipsetPosition = mCbChipset->findData(systemData.m_chipsetType); 276 mCbChipset->setCurrentIndex(iChipsetPosition == -1 ? 0 : iChipsetPosition); 283 int iChipsetTypePosition = mCbChipset->findData(systemData.m_chipsetType); 284 mCbChipset->setCurrentIndex(iChipsetTypePosition == -1 ? 0 : iChipsetTypePosition); 285 int iHIDTypePosition = mCbHIDType->findData(systemData.m_pointingHIDType); 286 mCbHIDType->setCurrentIndex(iHIDTypePosition == -1 ? 0 : iHIDTypePosition); 277 287 mCbApic->setChecked(systemData.m_fEnabledIoApic); 278 288 mCbEFI->setChecked(systemData.m_fEnabledEFI); 279 289 mCbTCUseUTC->setChecked(systemData.m_fEnabledUTC); 280 mCbUseAbsHID->setChecked(systemData.m_fEnabledAbsoluteHID);281 290 282 291 /* Load CPU data to page: */ … … 318 327 /* Gather other motherboard data: */ 319 328 systemData.m_chipsetType = (KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt(); 329 systemData.m_pointingHIDType = (KPointingHIDType)mCbHIDType->itemData(mCbHIDType->currentIndex()).toInt(); 320 330 systemData.m_fEnabledIoApic = mCbApic->isChecked() || mSlCPU->value() > 1 || 321 331 (KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt() == KChipsetType_ICH9; 322 332 systemData.m_fEnabledEFI = mCbEFI->isChecked(); 323 333 systemData.m_fEnabledUTC = mCbTCUseUTC->isChecked(); 324 systemData.m_fEnabledAbsoluteHID = mCbUseAbsHID->isChecked();325 334 326 335 /* Gather CPU data: */ … … 369 378 } 370 379 m_machine.SetChipsetType(systemData.m_chipsetType); 380 m_machine.SetPointingHIDType(systemData.m_pointingHIDType); 371 381 m_machine.GetBIOSSettings().SetIOAPICEnabled(systemData.m_fEnabledIoApic); 372 382 m_machine.SetFirmwareType(systemData.m_fEnabledEFI ? KFirmwareType_EFI : KFirmwareType_BIOS); 373 383 m_machine.SetRTCUseUTC(systemData.m_fEnabledUTC); 374 m_machine.SetPointingHIDType(systemData.m_fEnabledAbsoluteHID ? KPointingHIDType_USBTablet : KPointingHIDType_PS2Mouse);375 384 376 385 /* Processor tab: */ … … 398 407 m_pValidator = pValidator; 399 408 connect(mCbChipset, SIGNAL(currentIndexChanged(int)), m_pValidator, SLOT(revalidate())); 409 connect(mCbHIDType, SIGNAL(currentIndexChanged(int)), m_pValidator, SLOT(revalidate())); 400 410 connect(mCbApic, SIGNAL(stateChanged(int)), m_pValidator, SLOT(revalidate())); 401 411 connect(mCbVirt, SIGNAL(stateChanged(int)), m_pValidator, SLOT(revalidate())); 402 connect(mCbUseAbsHID, SIGNAL(stateChanged(int)), m_pValidator, SLOT(revalidate()));403 412 } 404 413 … … 493 502 494 503 /* HID dependency from OHCI feature: */ 495 if ( mCbUseAbsHID->isChecked() && !m_fOHCIEnabled)504 if (isHIDEnabled() && !m_fOHCIEnabled) 496 505 { 497 506 strWarning = tr( … … 516 525 setTabOrder(mTbBootItemUp, mTbBootItemDown); 517 526 setTabOrder(mTbBootItemDown, mCbChipset); 518 setTabOrder(mCbChipset, mCbApic); 527 setTabOrder(mCbChipset, mCbHIDType); 528 setTabOrder(mCbHIDType, mCbApic); 519 529 setTabOrder(mCbApic, mCbEFI); 520 530 setTabOrder(mCbEFI, mCbTCUseUTC); 521 setTabOrder(mCbTCUseUTC, mCbUseAbsHID);522 531 523 532 /* Processor tab-order: */ 524 setTabOrder(mCb UseAbsHID, mSlCPU);533 setTabOrder(mCbTCUseUTC, mSlCPU); 525 534 setTabOrder(mSlCPU, mLeCPU); 526 535 setTabOrder(mLeCPU, mSlCPUExecCap); … … 553 562 mLbCPUExecCapMax->setText(tr("<qt>%1%</qt>", "Max CPU execution cap in %").arg(m_uMaxGuestCPUExecCap)); 554 563 555 /* Retranslate combo-box : */564 /* Retranslate combo-boxes: */ 556 565 retranslateComboPointingChipsetType(); 566 retranslateComboPointingHIDType(); 557 567 } 558 568 … … 591 601 } 592 602 603 void UIMachineSettingsSystem::repopulateComboPointingHIDType() 604 { 605 /* Is there any value currently present/selected? */ 606 KPointingHIDType currentValue = KPointingHIDType_None; 607 { 608 int iCurrentIndex = mCbHIDType->currentIndex(); 609 if (iCurrentIndex != -1) 610 currentValue = (KPointingHIDType)mCbHIDType->itemData(iCurrentIndex).toInt(); 611 } 612 613 /* Clear combo: */ 614 mCbHIDType->clear(); 615 616 /* Repopulate combo taking into account currently cached value: */ 617 KPointingHIDType cachedValue = m_cache.base().m_pointingHIDType; 618 { 619 /* "PS/2 Mouse" value is always here: */ 620 mCbHIDType->addItem(gpConverter->toString(KPointingHIDType_PS2Mouse), (int)KPointingHIDType_PS2Mouse); 621 622 /* "USB Mouse" value is here only if it is currently selected: */ 623 if (cachedValue == KPointingHIDType_USBMouse) 624 mCbHIDType->addItem(gpConverter->toString(KPointingHIDType_USBMouse), (int)KPointingHIDType_USBMouse); 625 626 /* "USB Mouse/Tablet" value is always here: */ 627 mCbHIDType->addItem(gpConverter->toString(KPointingHIDType_USBTablet), (int)KPointingHIDType_USBTablet); 628 629 /* "PS/2 and USB Mouse" value is here only if it is currently selected: */ 630 if (cachedValue == KPointingHIDType_ComboMouse) 631 mCbHIDType->addItem(gpConverter->toString(KPointingHIDType_ComboMouse), (int)KPointingHIDType_ComboMouse); 632 633 /* "USB Multi-Touch Mouse/Tablet" value is always here: */ 634 mCbHIDType->addItem(gpConverter->toString(KPointingHIDType_USBMultiTouch), (int)KPointingHIDType_USBMultiTouch); 635 } 636 637 /* Was there any value previously present/selected? */ 638 if (currentValue != KPointingHIDType_None) 639 { 640 int iPreviousIndex = mCbHIDType->findData((int)currentValue); 641 if (iPreviousIndex != -1) 642 mCbHIDType->setCurrentIndex(iPreviousIndex); 643 } 644 } 645 593 646 void UIMachineSettingsSystem::valueChangedCPU(int iValue) 594 647 { … … 620 673 /* Look for the corresponding item: */ 621 674 int iCorrespondingIndex = mCbChipset->findData((int)type); 622 /* Re-translate corresponding item if itwas found: */675 /* Re-translate if corresponding item was found: */ 623 676 if (iCorrespondingIndex != -1) 624 677 mCbChipset->setItemText(iCorrespondingIndex, gpConverter->toString(type)); 678 } 679 } 680 681 void UIMachineSettingsSystem::retranslateComboPointingHIDType() 682 { 683 /* For each the element in KPointingHIDType enum: */ 684 for (int iIndex = (int)KPointingHIDType_None; iIndex < (int)KPointingHIDType_Max; ++iIndex) 685 { 686 /* Cast to the corresponding type: */ 687 KPointingHIDType type = (KPointingHIDType)iIndex; 688 /* Look for the corresponding item: */ 689 int iCorrespondingIndex = mCbHIDType->findData((int)type); 690 /* Re-translate if corresponding item was found: */ 691 if (iCorrespondingIndex != -1) 692 mCbHIDType->setItemText(iCorrespondingIndex, gpConverter->toString(type)); 625 693 } 626 694 } … … 644 712 mLbChipset->setEnabled(isMachineOffline()); 645 713 mCbChipset->setEnabled(isMachineOffline()); 714 mLbHIDType->setEnabled(isMachineOffline()); 715 mCbHIDType->setEnabled(isMachineOffline()); 646 716 mLbMotherboardExtended->setEnabled(isMachineOffline()); 647 717 mCbApic->setEnabled(isMachineOffline()); 648 718 mCbEFI->setEnabled(isMachineOffline()); 649 719 mCbTCUseUTC->setEnabled(isMachineOffline()); 650 mCbUseAbsHID->setEnabled(isMachineOffline());651 720 652 721 /* Processor tab: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r47268 r47269 54 54 , m_bootItems(QList<UIBootItemData>()) 55 55 , m_chipsetType(KChipsetType_Null) 56 , m_pointingHIDType(KPointingHIDType_None) 56 57 , m_fEnabledIoApic(false) 57 58 , m_fEnabledEFI(false) 58 59 , m_fEnabledUTC(false) 59 , m_fEnabledAbsoluteHID(false)60 60 /* CPU data: */ 61 61 , m_cCPUCount(-1) … … 77 77 (m_bootItems == other.m_bootItems) && 78 78 (m_chipsetType == other.m_chipsetType) && 79 (m_pointingHIDType == other.m_pointingHIDType) && 79 80 (m_fEnabledIoApic == other.m_fEnabledIoApic) && 80 81 (m_fEnabledEFI == other.m_fEnabledEFI) && 81 82 (m_fEnabledUTC == other.m_fEnabledUTC) && 82 (m_fEnabledAbsoluteHID == other.m_fEnabledAbsoluteHID) &&83 83 /* CPU data: */ 84 84 (m_cCPUCount == other.m_cCPUCount) && … … 102 102 QList<UIBootItemData> m_bootItems; 103 103 KChipsetType m_chipsetType; 104 KPointingHIDType m_pointingHIDType; 104 105 bool m_fEnabledIoApic; 105 106 bool m_fEnabledEFI; 106 107 bool m_fEnabledUTC; 107 bool m_fEnabledAbsoluteHID;108 108 /* Variables: CPU data: */ 109 109 int m_cCPUCount; … … 179 179 private: 180 180 181 /* Helper : Translation stuff: */181 /* Helpers: Translation stuff: */ 182 182 void retranslateComboPointingChipsetType(); 183 void retranslateComboPointingHIDType(); 183 184 184 185 /* Handler: Polishing stuff: */ … … 190 191 /* Helper: Boot-table stuff: */ 191 192 void adjustBootOrderTWSize(); 193 194 /* Helper: Pointing HID type combo stuff: */ 195 void repopulateComboPointingHIDType(); 192 196 193 197 /* Variable: Validation stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui
r46497 r47269 331 331 </item> 332 332 <item row="5" column="0"> 333 <widget class="QLabel" name="mLb MotherboardExtended">333 <widget class="QLabel" name="mLbHIDType"> 334 334 <property name="sizePolicy"> 335 335 <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> … … 339 339 </property> 340 340 <property name="text"> 341 <string> Extended Features:</string>341 <string>&Pointing device:</string> 342 342 </property> 343 343 <property name="alignment"> 344 344 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 345 345 </property> 346 <property name="buddy"> 347 <cstring>mCbHIDType</cstring> 348 </property> 346 349 </widget> 347 350 </item> 348 351 <item row="5" column="1" colspan="3"> 352 <layout class="QHBoxLayout" name="mLtHIDType"> 353 <item> 354 <widget class="QComboBox" name="mCbHIDType" > 355 <property name="sizePolicy" > 356 <sizepolicy vsizetype="Fixed" hsizetype="Minimum" > 357 <horstretch>0</horstretch> 358 <verstretch>0</verstretch> 359 </sizepolicy> 360 </property> 361 <property name="whatsThis" > 362 <string>Determines pointing device type. Whether standard PS/2 mouse, USB mouse/tablet or USB multi-touch mouse/tablet will be emulated.</string> 363 </property> 364 </widget> 365 </item> 366 <item> 367 <spacer name="mSpHor4"> 368 <property name="orientation"> 369 <enum>Qt::Horizontal</enum> 370 </property> 371 <property name="sizeHint" stdset="0"> 372 <size> 373 <width>0</width> 374 <height>0</height> 375 </size> 376 </property> 377 </spacer> 378 </item> 379 </layout> 380 </item> 381 <item row="6" column="0"> 382 <widget class="QLabel" name="mLbMotherboardExtended"> 383 <property name="sizePolicy"> 384 <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> 385 <horstretch>0</horstretch> 386 <verstretch>0</verstretch> 387 </sizepolicy> 388 </property> 389 <property name="text"> 390 <string>Extended Features:</string> 391 </property> 392 <property name="alignment"> 393 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 394 </property> 395 </widget> 396 </item> 397 <item row="6" column="1" colspan="3"> 349 398 <widget class="QCheckBox" name="mCbApic"> 350 399 <property name="sizePolicy"> … … 362 411 </widget> 363 412 </item> 364 <item row=" 6" column="1" colspan="3">413 <item row="7" column="1" colspan="3"> 365 414 <widget class="QCheckBox" name="mCbEFI"> 366 415 <property name="sizePolicy"> … … 378 427 </widget> 379 428 </item> 380 <item row=" 7" column="1" colspan="3">429 <item row="8" column="1" colspan="3"> 381 430 <widget class="QCheckBox" name="mCbTCUseUTC" > 382 431 <property name="sizePolicy" > … … 391 440 <property name="text" > 392 441 <string>Hardware clock in &UTC time</string> 393 </property>394 </widget>395 </item>396 <item row="8" column="1" colspan="3">397 <widget class="QCheckBox" name="mCbUseAbsHID" >398 <property name="sizePolicy" >399 <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >400 <horstretch>0</horstretch>401 <verstretch>0</verstretch>402 </sizepolicy>403 </property>404 <property name="whatsThis" >405 <string>If checked, an absolute pointing device (a USB tablet) will be supported. Otherwise, only a standard PS/2 mouse will be emulated.</string>406 </property>407 <property name="text" >408 <string>Enable &absolute pointing device</string>409 442 </property> 410 443 </widget> … … 489 522 </item> 490 523 <item> 491 <spacer name="mSpHor 4">524 <spacer name="mSpHor5"> 492 525 <property name="orientation"> 493 526 <enum>Qt::Horizontal</enum> … … 590 623 </item> 591 624 <item> 592 <spacer name="mSpHor 5">625 <spacer name="mSpHor6"> 593 626 <property name="orientation"> 594 627 <enum>Qt::Horizontal</enum>
Note:
See TracChangeset
for help on using the changeset viewer.