1 | /* $Id: UIWizardNewVMPageBasic4.cpp 88001 2021-03-08 10:50:59Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIWizardNewVMPageBasic4 class implementation.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2020 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | /* Qt includes: */
|
---|
19 | #include <QButtonGroup>
|
---|
20 | #include <QCheckBox>
|
---|
21 | #include <QGridLayout>
|
---|
22 | #include <QGroupBox>
|
---|
23 | #include <QLabel>
|
---|
24 | #include <QMetaType>
|
---|
25 | #include <QRadioButton>
|
---|
26 | #include <QVBoxLayout>
|
---|
27 |
|
---|
28 | /* GUI includes: */
|
---|
29 | #include "QIRichTextLabel.h"
|
---|
30 | #include "QIToolButton.h"
|
---|
31 | #include "UIIconPool.h"
|
---|
32 | #include "UIMediaComboBox.h"
|
---|
33 | #include "UIMedium.h"
|
---|
34 | #include "UIMediumSelector.h"
|
---|
35 | #include "UIMediumSizeEditor.h"
|
---|
36 | #include "UIMessageCenter.h"
|
---|
37 | #include "UIWizardNewVD.h"
|
---|
38 | #include "UIWizardNewVMPageBasic4.h"
|
---|
39 |
|
---|
40 | /* COM includes: */
|
---|
41 | #include "CGuestOSType.h"
|
---|
42 | #include "CSystemProperties.h"
|
---|
43 |
|
---|
44 | UIWizardNewVMPage4::UIWizardNewVMPage4()
|
---|
45 | : m_fRecommendedNoDisk(false)
|
---|
46 | , m_pDiskEmpty(0)
|
---|
47 | , m_pDiskNew(0)
|
---|
48 | , m_pDiskExisting(0)
|
---|
49 | , m_pDiskSelector(0)
|
---|
50 | , m_pDiskSelectionButton(0)
|
---|
51 | , m_enmSelectedDiskSource(SelectedDiskSource_New)
|
---|
52 | {
|
---|
53 | }
|
---|
54 |
|
---|
55 | SelectedDiskSource UIWizardNewVMPage4::selectedDiskSource() const
|
---|
56 | {
|
---|
57 | return m_enmSelectedDiskSource;
|
---|
58 | }
|
---|
59 |
|
---|
60 | void UIWizardNewVMPage4::setSelectedDiskSource(SelectedDiskSource enmSelectedDiskSource)
|
---|
61 | {
|
---|
62 | m_enmSelectedDiskSource = enmSelectedDiskSource;
|
---|
63 | }
|
---|
64 |
|
---|
65 | void UIWizardNewVMPage4::getWithFileOpenDialog()
|
---|
66 | {
|
---|
67 | /* Get opened medium id: */
|
---|
68 | QUuid uMediumId;
|
---|
69 |
|
---|
70 | int returnCode = uiCommon().openMediumSelectorDialog(thisImp(), UIMediumDeviceType_HardDisk,
|
---|
71 | uMediumId,
|
---|
72 | fieldImp("machineFolder").toString(),
|
---|
73 | fieldImp("machineBaseName").toString(),
|
---|
74 | fieldImp("type").value<CGuestOSType>().GetId(),
|
---|
75 | false /* don't show/enable the create action: */);
|
---|
76 |
|
---|
77 | if (returnCode == static_cast<int>(UIMediumSelector::ReturnCode_Accepted) && !uMediumId.isNull())
|
---|
78 | {
|
---|
79 | m_pDiskSelector->setCurrentItem(uMediumId);
|
---|
80 | m_pDiskSelector->setFocus();
|
---|
81 | }
|
---|
82 | }
|
---|
83 |
|
---|
84 | void UIWizardNewVMPage4::retranslateWidgets()
|
---|
85 | {
|
---|
86 | if (m_pDiskEmpty)
|
---|
87 | m_pDiskEmpty->setText(UIWizardNewVM::tr("&Do not add a virtual hard disk"));
|
---|
88 | if (m_pDiskNew)
|
---|
89 | m_pDiskNew->setText(UIWizardNewVM::tr("&Create a virtual hard disk now"));
|
---|
90 | if (m_pDiskExisting)
|
---|
91 | m_pDiskExisting->setText(UIWizardNewVM::tr("&Use an existing virtual hard disk file"));
|
---|
92 | if (m_pDiskSelectionButton)
|
---|
93 | m_pDiskSelectionButton->setToolTip(UIWizardNewVM::tr("Choose a virtual hard disk file..."));
|
---|
94 | }
|
---|
95 |
|
---|
96 | void UIWizardNewVMPage4::setEnableDiskSelectionWidgets(bool fEnabled)
|
---|
97 | {
|
---|
98 | if (!m_pDiskSelector || !m_pDiskSelectionButton)
|
---|
99 | return;
|
---|
100 |
|
---|
101 | m_pDiskSelector->setEnabled(fEnabled);
|
---|
102 | m_pDiskSelectionButton->setEnabled(fEnabled);
|
---|
103 | }
|
---|
104 |
|
---|
105 | QWidget *UIWizardNewVMPage4::createNewDiskWidgets()
|
---|
106 | {
|
---|
107 | return new QWidget();
|
---|
108 | }
|
---|
109 |
|
---|
110 | QWidget *UIWizardNewVMPage4::createDiskWidgets()
|
---|
111 | {
|
---|
112 | QWidget *pDiskContainer = new QWidget;
|
---|
113 | QGridLayout *pDiskLayout = new QGridLayout(pDiskContainer);
|
---|
114 | m_pDiskSourceButtonGroup = new QButtonGroup;
|
---|
115 | m_pDiskEmpty = new QRadioButton;
|
---|
116 | m_pDiskNew = new QRadioButton;
|
---|
117 | m_pDiskExisting = new QRadioButton;
|
---|
118 | m_pDiskSourceButtonGroup->addButton(m_pDiskEmpty);
|
---|
119 | m_pDiskSourceButtonGroup->addButton(m_pDiskNew);
|
---|
120 | m_pDiskSourceButtonGroup->addButton(m_pDiskExisting);
|
---|
121 | QStyleOptionButton options;
|
---|
122 | options.initFrom(m_pDiskExisting);
|
---|
123 | int iWidth = m_pDiskExisting->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth, &options, m_pDiskExisting);
|
---|
124 | pDiskLayout->setColumnMinimumWidth(0, iWidth);
|
---|
125 | m_pDiskSelector = new UIMediaComboBox;
|
---|
126 | {
|
---|
127 | m_pDiskSelector->setType(UIMediumDeviceType_HardDisk);
|
---|
128 | m_pDiskSelector->repopulate();
|
---|
129 | }
|
---|
130 | m_pDiskSelectionButton = new QIToolButton;
|
---|
131 | {
|
---|
132 | m_pDiskSelectionButton->setAutoRaise(true);
|
---|
133 | m_pDiskSelectionButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", ":/select_file_disabled_16px.png"));
|
---|
134 | }
|
---|
135 | pDiskLayout->addWidget(m_pDiskNew, 0, 0, 1, 6);
|
---|
136 | pDiskLayout->addWidget(createNewDiskWidgets(), 1, 2, 3, 4);
|
---|
137 | pDiskLayout->addWidget(m_pDiskExisting, 4, 0, 1, 6);
|
---|
138 | pDiskLayout->addWidget(m_pDiskSelector, 5, 2, 1, 3);
|
---|
139 | pDiskLayout->addWidget(m_pDiskSelectionButton, 5, 5, 1, 1);
|
---|
140 | pDiskLayout->addWidget(m_pDiskEmpty, 6, 0, 1, 6);
|
---|
141 | return pDiskContainer;
|
---|
142 | }
|
---|
143 |
|
---|
144 | UIWizardNewVMPageBasic4::UIWizardNewVMPageBasic4()
|
---|
145 | : m_pLabel(0)
|
---|
146 | , m_fUserSetSize(false)
|
---|
147 |
|
---|
148 | {
|
---|
149 | prepare();
|
---|
150 | qRegisterMetaType<CMedium>();
|
---|
151 | qRegisterMetaType<SelectedDiskSource>();
|
---|
152 | registerField("selectedDiskSource", this, "selectedDiskSource");
|
---|
153 |
|
---|
154 | registerField("mediumFormat", this, "mediumFormat");
|
---|
155 | registerField("mediumVariant" /* KMediumVariant */, this, "mediumVariant");
|
---|
156 | registerField("mediumPath", this, "mediumPath");
|
---|
157 | registerField("mediumSize", this, "mediumSize");
|
---|
158 |
|
---|
159 | /* We do not have any UI elements for HDD format selection since we default to VDI in case of guided wizard mode: */
|
---|
160 | bool fFoundVDI = false;
|
---|
161 | CSystemProperties properties = uiCommon().virtualBox().GetSystemProperties();
|
---|
162 | const QVector<CMediumFormat> &formats = properties.GetMediumFormats();
|
---|
163 | foreach (const CMediumFormat &format, formats)
|
---|
164 | {
|
---|
165 | if (format.GetName() == "VDI")
|
---|
166 | {
|
---|
167 | m_mediumFormat = format;
|
---|
168 | fFoundVDI = true;
|
---|
169 | }
|
---|
170 | }
|
---|
171 | if (!fFoundVDI)
|
---|
172 | AssertMsgFailed(("No medium format corresponding to VDI could be found!"));
|
---|
173 |
|
---|
174 | m_strDefaultExtension = defaultExtension(m_mediumFormat);
|
---|
175 |
|
---|
176 | /* Since the medium format is static we can decide widget visibility here: */
|
---|
177 | setWidgetVisibility(m_mediumFormat);
|
---|
178 | }
|
---|
179 |
|
---|
180 | CMediumFormat UIWizardNewVMPageBasic4::mediumFormat() const
|
---|
181 | {
|
---|
182 | return m_mediumFormat;
|
---|
183 | }
|
---|
184 |
|
---|
185 | QString UIWizardNewVMPageBasic4::mediumPath() const
|
---|
186 | {
|
---|
187 | return absoluteFilePath(toFileName(m_strDefaultName, m_strDefaultExtension), m_strDefaultPath);
|
---|
188 | }
|
---|
189 |
|
---|
190 | void UIWizardNewVMPageBasic4::prepare()
|
---|
191 | {
|
---|
192 | QVBoxLayout *pMainLayout = new QVBoxLayout(this);
|
---|
193 |
|
---|
194 | m_pLabel = new QIRichTextLabel(this);
|
---|
195 | pMainLayout->addWidget(m_pLabel);
|
---|
196 | pMainLayout->addWidget(createDiskWidgets());
|
---|
197 |
|
---|
198 | pMainLayout->addStretch();
|
---|
199 | setEnableDiskSelectionWidgets(m_enmSelectedDiskSource == SelectedDiskSource_Existing);
|
---|
200 | setEnableNewDiskWidgets(m_enmSelectedDiskSource == SelectedDiskSource_New);
|
---|
201 |
|
---|
202 | createConnections();
|
---|
203 | }
|
---|
204 |
|
---|
205 | QWidget *UIWizardNewVMPageBasic4::createNewDiskWidgets()
|
---|
206 | {
|
---|
207 | QWidget *pWidget = new QWidget;
|
---|
208 | QVBoxLayout *pLayout = new QVBoxLayout(pWidget);
|
---|
209 | pLayout->setContentsMargins(0, 0, 0, 0);
|
---|
210 |
|
---|
211 | QHBoxLayout *pSizeLayout = new QHBoxLayout;
|
---|
212 | pSizeLayout->setContentsMargins(0, 0, 0, 0);
|
---|
213 | /* Hard disk size relate widgets: */
|
---|
214 | m_pSizeEditor = new UIMediumSizeEditor;
|
---|
215 | m_pSizeEditorLabel = new QLabel;
|
---|
216 | if (m_pSizeEditorLabel)
|
---|
217 | {
|
---|
218 | pSizeLayout->addWidget(m_pSizeEditorLabel);
|
---|
219 | m_pSizeEditorLabel->setBuddy(m_pSizeEditor);
|
---|
220 | }
|
---|
221 | pSizeLayout->addWidget(m_pSizeEditor);
|
---|
222 | pLayout->addLayout(pSizeLayout);
|
---|
223 | /* Hard disk variant (dynamic vs. fixed) widgets: */
|
---|
224 | pLayout->addWidget(createMediumVariantWidgets(false /* bool fWithLabels */));
|
---|
225 |
|
---|
226 | return pWidget;
|
---|
227 | }
|
---|
228 |
|
---|
229 | void UIWizardNewVMPageBasic4::createConnections()
|
---|
230 | {
|
---|
231 | if (m_pDiskSourceButtonGroup)
|
---|
232 | connect(m_pDiskSourceButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked),
|
---|
233 | this, &UIWizardNewVMPageBasic4::sltSelectedDiskSourceChanged);
|
---|
234 | if (m_pDiskSelector)
|
---|
235 | connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged),
|
---|
236 | this, &UIWizardNewVMPageBasic4::sltMediaComboBoxIndexChanged);
|
---|
237 | if (m_pDiskSelectionButton)
|
---|
238 | connect(m_pDiskSelectionButton, &QIToolButton::clicked,
|
---|
239 | this, &UIWizardNewVMPageBasic4::sltGetWithFileOpenDialog);
|
---|
240 | if (m_pSizeEditor)
|
---|
241 | {
|
---|
242 | connect(m_pSizeEditor, &UIMediumSizeEditor::sigSizeChanged,
|
---|
243 | this, &UIWizardNewVMPageBasic4::completeChanged);
|
---|
244 | connect(m_pSizeEditor, &UIMediumSizeEditor::sigSizeChanged,
|
---|
245 | this, &UIWizardNewVMPageBasic4::sltHandleSizeEditorChange);
|
---|
246 | }
|
---|
247 | }
|
---|
248 |
|
---|
249 | void UIWizardNewVMPageBasic4::sltSelectedDiskSourceChanged()
|
---|
250 | {
|
---|
251 | if (!m_pDiskSourceButtonGroup)
|
---|
252 | return;
|
---|
253 |
|
---|
254 | if (m_pDiskSourceButtonGroup->checkedButton() == m_pDiskEmpty)
|
---|
255 | setSelectedDiskSource(SelectedDiskSource_Empty);
|
---|
256 | else if (m_pDiskSourceButtonGroup->checkedButton() == m_pDiskExisting)
|
---|
257 | {
|
---|
258 | setSelectedDiskSource(SelectedDiskSource_Existing);
|
---|
259 | setVirtualDiskFromDiskCombo();
|
---|
260 | }
|
---|
261 | else
|
---|
262 | setSelectedDiskSource(SelectedDiskSource_New);
|
---|
263 |
|
---|
264 | setEnableDiskSelectionWidgets(m_enmSelectedDiskSource == SelectedDiskSource_Existing);
|
---|
265 | setEnableNewDiskWidgets(m_enmSelectedDiskSource == SelectedDiskSource_New);
|
---|
266 |
|
---|
267 | completeChanged();
|
---|
268 | }
|
---|
269 |
|
---|
270 | void UIWizardNewVMPageBasic4::sltMediaComboBoxIndexChanged()
|
---|
271 | {
|
---|
272 | /* Make sure to set m_virtualDisk: */
|
---|
273 | setVirtualDiskFromDiskCombo();
|
---|
274 | emit completeChanged();
|
---|
275 | }
|
---|
276 |
|
---|
277 | void UIWizardNewVMPageBasic4::sltGetWithFileOpenDialog()
|
---|
278 | {
|
---|
279 | /* Call to base-class: */
|
---|
280 | getWithFileOpenDialog();
|
---|
281 | }
|
---|
282 |
|
---|
283 | void UIWizardNewVMPageBasic4::retranslateUi()
|
---|
284 | {
|
---|
285 | setTitle(UIWizardNewVM::tr("Virtual Hard disk"));
|
---|
286 |
|
---|
287 | QString strRecommendedHDD = field("type").value<CGuestOSType>().isNull() ? QString() :
|
---|
288 | UICommon::formatSize(field("type").value<CGuestOSType>().GetRecommendedHDD());
|
---|
289 | if (m_pLabel)
|
---|
290 | m_pLabel->setText(UIWizardNewVM::tr("<p>If you wish you can add a virtual hard disk to the new machine. "
|
---|
291 | "You can either create a new hard disk file or select an existing one. "
|
---|
292 | "Alternatively you can create a virtual machine without a virtual hard disk.</p>"));
|
---|
293 |
|
---|
294 | UIWizardNewVMPage4::retranslateWidgets();
|
---|
295 | UIWizardNewVDPage1::retranslateWidgets();
|
---|
296 | UIWizardNewVDPage2::retranslateWidgets();
|
---|
297 | UIWizardNewVDPage3::retranslateWidgets();
|
---|
298 | }
|
---|
299 |
|
---|
300 | void UIWizardNewVMPageBasic4::initializePage()
|
---|
301 | {
|
---|
302 | retranslateUi();
|
---|
303 |
|
---|
304 | if (!field("type").canConvert<CGuestOSType>())
|
---|
305 | return;
|
---|
306 |
|
---|
307 | CGuestOSType type = field("type").value<CGuestOSType>();
|
---|
308 |
|
---|
309 | if (type.GetRecommendedHDD() != 0)
|
---|
310 | {
|
---|
311 | if (m_pDiskNew)
|
---|
312 | {
|
---|
313 | m_pDiskNew->setFocus();
|
---|
314 | m_pDiskNew->setChecked(true);
|
---|
315 | }
|
---|
316 | m_fRecommendedNoDisk = false;
|
---|
317 | }
|
---|
318 | else
|
---|
319 | {
|
---|
320 | if (m_pDiskEmpty)
|
---|
321 | {
|
---|
322 | m_pDiskEmpty->setFocus();
|
---|
323 | m_pDiskEmpty->setChecked(true);
|
---|
324 | }
|
---|
325 | m_fRecommendedNoDisk = true;
|
---|
326 | }
|
---|
327 | if (m_pDiskSelector)
|
---|
328 | m_pDiskSelector->setCurrentIndex(0);
|
---|
329 |
|
---|
330 | /* We set the medium name and path according to machine name/path and do let user change these in the guided mode: */
|
---|
331 | QString strDefaultName = fieldImp("machineBaseName").toString();
|
---|
332 | m_strDefaultName = strDefaultName.isEmpty() ? QString("NewVirtualDisk1") : strDefaultName;
|
---|
333 | m_strDefaultPath = fieldImp("machineFolder").toString();
|
---|
334 | /* Set the recommended disk size if user has already not done so: */
|
---|
335 | if (m_pSizeEditor && !m_fUserSetSize)
|
---|
336 | {
|
---|
337 | m_pSizeEditor->blockSignals(true);
|
---|
338 | setMediumSize(fieldImp("type").value<CGuestOSType>().GetRecommendedHDD());
|
---|
339 | m_pSizeEditor->blockSignals(false);
|
---|
340 | }
|
---|
341 | }
|
---|
342 |
|
---|
343 | void UIWizardNewVMPageBasic4::cleanupPage()
|
---|
344 | {
|
---|
345 | UIWizardPage::cleanupPage();
|
---|
346 | }
|
---|
347 |
|
---|
348 | bool UIWizardNewVMPageBasic4::isComplete() const
|
---|
349 | {
|
---|
350 | if (selectedDiskSource() == SelectedDiskSource_New)
|
---|
351 | return mediumSize() >= m_uMediumSizeMin && mediumSize() <= m_uMediumSizeMax;
|
---|
352 | UIWizardNewVM *pWizard = wizardImp();
|
---|
353 | AssertReturn(pWizard, false);
|
---|
354 | if (selectedDiskSource() == SelectedDiskSource_Existing)
|
---|
355 | return !pWizard->virtualDisk().isNull();
|
---|
356 |
|
---|
357 | return true;
|
---|
358 | }
|
---|
359 |
|
---|
360 | bool UIWizardNewVMPageBasic4::validatePage()
|
---|
361 | {
|
---|
362 | bool fResult = true;
|
---|
363 |
|
---|
364 | /* Make sure user really intents to creae a vm with no hard drive: */
|
---|
365 | if (selectedDiskSource() == SelectedDiskSource_Empty)
|
---|
366 | {
|
---|
367 | /* Ask user about disk-less machine unless that's the recommendation: */
|
---|
368 | if (!m_fRecommendedNoDisk)
|
---|
369 | {
|
---|
370 | if (!msgCenter().confirmHardDisklessMachine(thisImp()))
|
---|
371 | return false;
|
---|
372 | }
|
---|
373 | }
|
---|
374 | else if (selectedDiskSource() == SelectedDiskSource_New)
|
---|
375 | {
|
---|
376 | /* Check if the path we will be using for hard drive creation exists: */
|
---|
377 | const QString strMediumPath(fieldImp("mediumPath").toString());
|
---|
378 | fResult = !QFileInfo(strMediumPath).exists();
|
---|
379 | if (!fResult)
|
---|
380 | {
|
---|
381 | msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this);
|
---|
382 | return fResult;
|
---|
383 | }
|
---|
384 | /* Check FAT size limitation of the host hard drive: */
|
---|
385 | fResult = UIWizardNewVDPage3::checkFATSizeLimitation(fieldImp("mediumVariant").toULongLong(),
|
---|
386 | fieldImp("mediumPath").toString(),
|
---|
387 | fieldImp("mediumSize").toULongLong());
|
---|
388 | if (!fResult)
|
---|
389 | {
|
---|
390 | msgCenter().cannotCreateHardDiskStorageInFAT(strMediumPath, this);
|
---|
391 | return fResult;
|
---|
392 | }
|
---|
393 | }
|
---|
394 |
|
---|
395 | startProcessing();
|
---|
396 | UIWizardNewVM *pWizard = wizardImp();
|
---|
397 | if (pWizard)
|
---|
398 | {
|
---|
399 | if (selectedDiskSource() == SelectedDiskSource_New)
|
---|
400 | {
|
---|
401 | /* Try to create the hard drive:*/
|
---|
402 | fResult = pWizard->createVirtualDisk();
|
---|
403 | /*Don't show any error message here since UIWizardNewVM::createVirtualDisk already does so: */
|
---|
404 | if (!fResult)
|
---|
405 | return fResult;
|
---|
406 | }
|
---|
407 |
|
---|
408 | fResult = pWizard->createVM();
|
---|
409 | /* Try to delete the hard disk: */
|
---|
410 | if (!fResult)
|
---|
411 | pWizard->deleteVirtualDisk();
|
---|
412 | }
|
---|
413 | endProcessing();
|
---|
414 |
|
---|
415 | return fResult;
|
---|
416 | }
|
---|
417 |
|
---|
418 | void UIWizardNewVMPageBasic4::sltHandleSizeEditorChange()
|
---|
419 | {
|
---|
420 | m_fUserSetSize = true;
|
---|
421 | }
|
---|
422 |
|
---|
423 | void UIWizardNewVMPageBasic4::setEnableNewDiskWidgets(bool fEnable)
|
---|
424 | {
|
---|
425 | if (m_pSizeEditor)
|
---|
426 | m_pSizeEditor->setEnabled(fEnable);
|
---|
427 | if (m_pSizeEditorLabel)
|
---|
428 | m_pSizeEditorLabel->setEnabled(fEnable);
|
---|
429 | if (m_pFixedCheckBox)
|
---|
430 | m_pFixedCheckBox->setEnabled(fEnable);
|
---|
431 | }
|
---|
432 |
|
---|
433 | void UIWizardNewVMPageBasic4::setVirtualDiskFromDiskCombo()
|
---|
434 | {
|
---|
435 | QUuid currentId;
|
---|
436 | UIWizardNewVM *pWizard = wizardImp();
|
---|
437 | AssertReturnVoid(pWizard);
|
---|
438 | if (!pWizard->virtualDisk().isNull())
|
---|
439 | currentId = pWizard->virtualDisk().GetId();
|
---|
440 | QUuid id = m_pDiskSelector->id();
|
---|
441 | /* Do nothing else if m_virtualMedium is already set to what combobox has: */
|
---|
442 | if (id == currentId)
|
---|
443 | return;
|
---|
444 | if (m_pDiskSelector)
|
---|
445 | {
|
---|
446 | CMedium medium = uiCommon().medium(id).medium();
|
---|
447 | if (!medium.isNull())
|
---|
448 | pWizard->setVirtualDisk(medium);
|
---|
449 | }
|
---|
450 | }
|
---|