Changeset 79998 in vbox
- Timestamp:
- Jul 26, 2019 11:18:54 AM (6 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
r79981 r79998 271 271 272 272 /* Load old 'Motherboard' data from the cache: */ 273 m_p SliderMemorySize->setValue(oldSystemData.m_iMemorySize);273 m_pBaseMemoryEditor->setValue(oldSystemData.m_iMemorySize); 274 274 m_pBootOrderEditor->setValue(oldSystemData.m_bootItems); 275 275 const int iChipsetTypePosition = m_pComboChipsetType->findData(oldSystemData.m_chipsetType); … … 312 312 313 313 /* Gather 'Motherboard' data: */ 314 newSystemData.m_iMemorySize = m_p SliderMemorySize->value();314 newSystemData.m_iMemorySize = m_pBaseMemoryEditor->value(); 315 315 newSystemData.m_bootItems = m_pBootOrderEditor->value(); 316 316 newSystemData.m_chipsetType = (KChipsetType)m_pComboChipsetType->itemData(m_pComboChipsetType->currentIndex()).toInt(); … … 371 371 /* RAM amount test: */ 372 372 const ulong uFullSize = uiCommon().host().GetMemorySize(); 373 if (m_p SliderMemorySize->value() > (int)m_pSliderMemorySize->maxRAMAlw())373 if (m_pBaseMemoryEditor->value() > (int)m_pBaseMemoryEditor->maxRAMAlw()) 374 374 { 375 375 message.second << tr( 376 376 "More than <b>%1%</b> of the host computer's memory (<b>%2</b>) is assigned to the virtual machine. " 377 377 "Not enough memory is left for the host operating system. Please select a smaller amount.") 378 .arg((unsigned)qRound((double)m_p SliderMemorySize->maxRAMAlw() / uFullSize * 100.0))378 .arg((unsigned)qRound((double)m_pBaseMemoryEditor->maxRAMAlw() / uFullSize * 100.0)) 379 379 .arg(uiCommon().formatSize((uint64_t)uFullSize * _1M)); 380 380 fPass = false; 381 381 } 382 else if (m_p SliderMemorySize->value() > (int)m_pSliderMemorySize->maxRAMOpt())382 else if (m_pBaseMemoryEditor->value() > (int)m_pBaseMemoryEditor->maxRAMOpt()) 383 383 { 384 384 message.second << tr( 385 385 "More than <b>%1%</b> of the host computer's memory (<b>%2</b>) is assigned to the virtual machine. " 386 386 "There might not be enough memory left for the host operating system. Please consider selecting a smaller amount.") 387 .arg((unsigned)qRound((double)m_p SliderMemorySize->maxRAMOpt() / uFullSize * 100.0))387 .arg((unsigned)qRound((double)m_pBaseMemoryEditor->maxRAMOpt() / uFullSize * 100.0)) 388 388 .arg(uiCommon().formatSize((uint64_t)uFullSize * _1M)); 389 389 } … … 548 548 /* Configure navigation for 'motherboard' tab: */ 549 549 setTabOrder(pWidget, m_pTabWidgetSystem->focusProxy()); 550 setTabOrder(m_pTabWidgetSystem->focusProxy(), m_pSliderMemorySize); 551 setTabOrder(m_pSliderMemorySize, m_pEditorMemorySize); 552 setTabOrder(m_pEditorMemorySize, m_pBootOrderEditor); 550 setTabOrder(m_pTabWidgetSystem->focusProxy(), m_pBaseMemoryEditor); 551 setTabOrder(m_pBaseMemoryEditor, m_pBootOrderEditor); 553 552 setTabOrder(m_pBootOrderEditor, m_pComboChipsetType); 554 553 setTabOrder(m_pComboChipsetType, m_pComboPointingHIDType); … … 576 575 Ui::UIMachineSettingsSystem::retranslateUi(this); 577 576 578 /* Retranslate the memory slider legend: */579 m_pEditorMemorySize->setSuffix(QString(" %1").arg(tr("MB")));580 m_pLabelMemoryMin->setText(tr("%1 MB").arg(m_pSliderMemorySize->minRAM()));581 m_pLabelMemoryMax->setText(tr("%1 MB").arg(m_pSliderMemorySize->maxRAM()));582 583 577 /* Retranslate the cpu slider legend: */ 584 578 m_pLabelCPUMin->setText(tr("%1 CPU", "%1 is 1 for now").arg(m_uMinGuestCPU)); … … 601 595 602 596 /* Polish 'Motherboard' availability: */ 603 m_pLabelMemorySize->setEnabled(isMachineOffline()); 604 m_pLabelMemoryMin->setEnabled(isMachineOffline()); 605 m_pLabelMemoryMax->setEnabled(isMachineOffline()); 606 m_pSliderMemorySize->setEnabled(isMachineOffline()); 607 m_pEditorMemorySize->setEnabled(isMachineOffline()); 597 m_pBaseMemoryLabel->setEnabled(isMachineOffline()); 598 m_pBaseMemoryEditor->setEnabled(isMachineOffline()); 608 599 m_pLabelBootOrder->setEnabled(isMachineOffline()); 609 600 m_pBootOrderEditor->setEnabled(isMachineOffline()); … … 644 635 } 645 636 646 void UIMachineSettingsSystem::sltHandleMemorySizeSliderChange()647 {648 /* Apply new memory-size value: */649 m_pEditorMemorySize->blockSignals(true);650 m_pEditorMemorySize->setValue(m_pSliderMemorySize->value());651 m_pEditorMemorySize->blockSignals(false);652 653 /* Revalidate: */654 revalidate();655 }656 657 void UIMachineSettingsSystem::sltHandleMemorySizeEditorChange()658 {659 /* Apply new memory-size value: */660 m_pSliderMemorySize->blockSignals(true);661 m_pSliderMemorySize->setValue(m_pEditorMemorySize->value());662 m_pSliderMemorySize->blockSignals(false);663 664 /* Revalidate: */665 revalidate();666 }667 668 637 void UIMachineSettingsSystem::sltHandleCPUCountSliderChange() 669 638 { … … 751 720 /* Tab and it's layout created in the .ui file. */ 752 721 { 753 /* Memory Size editor created in the .ui file. */ 754 AssertPtrReturnVoid(m_pEditorMemorySize); 755 { 756 /* Configure editor: */ 757 m_pEditorMemorySize->setMinimum(m_pSliderMemorySize->minRAM()); 758 m_pEditorMemorySize->setMaximum(m_pSliderMemorySize->maxRAM()); 759 uiCommon().setMinimumWidthAccordingSymbolCount(m_pEditorMemorySize, 5); 722 /* Base-memory label and editor created in the .ui file. */ 723 AssertPtrReturnVoid(m_pBaseMemoryLabel); 724 AssertPtrReturnVoid(m_pBaseMemoryEditor); 725 { 726 /* Configure label & editor: */ 727 m_pBaseMemoryLabel->setBuddy(m_pBaseMemoryEditor->focusProxy()); 760 728 } 761 729 … … 885 853 connect(m_pComboChipsetType, SIGNAL(currentIndexChanged(int)), this, SLOT(revalidate())); 886 854 connect(m_pComboPointingHIDType, SIGNAL(currentIndexChanged(int)), this, SLOT(revalidate())); 887 connect(m_pSliderMemorySize, SIGNAL(valueChanged(int)), this, SLOT(sltHandleMemorySizeSliderChange())); 888 connect(m_pEditorMemorySize, SIGNAL(valueChanged(int)), this, SLOT(sltHandleMemorySizeEditorChange())); 855 connect(m_pBaseMemoryEditor, &UIBaseMemoryEditor::sigValidChanged, this, &UIMachineSettingsSystem::revalidate); 889 856 connect(m_pCheckBoxApic, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 890 857 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r79981 r79998 101 101 private slots: 102 102 103 /** Handles memory size slider change. */104 void sltHandleMemorySizeSliderChange();105 /** Handles memory size editor change. */106 void sltHandleMemorySizeEditorChange();107 108 103 /** Handles CPU count slider change. */ 109 104 void sltHandleCPUCountSliderChange(); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.ui
r79978 r79998 24 24 <layout class="QGridLayout"> 25 25 <item row="0" column="0"> 26 <widget class="QLabel" name="m_p LabelMemorySize">26 <widget class="QLabel" name="m_pBaseMemoryLabel"> 27 27 <property name="text"> 28 28 <string>Base &Memory:</string> … … 31 31 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 32 32 </property> 33 <property name="buddy"> 34 <cstring>m_pEditorMemorySize</cstring> 35 </property> 36 </widget> 37 </item> 38 <item row="0" column="1" rowspan="2" colspan="2"> 33 </widget> 34 </item> 35 <item row="0" column="1" rowspan="2" colspan="3"> 39 36 <widget class="QWidget"> 40 37 <property name="sizePolicy"> … … 49 46 </property> 50 47 <item> 51 <widget class="UIBaseMemory Slider" name="m_pSliderMemorySize">48 <widget class="UIBaseMemoryEditor" name="m_pBaseMemoryEditor"> 52 49 <property name="whatsThis"> 53 50 <string>Controls the amount of memory provided to the virtual machine. If you assign too much, the machine might not start.</string> 54 51 </property> 55 <property name="orientation">56 <enum>Qt::Horizontal</enum>57 </property>58 52 </widget> 59 53 </item> 60 <item>61 <layout class="QHBoxLayout">62 <property name="spacing">63 <number>0</number>64 </property>65 <item>66 <widget class="QLabel" name="m_pLabelMemoryMin"/>67 </item>68 <item>69 <spacer name="m_pSpacerHorizontal1">70 <property name="orientation">71 <enum>Qt::Horizontal</enum>72 </property>73 <property name="sizeHint" stdset="0">74 <size>75 <width>0</width>76 <height>0</height>77 </size>78 </property>79 </spacer>80 </item>81 <item>82 <widget class="QLabel" name="m_pLabelMemoryMax"/>83 </item>84 </layout>85 </item>86 54 </layout> 87 </widget>88 </item>89 <item row="0" column="3">90 <widget class="QSpinBox" name="m_pEditorMemorySize">91 <property name="whatsThis">92 <string>Controls the amount of memory provided to the virtual machine. If you assign too much, the machine might not start.</string>93 </property>94 55 </widget> 95 56 </item> … … 600 561 </customwidget> 601 562 <customwidget> 602 <class>UIBaseMemory Slider</class>603 <extends>Q IAdvancedSlider</extends>604 <header>UIBaseMemory Slider.h</header>563 <class>UIBaseMemoryEditor</class> 564 <extends>QWidget</extends> 565 <header>UIBaseMemoryEditor.h</header> 605 566 </customwidget> 606 567 <customwidget>
Note:
See TracChangeset
for help on using the changeset viewer.