Changeset 47274 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 19, 2013 5:42:33 PM (12 years ago)
- 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
r47270 r47274 90 90 } 91 91 92 /* Setup validators: */ 93 m_pEditorMemorySize->setValidator(new QIntValidator(m_pSliderMemorySize->minRAM(), m_pSliderMemorySize->maxRAM(), this)); 94 m_pEditorCPUCount->setValidator(new QIntValidator(m_uMinGuestCPU, m_uMaxGuestCPU, this)); 95 m_pEditorCPUExecCap->setValidator(new QIntValidator(m_uMinGuestCPUExecCap, m_uMaxGuestCPUExecCap, this)); 96 97 /* Setup RAM connections: */ 98 connect(m_pSliderMemorySize, SIGNAL(valueChanged(int)), this, SLOT(valueChangedRAM(int))); 99 connect(m_pEditorMemorySize, SIGNAL(textChanged(const QString&)), this, SLOT(textChangedRAM(const QString&))); 92 /* Pre-configure memory-size editor: */ 93 m_pEditorMemorySize->setMinimum(m_pSliderMemorySize->minRAM()); 94 m_pEditorMemorySize->setMaximum(m_pSliderMemorySize->maxRAM()); 95 vboxGlobal().setMinimumWidthAccordingSymbolCount(m_pEditorMemorySize, 5); 96 97 /* Pre-configure CPU-count editor: */ 98 m_pEditorCPUCount->setMinimum(m_uMinGuestCPU); 99 m_pEditorCPUCount->setMaximum(m_uMaxGuestCPU); 100 vboxGlobal().setMinimumWidthAccordingSymbolCount(m_pEditorCPUCount, 4); 101 102 /* Pre-configure CPU-execution-cap editor: */ 103 m_pEditorCPUExecCap->setMinimum(m_uMinGuestCPUExecCap); 104 m_pEditorCPUExecCap->setMaximum(m_uMaxGuestCPUExecCap); 105 vboxGlobal().setMinimumWidthAccordingSymbolCount(m_pEditorCPUExecCap, 4); 106 107 /* Setup memory-size connections: */ 108 connect(m_pSliderMemorySize, SIGNAL(valueChanged(int)), this, SLOT(sltHandleMemorySizeSliderChange())); 109 connect(m_pEditorMemorySize, SIGNAL(valueChanged(int)), this, SLOT(sltHandleMemorySizeEditorChange())); 100 110 101 111 /* Setup boot-table connections: */ … … 105 115 106 116 /* Setup CPU connections: */ 107 connect(m_pSliderCPUCount, SIGNAL(valueChanged(int)), this, SLOT( valueChangedCPU(int)));108 connect(m_pEditorCPUCount, SIGNAL( textChanged(const QString&)), this, SLOT(textChangedCPU(const QString&)));109 connect(m_pSliderCPUExecCap, SIGNAL(valueChanged(int)), this, SLOT(slt ValueChangedCPUExecCap(int)));110 connect(m_pEditorCPUExecCap, SIGNAL( textChanged(const QString&)), this, SLOT(sltTextChangedCPUExecCap(const QString&)));117 connect(m_pSliderCPUCount, SIGNAL(valueChanged(int)), this, SLOT(sltHandleCPUCountSliderChange())); 118 connect(m_pEditorCPUCount, SIGNAL(valueChanged(int)), this, SLOT(sltHandleCPUCountEditorChange())); 119 connect(m_pSliderCPUExecCap, SIGNAL(valueChanged(int)), this, SLOT(sltHandleCPUExecCapSliderChange())); 120 connect(m_pEditorCPUExecCap, SIGNAL(valueChanged(int)), this, SLOT(sltHandleCPUExecCapEditorChange())); 111 121 112 122 /* Setup boot-table iconsets: */ … … 119 129 m_pLayoutBootOrder->setSpacing (3); 120 130 #endif /* Q_WS_MAC */ 121 122 /* Limit min/max size of QLineEdit: */123 m_pEditorMemorySize->setFixedWidthByText(QString().fill('8', 5));124 /* Ensure m_pEditorMemorySize value and validation is updated: */125 valueChangedRAM(m_pSliderMemorySize->value());126 131 127 132 /* Setup cpu slider: */ … … 134 139 m_pSliderCPUCount->setOptimalHint(1, hostCPUs); 135 140 m_pSliderCPUCount->setWarningHint(hostCPUs, m_uMaxGuestCPU); 136 /* Limit min/max. size of QLineEdit: */137 m_pEditorCPUCount->setFixedWidthByText(QString().fill('8', 4));138 /* Ensure m_pEditorMemorySize value and validation is updated: */139 valueChangedCPU(m_pSliderCPUCount->value());140 141 141 142 /* Setup cpu cap slider: */ … … 148 149 m_pSliderCPUExecCap->setWarningHint(m_uMinGuestCPUExecCap, m_uMedGuestCPUExecCap); 149 150 m_pSliderCPUExecCap->setOptimalHint(m_uMedGuestCPUExecCap, m_uMaxGuestCPUExecCap); 150 /* Limit min/max. size of QLineEdit: */151 m_pEditorCPUExecCap->setFixedWidthByText(QString().fill('8', 4));152 /* Ensure m_pEditorMemorySize value and validation is updated: */153 sltValueChangedCPUExecCap(m_pSliderCPUExecCap->value());154 151 155 152 /* Configure 'pointing HID type' combo: */ … … 205 202 206 203 /* Load motherboard data: */ 207 systemData.m_i RAMSize = m_machine.GetMemorySize();204 systemData.m_iMemorySize = m_machine.GetMemorySize(); 208 205 /* Load boot-items of current VM: */ 209 206 QList<KDeviceType> usedBootItems; … … 268 265 269 266 /* Load motherboard data to page: */ 270 m_pSliderMemorySize->setValue(systemData.m_i RAMSize);267 m_pSliderMemorySize->setValue(systemData.m_iMemorySize); 271 268 /* Remove any old data in the boot view: */ 272 269 QAbstractItemView *iv = qobject_cast <QAbstractItemView*> (mTwBootOrder); … … 314 311 315 312 /* Gather motherboard data: */ 316 systemData.m_i RAMSize = m_pSliderMemorySize->value();313 systemData.m_iMemorySize = m_pSliderMemorySize->value(); 317 314 /* Gather boot-table data: */ 318 315 systemData.m_bootItems.clear(); … … 363 360 { 364 361 /* Motherboard tab: */ 365 m_machine.SetMemorySize(systemData.m_i RAMSize);362 m_machine.SetMemorySize(systemData.m_iMemorySize); 366 363 /* Save boot-items of current VM: */ 367 364 int iBootIndex = 0; … … 567 564 } 568 565 569 void UIMachineSettingsSystem::valueChangedRAM(int iValue) 570 { 571 m_pEditorMemorySize->setText(QString::number(iValue)); 572 } 573 574 void UIMachineSettingsSystem::textChangedRAM(const QString &strText) 575 { 576 m_pSliderMemorySize->setValue(strText.toInt()); 566 void UIMachineSettingsSystem::sltHandleMemorySizeSliderChange() 567 { 568 /* Apply new memory-size value: */ 569 m_pEditorMemorySize->blockSignals(true); 570 m_pEditorMemorySize->setValue(m_pSliderMemorySize->value()); 571 m_pEditorMemorySize->blockSignals(false); 572 573 /* Revalidate if possible: */ 574 if (m_pValidator) 575 m_pValidator->revalidate(); 576 } 577 578 void UIMachineSettingsSystem::sltHandleMemorySizeEditorChange() 579 { 580 /* Apply new memory-size value: */ 581 m_pSliderMemorySize->blockSignals(true); 582 m_pSliderMemorySize->setValue(m_pEditorMemorySize->value()); 583 m_pSliderMemorySize->blockSignals(false); 584 585 /* Revalidate if possible: */ 586 if (m_pValidator) 587 m_pValidator->revalidate(); 577 588 } 578 589 … … 644 655 } 645 656 646 void UIMachineSettingsSystem::valueChangedCPU(int iValue) 647 { 648 m_pEditorCPUCount->setText(QString::number(iValue)); 649 } 650 651 void UIMachineSettingsSystem::textChangedCPU(const QString &strText) 652 { 653 m_pSliderCPUCount->setValue(strText.toInt()); 654 } 655 656 void UIMachineSettingsSystem::sltValueChangedCPUExecCap(int iValue) 657 { 658 m_pEditorCPUExecCap->setText(QString::number(iValue)); 659 } 660 661 void UIMachineSettingsSystem::sltTextChangedCPUExecCap(const QString &strText) 662 { 663 m_pSliderCPUExecCap->setValue(strText.toInt()); 657 void UIMachineSettingsSystem::sltHandleCPUCountSliderChange() 658 { 659 /* Apply new memory-size value: */ 660 m_pEditorCPUCount->blockSignals(true); 661 m_pEditorCPUCount->setValue(m_pSliderCPUCount->value()); 662 m_pEditorCPUCount->blockSignals(false); 663 664 /* Revalidate if possible: */ 665 if (m_pValidator) 666 m_pValidator->revalidate(); 667 } 668 669 void UIMachineSettingsSystem::sltHandleCPUCountEditorChange() 670 { 671 /* Apply new memory-size value: */ 672 m_pSliderCPUCount->blockSignals(true); 673 m_pSliderCPUCount->setValue(m_pEditorCPUCount->value()); 674 m_pSliderCPUCount->blockSignals(false); 675 676 /* Revalidate if possible: */ 677 if (m_pValidator) 678 m_pValidator->revalidate(); 679 } 680 681 void UIMachineSettingsSystem::sltHandleCPUExecCapSliderChange() 682 { 683 /* Apply new memory-size value: */ 684 m_pEditorCPUExecCap->blockSignals(true); 685 m_pEditorCPUExecCap->setValue(m_pSliderCPUExecCap->value()); 686 m_pEditorCPUExecCap->blockSignals(false); 687 688 /* Revalidate if possible: */ 689 if (m_pValidator) 690 m_pValidator->revalidate(); 691 } 692 693 void UIMachineSettingsSystem::sltHandleCPUExecCapEditorChange() 694 { 695 /* Apply new memory-size value: */ 696 m_pSliderCPUExecCap->blockSignals(true); 697 m_pSliderCPUExecCap->setValue(m_pEditorCPUExecCap->value()); 698 m_pSliderCPUExecCap->blockSignals(false); 699 700 /* Revalidate if possible: */ 701 if (m_pValidator) 702 m_pValidator->revalidate(); 664 703 } 665 704 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r47269 r47274 51 51 , m_fSupportedHwVirtEx(false) 52 52 /* Motherboard data: */ 53 , m_i RAMSize(-1)53 , m_iMemorySize(-1) 54 54 , m_bootItems(QList<UIBootItemData>()) 55 55 , m_chipsetType(KChipsetType_Null) … … 74 74 (m_fSupportedHwVirtEx == other.m_fSupportedHwVirtEx) && 75 75 /* Motherboard data: */ 76 (m_i RAMSize == other.m_iRAMSize) &&76 (m_iMemorySize == other.m_iMemorySize) && 77 77 (m_bootItems == other.m_bootItems) && 78 78 (m_chipsetType == other.m_chipsetType) && … … 99 99 100 100 /* Variables: Motherboard data: */ 101 int m_i RAMSize;101 int m_iMemorySize; 102 102 QList<UIBootItemData> m_bootItems; 103 103 KChipsetType m_chipsetType; … … 164 164 private slots: 165 165 166 /* Handlers: RAMstuff: */167 void valueChangedRAM(int iValue);168 void textChangedRAM(const QString &strText);166 /* Handlers: Memory-size stuff: */ 167 void sltHandleMemorySizeSliderChange(); 168 void sltHandleMemorySizeEditorChange(); 169 169 170 170 /* Handler: Boot-table stuff: */ … … 172 172 173 173 /* Handlers: CPU stuff: */ 174 void valueChangedCPU(int iValue);175 void textChangedCPU(const QString &strText);176 void slt ValueChangedCPUExecCap(int iValue);177 void slt TextChangedCPUExecCap(const QString &strText);174 void sltHandleCPUCountSliderChange(); 175 void sltHandleCPUCountEditorChange(); 176 void sltHandleCPUExecCapSliderChange(); 177 void sltHandleCPUExecCapEditorChange(); 178 178 179 179 private: -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui
r47272 r47274 3 3 VBox frontends: Qt4 GUI ("VirtualBox"): 4 4 5 Copyright (C) 2008-201 2Oracle Corporation5 Copyright (C) 2008-2013 Oracle Corporation 6 6 7 7 This file is part of VirtualBox Open Source Edition (OSE), as … … 90 90 <layout class="QHBoxLayout"> 91 91 <item> 92 <widget class="QILineEdit" name="m_pEditorMemorySize"> 93 <property name="sizePolicy"> 94 <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> 95 <horstretch>0</horstretch> 96 <verstretch>0</verstretch> 97 </sizepolicy> 98 </property> 92 <widget class="QSpinBox" name="m_pEditorMemorySize"> 99 93 <property name="whatsThis"> 100 94 <string>Controls the amount of memory provided to the virtual machine. If you assign too much, the machine might not start.</string> … … 448 442 </item> 449 443 <item row="0" column="2"> 450 <widget class="QILineEdit" name="m_pEditorCPUCount"> 451 <property name="sizePolicy"> 452 <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> 453 <horstretch>0</horstretch> 454 <verstretch>0</verstretch> 455 </sizepolicy> 456 </property> 444 <widget class="QSpinBox" name="m_pEditorCPUCount"> 457 445 <property name="whatsThis"> 458 446 <string>Controls the number of virtual CPUs in the virtual machine. You need hardware virtualization support on your host system to use more than one virtual CPU.</string> … … 517 505 </item> 518 506 <item row="2" column="2"> 519 <widget class="QILineEdit" name="m_pEditorCPUExecCap"> 520 <property name="sizePolicy"> 521 <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> 522 <horstretch>0</horstretch> 523 <verstretch>0</verstretch> 524 </sizepolicy> 525 </property> 507 <widget class="QSpinBox" name="m_pEditorCPUExecCap"> 526 508 <property name="whatsThis"> 527 509 <string>Limits the amount of time that each virtual CPU is allowed to run for. Each virtual CPU will be allowed to use up to this percentage of the processing time available on one physical CPU. The execution cap can be disabled by setting it to 100%. Setting the cap too low can make the machine feel slow to respond.</string> … … 632 614 <extends>QListWidget</extends> 633 615 <header>UIBootTable.h</header> 634 </customwidget>635 <customwidget>636 <class>QILineEdit</class>637 <extends>QLineEdit</extends>638 <header>QILineEdit.h</header>639 616 </customwidget> 640 617 <customwidget>
Note:
See TracChangeset
for help on using the changeset viewer.