Changeset 37712 in vbox
- Timestamp:
- Jun 30, 2011 2:11:14 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp
r36364 r37712 191 191 case KVBoxEventType_OnSharedFolderChanged: 192 192 { 193 CSharedFolderChangedEvent es(pEvent);194 193 emit sigSharedFolderChange(); 195 194 break; … … 221 220 break; 222 221 } 222 case KVBoxEventType_OnCPUExecutionCapChanged: 223 { 224 emit sigCPUExecutionCapChange(); 225 break; 226 } 223 227 default: break; 224 228 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h
r36364 r37712 75 75 void sigCanShowWindow(bool &fVeto, QString &strReason); /* use Qt::DirectConnection */ 76 76 void sigShowWindow(LONG64 &winId); /* use Qt::DirectConnection */ 77 void sigCPUExecutionCapChange(); 77 78 }; 78 79 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r37585 r37712 1650 1650 tr ("<nobr>%1</nobr>", "details report")) 1651 1651 .arg (aMachine.GetCPUCount()) 1652 + QString (sSectionItemTpl2).arg (tr ("CPU Execution Cap", "details report"), 1653 tr ("<nobr>%1%</nobr>", "details report")) 1654 .arg (aMachine.GetCPUExecutionCap()) 1652 1655 + QString (sSectionItemTpl2).arg (tr ("Boot Order", "details report"), bootOrder) 1653 1656 #ifdef VBOX_WITH_FULL_DETAILS_REPORT -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp
r36364 r37712 79 79 << KVBoxEventType_OnRuntimeError 80 80 << KVBoxEventType_OnCanShowWindow 81 << KVBoxEventType_OnShowWindow; 81 << KVBoxEventType_OnShowWindow 82 << KVBoxEventType_OnCPUExecutionCapChanged; 82 83 83 84 const CConsole &console = m_pSession->session().GetConsole(); … … 144 145 this, SLOT(sltShowWindow(LONG64&)), 145 146 Qt::DirectConnection); 147 148 connect(pListener->getWrapped(), SIGNAL(sigCPUExecutionCapChange()), 149 this, SIGNAL(sigCPUExecutionCapChange()), 150 Qt::QueuedConnection); 146 151 } 147 152 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.h
r36364 r37712 50 50 void sigShowWindow(); 51 51 #endif /* RT_OS_DARWIN */ 52 void sigCPUExecutionCapChange(); 52 53 53 54 private slots: -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r35761 r37712 566 566 VBoxGlobal::tr("Disabled", "nested paging"); 567 567 568 QString tip(QApplication::translate("UIIndicatorsPool", "Indicates the status of the hardware virtualization " 569 "features used by this virtual machine:" 570 "<br><nobr><b>%1:</b> %2</nobr>" 571 "<br><nobr><b>%3:</b> %4</nobr>", 572 "Virtualization Stuff LED") 573 .arg(VBoxGlobal::tr("VT-x/AMD-V", "details report"), virtualization) 574 .arg(VBoxGlobal::tr("Nested Paging"), nestedPaging)); 568 QString strCPUExecCap = QString::number(console.GetMachine().GetCPUExecutionCap()); 569 570 QString tip(QApplication::translate("UIIndicatorsPool", 571 "Indicates the status of different " 572 "features used by this virtual machine:" 573 "<br><nobr><b>%1:</b> %2</nobr>" 574 "<br><nobr><b>%3:</b> %4</nobr>" 575 "<br><nobr><b>%5:</b> %6%</nobr>", 576 "Virtualization Stuff LED") 577 .arg(VBoxGlobal::tr("VT-x/AMD-V", "details report"), virtualization) 578 .arg(VBoxGlobal::tr("Nested Paging"), nestedPaging) 579 .arg(VBoxGlobal::tr("CPU Execution Cap", "details report"), strCPUExecCap)); 575 580 576 581 int cpuCount = console.GetMachine().GetCPUCount(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r37525 r37712 137 137 #endif /* Q_WS_MAC */ 138 138 139 connect(gConsoleEvents, SIGNAL(sigCPUExecutionCapChange()), 140 this, SIGNAL(sigCPUExecutionCapChange())); 141 139 142 /* Prepare main menu: */ 140 143 prepareMenuPool(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r36364 r37712 176 176 void sigShowWindows(); 177 177 #endif /* RT_OS_DARWIN */ 178 void sigCPUExecutionCapChange(); 178 179 179 180 /* Session signals: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r36083 r37712 156 156 { 157 157 updateAppearanceOf(UIVisualElement_SharedFolderStuff); 158 } 159 160 void UIMachineWindowNormal::sltCPUExecutionCapChange() 161 { 162 updateAppearanceOf(UIVisualElement_VirtualizationStuff); 158 163 } 159 164 … … 372 377 connect(machineLogic()->uisession(), SIGNAL(sigSharedFolderChange()), 373 378 this, SLOT(sltSharedFolderChange())); 379 380 /* CPU execution cap change updater: */ 381 connect(machineLogic()->uisession(), SIGNAL(sigCPUExecutionCapChange()), 382 this, SLOT(sltCPUExecutionCapChange())); 383 374 384 } 375 385 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.h
r30708 r37712 52 52 void sltNetworkAdapterChange(); 53 53 void sltSharedFolderChange(); 54 void sltCPUExecutionCapChange(); 54 55 55 56 /* LED connections: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp
r37592 r37712 595 595 tr("<nobr>%1</nobr>", "details report")) 596 596 .arg(cCPU); 597 598 #ifdef VBOX_WITH_FULL_DETAILS_REPORT 599 /* CPU Execution Cap 600 * is NOT such important attribute to be reflected in details page... */ 601 int iCPUExecCap = m_machine.GetCPUExecutionCap(); 602 if (iCPUExecCap < 100) 603 item += sSectionItemTpl2.arg(tr("CPU Execution Cap", "details report"), 604 tr("<nobr>%1%</nobr>", "details report")) 605 .arg(iCPUExecCap); 606 #endif /* VBOX_WITH_FULL_DETAILS_REPORT */ 597 607 598 608 /* Boot order */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r37168 r37712 31 31 : mValidator(0) 32 32 , mMinGuestCPU(0), mMaxGuestCPU(0) 33 , mMinGuestCPUExecCap(0), mMedGuestCPUExecCap(0), mMaxGuestCPUExecCap(0) 33 34 , m_fOHCIEnabled(false) 34 35 { … … 41 42 mMinGuestCPU = properties.GetMinGuestCPUCount(); 42 43 mMaxGuestCPU = RT_MIN (2 * hostCPUs, properties.GetMaxGuestCPUCount()); 44 mMinGuestCPUExecCap = 1; 45 mMedGuestCPUExecCap = 40; 46 mMaxGuestCPUExecCap = 100; 43 47 44 48 /* Populate possible boot items list. … … 84 88 mLeMemory->setValidator (new QIntValidator (mSlMemory->minRAM(), mSlMemory->maxRAM(), this)); 85 89 mLeCPU->setValidator (new QIntValidator (mMinGuestCPU, mMaxGuestCPU, this)); 90 mLeCPUExecCap->setValidator(new QIntValidator(mMinGuestCPUExecCap, mMaxGuestCPUExecCap, this)); 86 91 87 92 /* Setup connections */ … … 102 107 connect (mLeCPU, SIGNAL (textChanged (const QString&)), 103 108 this, SLOT (textChangedCPU (const QString&))); 109 110 connect(mSlCPUExecCap, SIGNAL(valueChanged(int)), this, SLOT(sltValueChangedCPUExecCap(int))); 111 connect(mLeCPUExecCap, SIGNAL(textChanged(const QString&)), this, SLOT(sltTextChangedCPUExecCap(const QString&))); 104 112 105 113 /* Setup iconsets */ … … 130 138 mSlCPU->setWarningHint (hostCPUs, mMaxGuestCPU); 131 139 /* Limit min/max. size of QLineEdit */ 132 mLeCPU->setFixedWidthByText (QString().fill ('8', 3));140 mLeCPU->setFixedWidthByText(QString().fill('8', 4)); 133 141 /* Ensure mLeMemory value and validation is updated */ 134 142 valueChangedCPU (mSlCPU->value()); 143 144 /* Setup cpu cap slider: */ 145 mSlCPUExecCap->setPageStep(10); 146 mSlCPUExecCap->setSingleStep(1); 147 mSlCPUExecCap->setTickInterval(10); 148 /* Setup the scale so that ticks are at page step boundaries: */ 149 mSlCPUExecCap->setMinimum(mMinGuestCPUExecCap); 150 mSlCPUExecCap->setMaximum(mMaxGuestCPUExecCap); 151 mSlCPUExecCap->setWarningHint(mMinGuestCPUExecCap, mMedGuestCPUExecCap); 152 mSlCPUExecCap->setOptimalHint(mMedGuestCPUExecCap, mMaxGuestCPUExecCap); 153 /* Limit min/max. size of QLineEdit: */ 154 mLeCPUExecCap->setFixedWidthByText(QString().fill('8', 4)); 155 /* Ensure mLeMemory value and validation is updated: */ 156 sltValueChangedCPUExecCap(mSlCPUExecCap->value()); 157 135 158 /* Populate chipset combo: */ 136 159 mCbChipset->insertItem(0, vboxGlobal().toString(KChipsetType_PIIX3), QVariant(KChipsetType_PIIX3)); … … 215 238 systemData.m_iRAMSize = m_machine.GetMemorySize(); 216 239 systemData.m_cCPUCount = systemData.m_fPFHwVirtExSupported ? m_machine.GetCPUCount() : 1; 240 systemData.m_cCPUExecCap = m_machine.GetCPUExecutionCap(); 217 241 systemData.m_chipsetType = m_machine.GetChipsetType(); 218 242 … … 252 276 mSlMemory->setValue(systemData.m_iRAMSize); 253 277 mSlCPU->setValue(systemData.m_cCPUCount); 278 mSlCPUExecCap->setValue(systemData.m_cCPUExecCap); 254 279 int iChipsetPositionPos = mCbChipset->findData(systemData.m_chipsetType); 255 280 mCbChipset->setCurrentIndex(iChipsetPositionPos == -1 ? 0 : iChipsetPositionPos); … … 290 315 systemData.m_iRAMSize = mSlMemory->value(); 291 316 systemData.m_cCPUCount = mSlCPU->value(); 317 systemData.m_cCPUExecCap = mSlCPUExecCap->value(); 292 318 systemData.m_chipsetType = (KChipsetType)mCbChipset->itemData(mCbChipset->currentIndex()).toInt(); 293 319 … … 339 365 m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging, systemData.m_fNestedPagingEnabled); 340 366 } 367 if (isMachineInValidMode()) 368 { 369 /* Processor tab: */ 370 m_machine.SetCPUExecutionCap(systemData.m_cCPUExecCap); 371 } 341 372 } 342 373 … … 419 450 "This will be done automatically when you accept the VM Settings " 420 451 "by pressing the OK button."); 452 return true; 453 } 454 455 /* CPU execution cap is low: */ 456 if (mSlCPUExecCap->value() < (int)mMedGuestCPUExecCap) 457 { 458 aWarning = tr("you have set CPU execution cap to low value, which may " 459 "distort audio and have other side effects."); 421 460 return true; 422 461 } … … 464 503 setTabOrder (mCbUseAbsHID, mSlCPU); 465 504 setTabOrder (mSlCPU, mLeCPU); 466 setTabOrder (mLeCPU, mCbPae); 505 setTabOrder(mLeCPU, mSlCPUExecCap); 506 setTabOrder(mSlCPUExecCap, mLeCPUExecCap); 507 setTabOrder(mLeCPUExecCap, mCbPae); 467 508 468 509 /* Acceleration tab-order */ … … 488 529 mLbCPUMin->setText (tr ("<qt>%1 CPU</qt>", "%1 is 1 for now").arg (mMinGuestCPU)); 489 530 mLbCPUMax->setText (tr ("<qt>%1 CPUs</qt>", "%1 is host cpu count * 2 for now").arg (mMaxGuestCPU)); 531 532 /* Retranslate the cpu cap slider legend: */ 533 mLbCPUExecCapMin->setText(tr("<qt>%1%</qt>", "Min CPU execution cap in %").arg(mMinGuestCPUExecCap)); 534 mLbCPUExecCapMax->setText(tr("<qt>%1%</qt>", "Max CPU execution cap in %").arg(mMaxGuestCPUExecCap)); 490 535 } 491 536 … … 531 576 { 532 577 mSlCPU->setValue (aText.toInt()); 578 } 579 580 void UIMachineSettingsSystem::sltValueChangedCPUExecCap(int iValue) 581 { 582 mLeCPUExecCap->setText(QString().setNum(iValue)); 583 } 584 585 void UIMachineSettingsSystem::sltTextChangedCPUExecCap(const QString &strText) 586 { 587 mSlCPUExecCap->setValue(strText.toInt()); 533 588 } 534 589 … … 602 657 mSlCPU->setEnabled(isMachineOffline() && systemData.m_fPFHwVirtExSupported); 603 658 mLeCPU->setEnabled(isMachineOffline() && systemData.m_fPFHwVirtExSupported); 659 mLbCPUExecCap->setEnabled(isMachineInValidMode()); 660 mLbCPUExecCapMin->setEnabled(isMachineInValidMode()); 661 mLbCPUExecCapMax->setEnabled(isMachineInValidMode()); 662 mSlCPUExecCap->setEnabled(isMachineInValidMode()); 663 mLeCPUExecCap->setEnabled(isMachineInValidMode()); 604 664 mLbProcessorExtended->setEnabled(isMachineOffline()); 605 665 mCbPae->setEnabled(isMachineOffline() && systemData.m_fPFPAESupported); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r37168 r37712 57 57 , m_fNestedPagingEnabled(false) 58 58 , m_iRAMSize(-1) 59 , m_cCPUCount(-1) {} 59 , m_cCPUCount(-1) 60 , m_cCPUExecCap(-1) {} 60 61 /* Functions: */ 61 62 bool equal(const UIDataSettingsMachineSystem &other) const … … 73 74 (m_fNestedPagingEnabled == other.m_fNestedPagingEnabled) && 74 75 (m_iRAMSize == other.m_iRAMSize) && 75 (m_cCPUCount == other.m_cCPUCount); 76 (m_cCPUCount == other.m_cCPUCount) && 77 (m_cCPUExecCap == other.m_cCPUExecCap); 76 78 } 77 79 /* Operators: */ … … 92 94 int m_iRAMSize; 93 95 int m_cCPUCount; 96 int m_cCPUExecCap; 94 97 }; 95 98 typedef UISettingsCache<UIDataSettingsMachineSystem> UICacheSettingsMachineSystem; … … 149 152 void valueChangedCPU (int aVal); 150 153 void textChangedCPU (const QString &aText); 154 void sltValueChangedCPUExecCap(int iValue); 155 void sltTextChangedCPUExecCap(const QString &strText); 151 156 152 157 private: … … 162 167 uint mMinGuestCPU; 163 168 uint mMaxGuestCPU; 169 uint mMinGuestCPUExecCap; 170 uint mMedGuestCPUExecCap; 171 uint mMaxGuestCPUExecCap; 164 172 165 173 QList<KDeviceType> m_possibleBootItems; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui
r34348 r37712 539 539 </item> 540 540 <item row="2" column="0"> 541 <widget class="QLabel" name="mLbProcessorExtended"> 542 <property name="text"> 543 <string>Extended Features:</string> 541 <widget class="QLabel" name="mLbCPUExecCap"> 542 <property name="sizePolicy"> 543 <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> 544 <horstretch>0</horstretch> 545 <verstretch>0</verstretch> 546 </sizepolicy> 547 </property> 548 <property name="text"> 549 <string>&CPU Execution Cap:</string> 544 550 </property> 545 551 <property name="alignment"> 546 552 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 547 553 </property> 548 </widget> 549 </item> 550 <item row="2" column="1" colspan="2"> 554 <property name="buddy"> 555 <cstring>mLeCPUExecCap</cstring> 556 </property> 557 </widget> 558 </item> 559 <item row="2" column="1" rowspan="2"> 560 <layout class="QVBoxLayout" name="mLtCPUExecCapSlider"> 561 <property name="spacing"> 562 <number>0</number> 563 </property> 564 <item> 565 <widget class="QIAdvancedSlider" name="mSlCPUExecCap"> 566 <property name="whatsThis"> 567 <string>Controls the CPU execution cap of each virtual CPU. It defines how much cycles each virtual CPU can use as a percent of host's CPU. 100% = unlimited.</string> 568 </property> 569 <property name="maximum"> 570 <number>4096</number> 571 </property> 572 <property name="singleStep"> 573 <number>200</number> 574 </property> 575 <property name="value"> 576 <number>512</number> 577 </property> 578 <property name="orientation"> 579 <enum>Qt::Horizontal</enum> 580 </property> 581 <property name="tickPosition"> 582 <enum>QSlider::TicksBelow</enum> 583 </property> 584 </widget> 585 </item> 586 <item> 587 <layout class="QHBoxLayout" name="mLtCPUExecCapLegend"> 588 <property name="spacing"> 589 <number>0</number> 590 </property> 591 <item> 592 <widget class="QLabel" name="mLbCPUExecCapMin"> 593 <property name="sizePolicy"> 594 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 595 <horstretch>0</horstretch> 596 <verstretch>0</verstretch> 597 </sizepolicy> 598 </property> 599 </widget> 600 </item> 601 <item> 602 <spacer name="mSpHor5"> 603 <property name="orientation"> 604 <enum>Qt::Horizontal</enum> 605 </property> 606 <property name="sizeHint" stdset="0"> 607 <size> 608 <width>0</width> 609 <height>0</height> 610 </size> 611 </property> 612 </spacer> 613 </item> 614 <item> 615 <widget class="QLabel" name="mLbCPUExecCapMax"> 616 <property name="sizePolicy"> 617 <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> 618 <horstretch>0</horstretch> 619 <verstretch>0</verstretch> 620 </sizepolicy> 621 </property> 622 <property name="alignment"> 623 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 624 </property> 625 </widget> 626 </item> 627 </layout> 628 </item> 629 </layout> 630 </item> 631 <item row="2" column="2"> 632 <widget class="QILineEdit" name="mLeCPUExecCap"> 633 <property name="sizePolicy"> 634 <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> 635 <horstretch>0</horstretch> 636 <verstretch>0</verstretch> 637 </sizepolicy> 638 </property> 639 <property name="whatsThis"> 640 <string>Controls the CPU execution cap of each virtual CPU. It defines how much cycles each virtual CPU can use as a percent of host's CPU. 100% = unlimited.</string> 641 </property> 642 </widget> 643 </item> 644 <item row="4" column="0"> 645 <widget class="QLabel" name="mLbProcessorExtended"> 646 <property name="text"> 647 <string>Extended Features:</string> 648 </property> 649 <property name="alignment"> 650 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 651 </property> 652 </widget> 653 </item> 654 <item row="4" column="1" colspan="2"> 551 655 <widget class="QCheckBox" name="mCbPae"> 552 656 <property name="sizePolicy"> … … 564 668 </widget> 565 669 </item> 566 <item row=" 3" column="0" colspan="3">670 <item row="5" column="0" colspan="3"> 567 671 <spacer name="mSpVer3"> 568 672 <property name="orientation">
Note:
See TracChangeset
for help on using the changeset viewer.