Changeset 47814 in vbox
- Timestamp:
- Aug 16, 2013 1:46:11 PM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.cpp
r46496 r47814 24 24 #include <QSpacerItem> 25 25 #include <QLabel> 26 #include <QSpinBox> 26 27 27 28 /* GUI includes: */ … … 30 31 #include "VBoxGlobal.h" 31 32 #include "VBoxGuestRAMSlider.h" 32 #include "QILineEdit.h"33 33 #include "QIRichTextLabel.h" 34 34 … … 37 37 } 38 38 39 void UIWizardNewVMPage2::onRamSliderValueChanged( int iValue)39 void UIWizardNewVMPage2::onRamSliderValueChanged() 40 40 { 41 41 /* Update 'ram' field editor connected to slider: */ 42 42 m_pRamEditor->blockSignals(true); 43 m_pRamEditor->set Text(QString::number(iValue));43 m_pRamEditor->setValue(m_pRamSlider->value()); 44 44 m_pRamEditor->blockSignals(false); 45 45 } 46 46 47 void UIWizardNewVMPage2::onRamEditor TextChanged(const QString &strText)47 void UIWizardNewVMPage2::onRamEditorValueChanged() 48 48 { 49 49 /* Update 'ram' field slider connected to editor: */ 50 50 m_pRamSlider->blockSignals(true); 51 m_pRamSlider->setValue( strText.toInt());51 m_pRamSlider->setValue(m_pRamEditor->value()); 52 52 m_pRamSlider->blockSignals(false); 53 53 } … … 66 66 m_pRamSlider->setOrientation(Qt::Horizontal); 67 67 } 68 m_pRamEditor = new Q ILineEdit(this);68 m_pRamEditor = new QSpinBox(this); 69 69 { 70 m_pRamEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 71 m_pRamEditor->setFixedWidthByText("88888"); 72 m_pRamEditor->setAlignment(Qt::AlignRight); 73 m_pRamEditor->setValidator(new QIntValidator(m_pRamSlider->minRAM(), m_pRamSlider->maxRAM(), this)); 70 m_pRamEditor->setMinimum(m_pRamSlider->minRAM()); 71 m_pRamEditor->setMaximum(m_pRamSlider->maxRAM()); 72 vboxGlobal().setMinimumWidthAccordingSymbolCount(m_pRamEditor, 5); 74 73 } 75 74 m_pRamUnits = new QLabel(this); … … 98 97 99 98 /* Setup connections: */ 100 connect(m_pRamSlider, SIGNAL(valueChanged(int)), this, SLOT(sltRamSliderValueChanged( int)));101 connect(m_pRamEditor, SIGNAL( textChanged(const QString&)), this, SLOT(sltRamEditorTextChanged(const QString&)));99 connect(m_pRamSlider, SIGNAL(valueChanged(int)), this, SLOT(sltRamSliderValueChanged())); 100 connect(m_pRamEditor, SIGNAL(valueChanged(int)), this, SLOT(sltRamEditorValueChanged())); 102 101 103 102 /* Register fields: */ … … 105 104 } 106 105 107 void UIWizardNewVMPageBasic2::sltRamSliderValueChanged( int iValue)106 void UIWizardNewVMPageBasic2::sltRamSliderValueChanged() 108 107 { 109 108 /* Call to base-class: */ 110 onRamSliderValueChanged( iValue);109 onRamSliderValueChanged(); 111 110 112 111 /* Broadcast complete-change: */ … … 114 113 } 115 114 116 void UIWizardNewVMPageBasic2::sltRamEditor TextChanged(const QString &strText)115 void UIWizardNewVMPageBasic2::sltRamEditorValueChanged() 117 116 { 118 117 /* Call to base-class: */ 119 onRamEditor TextChanged(strText);118 onRamEditorValueChanged(); 120 119 121 120 /* Broadcast complete-change: */ … … 148 147 CGuestOSType type = field("type").value<CGuestOSType>(); 149 148 m_pRamSlider->setValue(type.GetRecommendedRAM()); 150 m_pRamEditor->set Text(QString::number(type.GetRecommendedRAM()));149 m_pRamEditor->setValue(type.GetRecommendedRAM()); 151 150 152 151 /* 'Ram' field should have focus initially: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic2.h
r41389 r47814 25 25 /* Forward declarations: */ 26 26 class VBoxGuestRAMSlider; 27 class Q ILineEdit;27 class QSpinBox; 28 28 class QLabel; 29 29 class QIRichTextLabel; … … 38 38 39 39 /* Handlers: */ 40 void onRamSliderValueChanged( int iValue);41 void onRamEditor TextChanged(const QString &strText);40 void onRamSliderValueChanged(); 41 void onRamEditorValueChanged(); 42 42 43 43 /* Widgets: */ 44 44 VBoxGuestRAMSlider *m_pRamSlider; 45 Q ILineEdit*m_pRamEditor;45 QSpinBox *m_pRamEditor; 46 46 QLabel *m_pRamMin; 47 47 QLabel *m_pRamMax; … … 62 62 63 63 /* Handlers: */ 64 void sltRamSliderValueChanged( int iValue);65 void sltRamEditor TextChanged(const QString &strText);64 void sltRamSliderValueChanged(); 65 void sltRamEditorValueChanged(); 66 66 67 67 private: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r47184 r47814 26 26 #include <QLineEdit> 27 27 #include <QLabel> 28 #include <QSpinBox> 28 29 #include <QRadioButton> 29 30 … … 35 36 #include "VBoxGuestRAMSlider.h" 36 37 #include "VBoxMediaComboBox.h" 37 #include "QILineEdit.h"38 38 #include "QIToolButton.h" 39 39 … … 66 66 m_pRamSlider->setValue(m_pNameAndSystemEditor->type().GetRecommendedRAM()); 67 67 } 68 m_pRamEditor = new QILineEdit(m_pMemoryCnt); 69 { 70 m_pRamEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 71 m_pRamEditor->setFixedWidthByText("88888"); 72 m_pRamEditor->setAlignment(Qt::AlignRight); 73 m_pRamEditor->setValidator(new QIntValidator(m_pRamSlider->minRAM(), m_pRamSlider->maxRAM(), this)); 74 m_pRamEditor->setText(QString::number(m_pNameAndSystemEditor->type().GetRecommendedRAM())); 68 m_pRamEditor = new QSpinBox(m_pMemoryCnt); 69 { 70 m_pRamEditor->setMinimum(m_pRamSlider->minRAM()); 71 m_pRamEditor->setMaximum(m_pRamSlider->maxRAM()); 72 vboxGlobal().setMinimumWidthAccordingSymbolCount(m_pRamEditor, 5); 75 73 } 76 74 m_pRamUnits = new QLabel(m_pMemoryCnt); … … 136 134 connect(m_pNameAndSystemEditor, SIGNAL(sigNameChanged(const QString &)), this, SLOT(sltNameChanged(const QString &))); 137 135 connect(m_pNameAndSystemEditor, SIGNAL(sigOsTypeChanged()), this, SLOT(sltOsTypeChanged())); 138 connect(m_pRamSlider, SIGNAL(valueChanged(int)), this, SLOT(sltRamSliderValueChanged( int)));139 connect(m_pRamEditor, SIGNAL( textChanged(const QString &)), this, SLOT(sltRamEditorTextChanged(const QString &)));136 connect(m_pRamSlider, SIGNAL(valueChanged(int)), this, SLOT(sltRamSliderValueChanged())); 137 connect(m_pRamEditor, SIGNAL(valueChanged(int)), this, SLOT(sltRamEditorValueChanged())); 140 138 connect(m_pDiskSkip, SIGNAL(toggled(bool)), this, SLOT(sltVirtualDiskSourceChanged())); 141 139 connect(m_pDiskCreate, SIGNAL(toggled(bool)), this, SLOT(sltVirtualDiskSourceChanged())); … … 165 163 CGuestOSType type = m_pNameAndSystemEditor->type(); 166 164 m_pRamSlider->setValue(type.GetRecommendedRAM()); 167 m_pRamEditor->set Text(QString::number(type.GetRecommendedRAM()));165 m_pRamEditor->setValue(type.GetRecommendedRAM()); 168 166 169 167 /* Broadcast complete-change: */ … … 179 177 CGuestOSType type = m_pNameAndSystemEditor->type(); 180 178 m_pRamSlider->setValue(type.GetRecommendedRAM()); 181 m_pRamEditor->set Text(QString::number(type.GetRecommendedRAM()));182 183 /* Broadcast complete-change: */ 184 emit completeChanged(); 185 } 186 187 void UIWizardNewVMPageExpert::sltRamSliderValueChanged( int iValue)188 { 189 /* Call to base-class: */ 190 onRamSliderValueChanged( iValue);191 192 /* Broadcast complete-change: */ 193 emit completeChanged(); 194 } 195 196 void UIWizardNewVMPageExpert::sltRamEditor TextChanged(const QString &strText)197 { 198 /* Call to base-class: */ 199 onRamEditor TextChanged(strText);179 m_pRamEditor->setValue(type.GetRecommendedRAM()); 180 181 /* Broadcast complete-change: */ 182 emit completeChanged(); 183 } 184 185 void UIWizardNewVMPageExpert::sltRamSliderValueChanged() 186 { 187 /* Call to base-class: */ 188 onRamSliderValueChanged(); 189 190 /* Broadcast complete-change: */ 191 emit completeChanged(); 192 } 193 194 void UIWizardNewVMPageExpert::sltRamEditorValueChanged() 195 { 196 /* Call to base-class: */ 197 onRamEditorValueChanged(); 200 198 201 199 /* Broadcast complete-change: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r42616 r47814 60 60 void sltNameChanged(const QString &strNewText); 61 61 void sltOsTypeChanged(); 62 void sltRamSliderValueChanged( int iValue);63 void sltRamEditor TextChanged(const QString &strText);62 void sltRamSliderValueChanged(); 63 void sltRamEditorValueChanged(); 64 64 void sltVirtualDiskSourceChanged(); 65 65 void sltGetWithFileOpenDialog();
Note:
See TracChangeset
for help on using the changeset viewer.