Changeset 47253 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 19, 2013 1:01:39 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r43459 r47253 83 83 } 84 84 85 /* Add all available devices types, so we could initially calculate the 86 * right size. */ 85 /* Add all available devices types, so we could initially calculate the right size: */ 87 86 for (int i = 0; i < m_possibleBootItems.size(); ++i) 88 87 { … … 91 90 } 92 91 93 /* Setup validators */92 /* Setup validators: */ 94 93 mLeMemory->setValidator (new QIntValidator (mSlMemory->minRAM(), mSlMemory->maxRAM(), this)); 95 94 mLeCPU->setValidator (new QIntValidator (mMinGuestCPU, mMaxGuestCPU, this)); 96 95 mLeCPUExecCap->setValidator(new QIntValidator(mMinGuestCPUExecCap, mMaxGuestCPUExecCap, this)); 97 96 98 /* Setup connections*/97 /* Setup RAM connections: */ 99 98 connect (mSlMemory, SIGNAL (valueChanged (int)), 100 99 this, SLOT (valueChangedRAM (int))); … … 102 101 this, SLOT (textChangedRAM (const QString&))); 103 102 103 /* Setup boot-table connections: */ 104 104 connect (mTbBootItemUp, SIGNAL (clicked()), 105 105 mTwBootOrder, SLOT(sltMoveItemUp())); … … 109 109 this, SLOT (onCurrentBootItemChanged (int))); 110 110 111 /* Setup CPU connections: */ 111 112 connect (mSlCPU, SIGNAL (valueChanged (int)), 112 113 this, SLOT (valueChangedCPU (int))); 113 114 connect (mLeCPU, SIGNAL (textChanged (const QString&)), 114 115 this, SLOT (textChangedCPU (const QString&))); 115 116 116 connect(mSlCPUExecCap, SIGNAL(valueChanged(int)), this, SLOT(sltValueChangedCPUExecCap(int))); 117 117 connect(mLeCPUExecCap, SIGNAL(textChanged(const QString&)), this, SLOT(sltTextChangedCPUExecCap(const QString&))); 118 118 119 /* Setup iconsets*/119 /* Setup boot-table iconsets: */ 120 120 mTbBootItemUp->setIcon(UIIconPool::iconSet(":/list_moveup_16px.png", 121 121 ":/list_moveup_disabled_16px.png")); … … 124 124 125 125 #ifdef Q_WS_MAC 126 /* We need a little space for the focus rect .*/126 /* We need a little space for the focus rect: */ 127 127 mLtBootOrder->setContentsMargins (3, 3, 3, 3); 128 128 mLtBootOrder->setSpacing (3); 129 129 #endif /* Q_WS_MAC */ 130 130 131 /* Limit min/max . size of QLineEdit*/131 /* Limit min/max size of QLineEdit: */ 132 132 mLeMemory->setFixedWidthByText (QString().fill ('8', 5)); 133 /* Ensure mLeMemory value and validation is updated */133 /* Ensure mLeMemory value and validation is updated: */ 134 134 valueChangedRAM (mSlMemory->value()); 135 135 136 /* Setup cpu slider */136 /* Setup cpu slider: */ 137 137 mSlCPU->setPageStep (1); 138 138 mSlCPU->setSingleStep (1); 139 139 mSlCPU->setTickInterval (1); 140 /* Setup the scale so that ticks are at page step boundaries */140 /* Setup the scale so that ticks are at page step boundaries: */ 141 141 mSlCPU->setMinimum (mMinGuestCPU); 142 142 mSlCPU->setMaximum (mMaxGuestCPU); 143 143 mSlCPU->setOptimalHint (1, hostCPUs); 144 144 mSlCPU->setWarningHint (hostCPUs, mMaxGuestCPU); 145 /* Limit min/max. size of QLineEdit */145 /* Limit min/max. size of QLineEdit: */ 146 146 mLeCPU->setFixedWidthByText(QString().fill('8', 4)); 147 /* Ensure mLeMemory value and validation is updated */147 /* Ensure mLeMemory value and validation is updated: */ 148 148 valueChangedCPU (mSlCPU->value()); 149 149 … … 166 166 mCbChipset->insertItem(1, gpConverter->toString(KChipsetType_ICH9), QVariant(KChipsetType_ICH9)); 167 167 168 /* Install global event filter */168 /* Install global event filter: */ 169 169 qApp->installEventFilter (this); 170 170 171 /* Applying language settings*/171 /* Retranslate finally: */ 172 172 retranslateUi(); 173 173 } … … 283 283 mSlCPU->setValue(systemData.m_cCPUCount); 284 284 mSlCPUExecCap->setValue(systemData.m_cCPUExecCap); 285 int iChipsetPosition Pos= mCbChipset->findData(systemData.m_chipsetType);286 mCbChipset->setCurrentIndex(iChipsetPosition Pos == -1 ? 0 : iChipsetPositionPos);285 int iChipsetPosition = mCbChipset->findData(systemData.m_chipsetType); 286 mCbChipset->setCurrentIndex(iChipsetPosition == -1 ? 0 : iChipsetPosition); 287 287 288 288 /* Polish page finally: */ … … 384 384 void UIMachineSettingsSystem::setValidator (QIWidgetValidator *aVal) 385 385 { 386 /* Configure validation: */ 386 387 mValidator = aVal; 387 388 connect (mCbApic, SIGNAL (stateChanged (int)), mValidator, SLOT (revalidate())); … … 393 394 bool UIMachineSettingsSystem::revalidate (QString &aWarning, QString & /* aTitle */) 394 395 { 396 /* RAM amount test: */ 395 397 ulong fullSize = vboxGlobal().host().GetMemorySize(); 396 398 if (mSlMemory->value() > (int)mSlMemory->maxRAMAlw()) … … 415 417 } 416 418 417 /* VCPU amount test */419 /* VCPU amount test: */ 418 420 int totalCPUs = vboxGlobal().host().GetProcessorOnlineCount(); 419 421 if (mSlCPU->value() > 2 * totalCPUs) … … 437 439 } 438 440 439 /* VCPU IO-APIC test */441 /* VCPU IO-APIC test: */ 440 442 if (mSlCPU->value() > 1 && !mCbApic->isChecked()) 441 443 { … … 448 450 } 449 451 450 /* VCPU VT-x/AMD-V test */452 /* VCPU VT-x/AMD-V test: */ 451 453 if (mSlCPU->value() > 1 && !mCbVirt->isChecked()) 452 454 { … … 462 464 if (mSlCPUExecCap->value() < (int)mMedGuestCPUExecCap) 463 465 { 464 aWarning = tr("you have set the processor execution cap to a low value. " 465 "This can make the machine feel slow to respond."); 466 aWarning = tr ( 467 "you have set the processor execution cap to a low value. " 468 "This can make the machine feel slow to respond."); 466 469 return true; 467 470 } 468 471 469 /* Chipset type & IO-APIC test */472 /* Chipset type & IO-APIC test: */ 470 473 if ((KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt() == KChipsetType_ICH9 && !mCbApic->isChecked()) 471 474 { … … 506 509 setTabOrder (mCbTCUseUTC, mCbUseAbsHID); 507 510 508 /* Processor tab-order */511 /* Processor tab-order: */ 509 512 setTabOrder (mCbUseAbsHID, mSlCPU); 510 513 setTabOrder (mSlCPU, mLeCPU); … … 513 516 setTabOrder(mLeCPUExecCap, mCbPae); 514 517 515 /* Acceleration tab-order */518 /* Acceleration tab-order: */ 516 519 setTabOrder (mCbPae, mCbVirt); 517 520 setTabOrder (mCbVirt, mCbNestedPaging); … … 520 523 void UIMachineSettingsSystem::retranslateUi() 521 524 { 522 /* Translate uic generated strings */525 /* Translate uic generated strings: */ 523 526 Ui::UIMachineSettingsSystem::retranslateUi (this); 524 527 525 /* Readjust the tree widget items size */528 /* Readjust the tree widget items size: */ 526 529 adjustBootOrderTWSize(); 527 530 528 CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties(); 529 530 /* Retranslate the memory slider legend */ 531 /* Retranslate the memory slider legend: */ 531 532 mLbMemoryMin->setText (tr ("<qt>%1 MB</qt>").arg (mSlMemory->minRAM())); 532 533 mLbMemoryMax->setText (tr ("<qt>%1 MB</qt>").arg (mSlMemory->maxRAM())); 533 534 534 /* Retranslate the cpu slider legend */535 /* Retranslate the cpu slider legend: */ 535 536 mLbCPUMin->setText (tr ("<qt>%1 CPU</qt>", "%1 is 1 for now").arg (mMinGuestCPU)); 536 537 mLbCPUMax->setText (tr ("<qt>%1 CPUs</qt>", "%1 is host cpu count * 2 for now").arg (mMaxGuestCPU)); … … 553 554 void UIMachineSettingsSystem::onCurrentBootItemChanged (int i) 554 555 { 556 /* Update boot-order tool-buttons: */ 555 557 bool upEnabled = i > 0; 556 558 bool downEnabled = i < mTwBootOrder->count() - 1; … … 564 566 void UIMachineSettingsSystem::adjustBootOrderTWSize() 565 567 { 568 /* Adjust boot-table size: */ 566 569 mTwBootOrder->adjustSizeToFitContent(); 567 568 570 /* Update the layout system */ 569 571 if (mTabMotherboard->layout()) … … 607 609 case QEvent::FocusIn: 608 610 { 609 /* Boot Table */611 /* Boot Table: */ 610 612 if (widget == mTwBootOrder) 611 613 { … … 657 659 mCbTCUseUTC->setEnabled(isMachineOffline()); 658 660 mCbUseAbsHID->setEnabled(isMachineOffline()); 661 659 662 /* Processor tab: */ 660 663 mLbCPU->setEnabled(isMachineOffline()); … … 670 673 mLbProcessorExtended->setEnabled(isMachineOffline()); 671 674 mCbPae->setEnabled(isMachineOffline() && systemData.m_fPFPAESupported); 675 672 676 /* Acceleration tab: */ 673 677 mTwSystem->setTabEnabled(2, systemData.m_fPFHwVirtExSupported); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r44528 r47253 24 24 #include "UIMachineSettingsSystem.gen.h" 25 25 26 /* Machine settings / System page / Boot item: */26 /* Machine settings / System page / Data / Boot item: */ 27 27 struct UIBootItemData 28 28 { … … 100 100 /* Machine settings / System page: */ 101 101 class UIMachineSettingsSystem : public UISettingsPageMachine, 102 public Ui::UIMachineSettingsSystem102 public Ui::UIMachineSettingsSystem 103 103 { 104 104 Q_OBJECT; … … 106 106 public: 107 107 108 /* Constructor: */ 108 109 UIMachineSettingsSystem(); 109 110 111 /* API: Correlation stuff: */ 110 112 bool isHWVirtExEnabled() const; 111 113 bool isHIDEnabled() const; 112 114 KChipsetType chipsetType() const; 113 115 void setOHCIEnabled(bool fEnabled); 114 115 signals:116 117 void tableChanged();118 116 119 117 protected: … … 133 131 void saveFromCacheTo(QVariant &data); 134 132 135 /* Page changed: */133 /* API: Cache stuff: */ 136 134 bool changed() const { return m_cache.wasChanged(); } 137 135 136 /* Helpers: Validation stuff: */ 138 137 void setValidator (QIWidgetValidator *aVal); 139 138 bool revalidate (QString &aWarning, QString &aTitle); 140 139 140 /* Helper: Navigation stuff: */ 141 141 void setOrderAfter (QWidget *aWidget); 142 142 143 /* Helper: Translation stuff: */ 143 144 void retranslateUi(); 144 145 145 146 private slots: 146 147 148 /* Handlers: RAM stuff: */ 147 149 void valueChangedRAM (int aVal); 148 150 void textChangedRAM (const QString &aText); 149 151 152 /* Handler: Boot stuff: */ 150 153 void onCurrentBootItemChanged (int); 151 154 155 /* Handlers: CPU stuff: */ 152 156 void valueChangedCPU (int aVal); 153 157 void textChangedCPU (const QString &aText); … … 157 161 private: 158 162 163 /* Handler: Event-filtration stuff: */ 159 164 bool eventFilter (QObject *aObject, QEvent *aEvent); 160 165 166 /* Helper: Boot stuff: */ 161 167 void adjustBootOrderTWSize(); 162 168 169 /* Handler: Polishing stuff: */ 163 170 void polishPage(); 164 171 172 /* Variable: Validation stuff: */ 165 173 QIWidgetValidator *mValidator; 166 174 175 /* Variables: CPU stuff: */ 167 176 uint mMinGuestCPU; 168 177 uint mMaxGuestCPU; … … 171 180 uint mMaxGuestCPUExecCap; 172 181 182 /* Variable: Boot stuff: */ 173 183 QList<KDeviceType> m_possibleBootItems; 174 184 185 /* Variable: Correlation stuff: */ 175 186 bool m_fOHCIEnabled; 176 187 … … 180 191 181 192 #endif // __UIMachineSettingsSystem_h__ 182
Note:
See TracChangeset
for help on using the changeset viewer.