Changeset 87430 in vbox
- Timestamp:
- Jan 26, 2021 11:44:45 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 6 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r87418 r87430 657 657 src/wizards/newvm/UIWizardNewVMPageBasic3.h \ 658 658 src/wizards/newvm/UIWizardNewVMPageBasic4.h \ 659 src/wizards/newvm/UIWizardNewVMPageBasic5.h \ 659 660 src/wizards/newvm/UIWizardNewVMPageExpert.h \ 660 661 src/wizards/clonevm/UIWizardCloneVM.h \ … … 1139 1140 src/wizards/newvm/UIWizardNewVMPageBasic3.cpp \ 1140 1141 src/wizards/newvm/UIWizardNewVMPageBasic4.cpp \ 1142 src/wizards/newvm/UIWizardNewVMPageBasic5.cpp \ 1141 1143 src/wizards/newvm/UIWizardNewVMPageExpert.cpp \ 1142 1144 src/wizards/clonevm/UIWizardCloneVM.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r87414 r87430 27 27 #include "UIWizardNewVMPageBasic3.h" 28 28 #include "UIWizardNewVMPageBasic4.h" 29 #include "UIWizardNewVMPageBasic5.h" 29 30 #include "UIWizardNewVMPageExpert.h" 30 31 #include "UIMessageCenter.h" … … 84 85 setPage(Page3, new UIWizardNewVMPageBasic3); 85 86 setPage(Page4, new UIWizardNewVMPageBasic4); 87 setPage(Page5, new UIWizardNewVMPageBasic5); 86 88 setStartId(Page1); 87 89 break; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r87414 r87430 64 64 Page3, 65 65 Page4, 66 Page5, 66 67 PageMax 67 68 }; … … 99 100 100 101 /* Who will be able to create virtual-machine: */ 101 friend class UIWizardNewVMPageBasic 4;102 friend class UIWizardNewVMPageBasic5; 102 103 friend class UIWizardNewVMPageExpert; 103 104 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.cpp
r87423 r87430 37 37 38 38 UIWizardNewVMPage4::UIWizardNewVMPage4() 39 : m_fRecommendedNoDisk(false) 40 , m_pDiskSkip(0) 41 , m_pDiskCreate(0) 42 , m_pDiskPresent(0) 43 , m_pDiskSelector(0) 44 , m_pVMMButton(0) 45 , m_pBaseMemoryEditor(0) 39 : m_pBaseMemoryEditor(0) 46 40 , m_pVirtualCPUEditor(0) 47 41 { 48 }49 50 void UIWizardNewVMPage4::updateVirtualDiskSource()51 {52 if (!m_pDiskSelector || !m_pVMMButton)53 return;54 55 /* Enable/disable controls: */56 m_pDiskSelector->setEnabled(m_pDiskPresent->isChecked());57 m_pVMMButton->setEnabled(m_pDiskPresent->isChecked());58 59 /* Fetch filed values: */60 if (m_pDiskSkip->isChecked())61 {62 m_uVirtualDiskId = QUuid();63 m_strVirtualDiskName = QString();64 m_strVirtualDiskLocation = QString();65 }66 else if (m_pDiskPresent->isChecked())67 {68 m_uVirtualDiskId = m_pDiskSelector->id();69 m_strVirtualDiskName = m_pDiskSelector->currentText();70 m_strVirtualDiskLocation = m_pDiskSelector->location();71 }72 }73 74 void UIWizardNewVMPage4::getWithFileOpenDialog()75 {76 /* Get opened medium id: */77 QUuid uMediumId;78 79 int returnCode = uiCommon().openMediumSelectorDialog(thisImp(), UIMediumDeviceType_HardDisk,80 uMediumId,81 fieldImp("machineFolder").toString(),82 fieldImp("machineBaseName").toString(),83 fieldImp("type").value<CGuestOSType>().GetId(),84 false /* don't show/enable the create action: */);85 86 if (returnCode == static_cast<int>(UIMediumSelector::ReturnCode_Accepted) && !uMediumId.isNull())87 {88 /* Update medium-combo if necessary: */89 m_pDiskSelector->setCurrentItem(uMediumId);90 /* Update hard disk source: */91 updateVirtualDiskSource();92 /* Focus on hard disk combo: */93 m_pDiskSelector->setFocus();94 }95 }96 97 bool UIWizardNewVMPage4::getWithNewVirtualDiskWizard()98 {99 /* Create New Virtual Hard Drive wizard: */100 UISafePointerWizardNewVD pWizard = new UIWizardNewVD(thisImp(),101 fieldImp("machineBaseName").toString(),102 fieldImp("machineFolder").toString(),103 fieldImp("type").value<CGuestOSType>().GetRecommendedHDD(),104 wizardImp()->mode());105 pWizard->prepare();106 bool fResult = false;107 if (pWizard->exec() == QDialog::Accepted)108 {109 fResult = true;110 m_virtualDisk = pWizard->virtualDisk();111 m_pDiskSelector->setCurrentItem(m_virtualDisk.GetId());112 m_pDiskPresent->click();113 }114 if (pWizard)115 delete pWizard;116 return fResult;117 42 } 118 43 … … 131 56 } 132 57 133 void UIWizardNewVMPage4::ensureNewVirtualDiskDeleted()134 {135 /* Make sure virtual-disk valid: */136 if (m_virtualDisk.isNull())137 return;138 139 /* Remember virtual-disk attributes: */140 QString strLocation = m_virtualDisk.GetLocation();141 /* Prepare delete storage progress: */142 CProgress progress = m_virtualDisk.DeleteStorage();143 if (m_virtualDisk.isOk())144 {145 /* Show delete storage progress: */146 msgCenter().showModalProgressDialog(progress, thisImp()->windowTitle(), ":/progress_media_delete_90px.png", thisImp());147 if (!progress.isOk() || progress.GetResultCode() != 0)148 msgCenter().cannotDeleteHardDiskStorage(progress, strLocation, thisImp());149 }150 else151 msgCenter().cannotDeleteHardDiskStorage(m_virtualDisk, strLocation, thisImp());152 153 /* Detach virtual-disk anyway: */154 m_virtualDisk.detach();155 }156 157 58 void UIWizardNewVMPage4::retranslateWidgets() 158 59 { 159 if (m_pDiskSkip)160 m_pDiskSkip->setText(UIWizardNewVM::tr("&Do not add a virtual hard disk"));161 if (m_pDiskCreate)162 m_pDiskCreate->setText(UIWizardNewVM::tr("&Create a virtual hard disk now"));163 if (m_pDiskPresent)164 m_pDiskPresent->setText(UIWizardNewVM::tr("&Use an existing virtual hard disk file"));165 if (m_pVMMButton)166 m_pVMMButton->setToolTip(UIWizardNewVM::tr("Choose a virtual hard disk file..."));167 }168 169 QWidget *UIWizardNewVMPage4::createDiskWidgets()170 {171 QWidget *pDiskContainer = new QWidget;172 QGridLayout *pDiskLayout = new QGridLayout(pDiskContainer);173 174 m_pDiskSkip = new QRadioButton;175 m_pDiskCreate = new QRadioButton;176 m_pDiskPresent = new QRadioButton;177 QStyleOptionButton options;178 options.initFrom(m_pDiskPresent);179 int iWidth = m_pDiskPresent->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth, &options, m_pDiskPresent);180 pDiskLayout->setColumnMinimumWidth(0, iWidth);181 m_pDiskSelector = new UIMediaComboBox;182 {183 m_pDiskSelector->setType(UIMediumDeviceType_HardDisk);184 m_pDiskSelector->repopulate();185 }186 m_pVMMButton = new QIToolButton;187 {188 m_pVMMButton->setAutoRaise(true);189 m_pVMMButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", ":/select_file_disabled_16px.png"));190 }191 pDiskLayout->addWidget(m_pDiskSkip, 0, 0, 1, 3);192 pDiskLayout->addWidget(m_pDiskCreate, 1, 0, 1, 3);193 pDiskLayout->addWidget(m_pDiskPresent, 2, 0, 1, 3);194 pDiskLayout->addWidget(m_pDiskSelector, 3, 1);195 pDiskLayout->addWidget(m_pVMMButton, 3, 2);196 return pDiskContainer;197 60 } 198 61 … … 214 77 prepare(); 215 78 qRegisterMetaType<CMedium>(); 216 registerField("virtualDisk", this, "virtualDisk");217 registerField("virtualDiskId", this, "virtualDiskId");218 registerField("virtualDiskName", this, "virtualDiskName");219 registerField("virtualDiskLocation", this, "virtualDiskLocation");220 79 registerField("baseMemory", this, "baseMemory"); 221 80 registerField("VCPUCount", this, "VCPUCount"); … … 228 87 m_pLabel = new QIRichTextLabel(this); 229 88 pMainLayout->addWidget(m_pLabel); 230 pMainLayout->addWidget(create DiskWidgets());89 pMainLayout->addWidget(createHardwareWidgets()); 231 90 232 91 pMainLayout->addStretch(); 233 updateVirtualDiskSource();234 92 createConnections(); 235 93 } … … 237 95 void UIWizardNewVMPageBasic4::createConnections() 238 96 { 239 connect(m_pDiskSkip, &QRadioButton::toggled, 240 this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged); 241 connect(m_pDiskCreate, &QRadioButton::toggled, 242 this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged); 243 connect(m_pDiskPresent, &QRadioButton::toggled, 244 this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged); 245 connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged), 246 this, &UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged); 247 connect(m_pVMMButton, &QIToolButton::clicked, 248 this, &UIWizardNewVMPageBasic4::sltGetWithFileOpenDialog); 97 249 98 } 250 99 251 void UIWizardNewVMPageBasic4::sltVirtualDiskSourceChanged()252 {253 /* Call to base-class: */254 updateVirtualDiskSource();255 256 /* Broadcast complete-change: */257 emit completeChanged();258 }259 260 void UIWizardNewVMPageBasic4::sltGetWithFileOpenDialog()261 {262 /* Call to base-class: */263 getWithFileOpenDialog();264 }265 100 266 101 void UIWizardNewVMPageBasic4::retranslateUi() 267 102 { 268 /* Translate page: */ 269 setTitle(UIWizardNewVM::tr("Hard disk and Hardware")); 103 setTitle(UIWizardNewVM::tr("Hardware")); 270 104 271 /* Translate widgets: */272 QString strRecommendedHDD = field("type").value<CGuestOSType>().isNull() ? QString() :273 UICommon::formatSize(field("type").value<CGuestOSType>().GetRecommendedHDD());274 105 if (m_pLabel) 275 m_pLabel->setText(UIWizardNewVM::tr("<p>If you wish you can add a virtual hard disk to the new machine. " 276 "You can either create a new hard disk file or select one from the list " 277 "or from another location using the folder icon. " 278 "If you need a more complex storage set-up you can skip this step " 279 "and make the changes to the machine settings once the machine is created. " 280 "The recommended size of the hard disk is <b>%1</b>.") 281 .arg(strRecommendedHDD)); 106 m_pLabel->setText(UIWizardNewVM::tr("<p>You can modify virtual machine's hardware by changing amount of RAM and " 107 "virtual CPU count.</p>")); 108 282 109 retranslateWidgets(); 283 110 } … … 285 112 void UIWizardNewVMPageBasic4::initializePage() 286 113 { 287 /* Translate page: */288 114 retranslateUi(); 289 115 … … 296 122 m_pBaseMemoryEditor->setValue(recommendedRam); 297 123 298 299 /* Prepare initial disk choice: */300 if (type.GetRecommendedHDD() != 0)301 {302 if (m_pDiskCreate)303 {304 m_pDiskCreate->setFocus();305 m_pDiskCreate->setChecked(true);306 }307 m_fRecommendedNoDisk = false;308 }309 else310 {311 if (m_pDiskSkip)312 {313 m_pDiskSkip->setFocus();314 m_pDiskSkip->setChecked(true);315 }316 m_fRecommendedNoDisk = true;317 }318 if (m_pDiskSelector)319 m_pDiskSelector->setCurrentIndex(0);320 124 } 321 125 322 126 void UIWizardNewVMPageBasic4::cleanupPage() 323 127 { 324 /* Call to base-class: */325 ensureNewVirtualDiskDeleted();326 128 UIWizardPage::cleanupPage(); 327 129 } … … 329 131 bool UIWizardNewVMPageBasic4::isComplete() const 330 132 { 331 /* Make sure 'virtualDisk' field feats the rules: */ 332 if (!m_pDiskSkip) 333 return false; 334 return m_pDiskSkip->isChecked() || 335 !m_pDiskPresent->isChecked() || 336 !uiCommon().medium(m_pDiskSelector->id()).isNull(); 133 return true; 337 134 } 338 339 bool UIWizardNewVMPageBasic4::validatePage()340 {341 /* Initial result: */342 bool fResult = true;343 344 /* Ensure unused virtual-disk is deleted: */345 if (m_pDiskSkip->isChecked() || m_pDiskCreate->isChecked() || (!m_virtualDisk.isNull() && m_uVirtualDiskId != m_virtualDisk.GetId()))346 ensureNewVirtualDiskDeleted();347 348 if (m_pDiskSkip->isChecked())349 {350 /* Ask user about disk-less machine unless that's the recommendation: */351 if (!m_fRecommendedNoDisk)352 fResult = msgCenter().confirmHardDisklessMachine(thisImp());353 }354 else if (m_pDiskCreate->isChecked())355 {356 /* Show the New Virtual Hard Drive wizard: */357 fResult = getWithNewVirtualDiskWizard();358 }359 360 if (fResult)361 {362 /* Lock finish button: */363 startProcessing();364 365 /* Try to create VM: */366 fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM();367 368 /* Unlock finish button: */369 endProcessing();370 }371 372 /* Return result: */373 return fResult;374 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.h
r87423 r87430 49 49 UIWizardNewVMPage4(); 50 50 51 /** Handlers. */52 void updateVirtualDiskSource();53 void getWithFileOpenDialog();54 bool getWithNewVirtualDiskWizard();55 56 51 57 52 /** @name Property getters/setters 58 53 * @{ */ 59 CMedium virtualDisk() const { return m_virtualDisk; }60 void setVirtualDisk(const CMedium &virtualDisk) { m_virtualDisk = virtualDisk; }61 QUuid virtualDiskId() const { return m_uVirtualDiskId; }62 void setVirtualDiskId(const QUuid &uVirtualDiskId) { m_uVirtualDiskId = uVirtualDiskId; }63 QString virtualDiskName() const { return m_strVirtualDiskName; }64 void setVirtualDiskName(const QString &strVirtualDiskName) { m_strVirtualDiskName = strVirtualDiskName; }65 QString virtualDiskLocation() const { return m_strVirtualDiskLocation; }66 void setVirtualDiskLocation(const QString &strVirtualDiskLocation) { m_strVirtualDiskLocation = strVirtualDiskLocation; }67 54 int baseMemory() const; 68 55 int VCPUCount() const; 69 56 /** @} */ 70 57 71 QWidget *createDiskWidgets();72 58 QWidget *createHardwareWidgets(); 73 74 /** Helpers. */75 void ensureNewVirtualDiskDeleted();76 59 void retranslateWidgets(); 77 60 78 /** Input. */79 bool m_fRecommendedNoDisk;80 61 81 /** @name Variables82 * @{ */83 CMedium m_virtualDisk;84 QUuid m_uVirtualDiskId;85 QString m_strVirtualDiskName;86 QString m_strVirtualDiskLocation;87 /** @} */88 62 89 63 /** @name Widgets 90 64 * @{ */ 91 QRadioButton *m_pDiskSkip;92 QRadioButton *m_pDiskCreate;93 QRadioButton *m_pDiskPresent;94 UIMediaComboBox *m_pDiskSelector;95 QIToolButton *m_pVMMButton;96 65 UIBaseMemoryEditor *m_pBaseMemoryEditor; 97 66 UIVirtualCPUEditor *m_pVirtualCPUEditor; … … 104 73 { 105 74 Q_OBJECT; 106 Q_PROPERTY(CMedium virtualDisk READ virtualDisk WRITE setVirtualDisk);107 Q_PROPERTY(QUuid virtualDiskId READ virtualDiskId WRITE setVirtualDiskId);108 Q_PROPERTY(QString virtualDiskName READ virtualDiskName WRITE setVirtualDiskName);109 Q_PROPERTY(QString virtualDiskLocation READ virtualDiskLocation WRITE setVirtualDiskLocation);110 75 Q_PROPERTY(int baseMemory READ baseMemory); 111 76 Q_PROPERTY(int VCPUCount READ VCPUCount); … … 127 92 private slots: 128 93 129 /** Handlers. */130 void sltVirtualDiskSourceChanged();131 void sltGetWithFileOpenDialog();132 94 133 95 private: … … 141 103 void cleanupPage(); 142 104 143 /** Validation stuff. */144 105 bool isComplete() const; 145 bool validatePage();146 106 147 107 /** Widgets. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic5.cpp
r87423 r87430 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardNewVMPageBasic 4class implementation.3 * VBox Qt GUI - UIWizardNewVMPageBasic5 class implementation. 4 4 */ 5 5 … … 25 25 #include "QIRichTextLabel.h" 26 26 #include "QIToolButton.h" 27 #include "UIBaseMemoryEditor.h"28 27 #include "UIIconPool.h" 29 28 #include "UIMediaComboBox.h" … … 31 30 #include "UIMediumSelector.h" 32 31 #include "UIMessageCenter.h" 33 #include "UIVirtualCPUEditor.h"34 32 #include "UIWizardNewVD.h" 35 33 #include "UIWizardNewVM.h" 36 #include "UIWizardNewVMPageBasic 4.h"37 38 UIWizardNewVMPage 4::UIWizardNewVMPage4()34 #include "UIWizardNewVMPageBasic5.h" 35 36 UIWizardNewVMPage5::UIWizardNewVMPage5() 39 37 : m_fRecommendedNoDisk(false) 40 38 , m_pDiskSkip(0) … … 43 41 , m_pDiskSelector(0) 44 42 , m_pVMMButton(0) 45 , m_pBaseMemoryEditor(0) 46 , m_pVirtualCPUEditor(0) 47 { 48 } 49 50 void UIWizardNewVMPage4::updateVirtualDiskSource() 43 { 44 } 45 46 void UIWizardNewVMPage5::updateVirtualDiskSource() 51 47 { 52 48 if (!m_pDiskSelector || !m_pVMMButton) … … 72 68 } 73 69 74 void UIWizardNewVMPage 4::getWithFileOpenDialog()70 void UIWizardNewVMPage5::getWithFileOpenDialog() 75 71 { 76 72 /* Get opened medium id: */ … … 95 91 } 96 92 97 bool UIWizardNewVMPage 4::getWithNewVirtualDiskWizard()93 bool UIWizardNewVMPage5::getWithNewVirtualDiskWizard() 98 94 { 99 95 /* Create New Virtual Hard Drive wizard: */ … … 117 113 } 118 114 119 int UIWizardNewVMPage4::baseMemory() const 120 { 121 if (!m_pBaseMemoryEditor) 122 return 0; 123 return m_pBaseMemoryEditor->value(); 124 } 125 126 int UIWizardNewVMPage4::VCPUCount() const 127 { 128 if (!m_pVirtualCPUEditor) 129 return 1; 130 return m_pVirtualCPUEditor->value(); 131 } 132 133 void UIWizardNewVMPage4::ensureNewVirtualDiskDeleted() 115 void UIWizardNewVMPage5::ensureNewVirtualDiskDeleted() 134 116 { 135 117 /* Make sure virtual-disk valid: */ … … 155 137 } 156 138 157 void UIWizardNewVMPage 4::retranslateWidgets()139 void UIWizardNewVMPage5::retranslateWidgets() 158 140 { 159 141 if (m_pDiskSkip) … … 167 149 } 168 150 169 QWidget *UIWizardNewVMPage 4::createDiskWidgets()151 QWidget *UIWizardNewVMPage5::createDiskWidgets() 170 152 { 171 153 QWidget *pDiskContainer = new QWidget; … … 197 179 } 198 180 199 QWidget *UIWizardNewVMPage4::createHardwareWidgets() 200 { 201 QWidget *pHardwareContainer = new QWidget; 202 QGridLayout *pHardwareLayout = new QGridLayout(pHardwareContainer); 203 204 m_pBaseMemoryEditor = new UIBaseMemoryEditor(0, true); 205 m_pVirtualCPUEditor = new UIVirtualCPUEditor(0, true); 206 pHardwareLayout->addWidget(m_pBaseMemoryEditor, 0, 0, 1, 4); 207 pHardwareLayout->addWidget(m_pVirtualCPUEditor, 1, 0, 1, 4); 208 return pHardwareContainer; 209 } 210 211 UIWizardNewVMPageBasic4::UIWizardNewVMPageBasic4() 181 UIWizardNewVMPageBasic5::UIWizardNewVMPageBasic5() 212 182 : m_pLabel(0) 213 183 { … … 218 188 registerField("virtualDiskName", this, "virtualDiskName"); 219 189 registerField("virtualDiskLocation", this, "virtualDiskLocation"); 220 registerField("baseMemory", this, "baseMemory"); 221 registerField("VCPUCount", this, "VCPUCount"); 222 } 223 224 void UIWizardNewVMPageBasic4::prepare() 190 } 191 192 void UIWizardNewVMPageBasic5::prepare() 225 193 { 226 194 QVBoxLayout *pMainLayout = new QVBoxLayout(this); … … 235 203 } 236 204 237 void UIWizardNewVMPageBasic 4::createConnections()205 void UIWizardNewVMPageBasic5::createConnections() 238 206 { 239 207 connect(m_pDiskSkip, &QRadioButton::toggled, 240 this, &UIWizardNewVMPageBasic 4::sltVirtualDiskSourceChanged);208 this, &UIWizardNewVMPageBasic5::sltVirtualDiskSourceChanged); 241 209 connect(m_pDiskCreate, &QRadioButton::toggled, 242 this, &UIWizardNewVMPageBasic 4::sltVirtualDiskSourceChanged);210 this, &UIWizardNewVMPageBasic5::sltVirtualDiskSourceChanged); 243 211 connect(m_pDiskPresent, &QRadioButton::toggled, 244 this, &UIWizardNewVMPageBasic 4::sltVirtualDiskSourceChanged);212 this, &UIWizardNewVMPageBasic5::sltVirtualDiskSourceChanged); 245 213 connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged), 246 this, &UIWizardNewVMPageBasic 4::sltVirtualDiskSourceChanged);214 this, &UIWizardNewVMPageBasic5::sltVirtualDiskSourceChanged); 247 215 connect(m_pVMMButton, &QIToolButton::clicked, 248 this, &UIWizardNewVMPageBasic 4::sltGetWithFileOpenDialog);249 } 250 251 void UIWizardNewVMPageBasic 4::sltVirtualDiskSourceChanged()216 this, &UIWizardNewVMPageBasic5::sltGetWithFileOpenDialog); 217 } 218 219 void UIWizardNewVMPageBasic5::sltVirtualDiskSourceChanged() 252 220 { 253 221 /* Call to base-class: */ … … 258 226 } 259 227 260 void UIWizardNewVMPageBasic 4::sltGetWithFileOpenDialog()228 void UIWizardNewVMPageBasic5::sltGetWithFileOpenDialog() 261 229 { 262 230 /* Call to base-class: */ … … 264 232 } 265 233 266 void UIWizardNewVMPageBasic4::retranslateUi() 267 { 268 /* Translate page: */ 234 void UIWizardNewVMPageBasic5::retranslateUi() 235 { 269 236 setTitle(UIWizardNewVM::tr("Hard disk and Hardware")); 270 237 271 /* Translate widgets: */272 238 QString strRecommendedHDD = field("type").value<CGuestOSType>().isNull() ? QString() : 273 239 UICommon::formatSize(field("type").value<CGuestOSType>().GetRecommendedHDD()); … … 278 244 "If you need a more complex storage set-up you can skip this step " 279 245 "and make the changes to the machine settings once the machine is created. " 280 "The recommended size of the hard disk is <b>%1</b>. ")246 "The recommended size of the hard disk is <b>%1</b>.</p>") 281 247 .arg(strRecommendedHDD)); 248 282 249 retranslateWidgets(); 283 250 } 284 251 285 void UIWizardNewVMPageBasic4::initializePage() 286 { 287 /* Translate page: */ 252 void UIWizardNewVMPageBasic5::initializePage() 253 { 288 254 retranslateUi(); 289 255 … … 292 258 293 259 CGuestOSType type = field("type").value<CGuestOSType>(); 294 ULONG recommendedRam = type.GetRecommendedRAM(); 295 if (m_pBaseMemoryEditor) 296 m_pBaseMemoryEditor->setValue(recommendedRam); 297 298 299 /* Prepare initial disk choice: */ 260 300 261 if (type.GetRecommendedHDD() != 0) 301 262 { … … 320 281 } 321 282 322 void UIWizardNewVMPageBasic 4::cleanupPage()283 void UIWizardNewVMPageBasic5::cleanupPage() 323 284 { 324 285 /* Call to base-class: */ … … 327 288 } 328 289 329 bool UIWizardNewVMPageBasic4::isComplete() const 330 { 331 /* Make sure 'virtualDisk' field feats the rules: */ 290 bool UIWizardNewVMPageBasic5::isComplete() const 291 { 332 292 if (!m_pDiskSkip) 333 293 return false; … … 337 297 } 338 298 339 bool UIWizardNewVMPageBasic 4::validatePage()299 bool UIWizardNewVMPageBasic5::validatePage() 340 300 { 341 301 /* Initial result: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic5.h
r87423 r87430 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIWizardNewVMPageBasic 4class declaration.3 * VBox Qt GUI - UIWizardNewVMPageBasic5 class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic 4_h19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic 4_h18 #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic5_h 19 #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic5_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 36 36 class QIRichTextLabel; 37 37 class QIToolButton; 38 class UIBaseMemoryEditor;39 38 class UIMediaComboBox; 40 class UIVirtualCPUEditor;41 39 42 40 /** 3rd page of the New Virtual Machine wizard (base part). */ 43 class UIWizardNewVMPage 4: public UIWizardPageBase41 class UIWizardNewVMPage5 : public UIWizardPageBase 44 42 { 45 43 … … 47 45 48 46 /** Constructor. */ 49 UIWizardNewVMPage 4();47 UIWizardNewVMPage5(); 50 48 51 49 /** Handlers. */ … … 65 63 QString virtualDiskLocation() const { return m_strVirtualDiskLocation; } 66 64 void setVirtualDiskLocation(const QString &strVirtualDiskLocation) { m_strVirtualDiskLocation = strVirtualDiskLocation; } 67 int baseMemory() const;68 int VCPUCount() const;69 65 /** @} */ 70 66 71 67 QWidget *createDiskWidgets(); 72 QWidget *createHardwareWidgets();73 68 74 69 /** Helpers. */ … … 94 89 UIMediaComboBox *m_pDiskSelector; 95 90 QIToolButton *m_pVMMButton; 96 UIBaseMemoryEditor *m_pBaseMemoryEditor;97 UIVirtualCPUEditor *m_pVirtualCPUEditor;98 91 /** @} */ 99 92 … … 101 94 102 95 /** 3rd page of the New Virtual Machine wizard (basic extension). */ 103 class UIWizardNewVMPageBasic 4 : public UIWizardPage, public UIWizardNewVMPage496 class UIWizardNewVMPageBasic5 : public UIWizardPage, public UIWizardNewVMPage5 104 97 { 105 98 Q_OBJECT; … … 108 101 Q_PROPERTY(QString virtualDiskName READ virtualDiskName WRITE setVirtualDiskName); 109 102 Q_PROPERTY(QString virtualDiskLocation READ virtualDiskLocation WRITE setVirtualDiskLocation); 110 Q_PROPERTY(int baseMemory READ baseMemory);111 Q_PROPERTY(int VCPUCount READ VCPUCount);112 103 113 104 public: 114 105 115 106 /** Constructor. */ 116 UIWizardNewVMPageBasic 4();107 UIWizardNewVMPageBasic5(); 117 108 118 109 protected: … … 149 140 }; 150 141 151 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic 4_h */142 #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasic5_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r87422 r87430 27 27 #include "UIWizardNewVMPageBasic3.h" 28 28 #include "UIWizardNewVMPageBasic4.h" 29 #include "UIWizardNewVMPageBasic5.h" 29 30 30 31 /* Forward declarations: */ … … 37 38 public UIWizardNewVMPage2, 38 39 public UIWizardNewVMPage3, 39 public UIWizardNewVMPage4 40 public UIWizardNewVMPage4, 41 public UIWizardNewVMPage5 40 42 { 41 43
Note:
See TracChangeset
for help on using the changeset viewer.