VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp@ 72186

Last change on this file since 72186 was 72186, checked in by vboxsync, 7 years ago

FE/Qt bugref:6769 Some code cleanup

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 19.4 KB
Line 
1/* $Id: UIWizardNewVMPageBasic1.cpp 72186 2018-05-10 07:36:50Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIWizardNewVMPageBasic1 class implementation.
4 */
5
6/*
7 * Copyright (C) 2006-2017 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#ifdef VBOX_WITH_PRECOMPILED_HEADERS
19# include <precomp.h>
20#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
21
22/* Qt includes: */
23# include <QDir>
24# include <QLineEdit>
25# include <QHBoxLayout>
26# include <QVBoxLayout>
27
28/* GUI includes: */
29# include "QIRichTextLabel.h"
30# include "VBoxGlobal.h"
31# include "UIMessageCenter.h"
32# include "UINameAndSystemEditor.h"
33# include "UIWizardNewVMPageBasic1.h"
34# include "UIWizardNewVM.h"
35
36/* COM includes: */
37# include "CHost.h"
38# include "CSystemProperties.h"
39
40#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
41
42
43/* Defines some patterns to guess the right OS type. Should be in sync with
44 * VirtualBox-settings-common.xsd in Main. The list is sorted by priority. The
45 * first matching string found, will be used. */
46struct osTypePattern
47{
48 QRegExp pattern;
49 const char *pcstId;
50};
51
52static const osTypePattern gs_OSTypePattern[] =
53{
54 /* DOS: */
55 { QRegExp("DOS", Qt::CaseInsensitive), "DOS" },
56
57 /* Windows: */
58 { QRegExp( "Wi.*98", Qt::CaseInsensitive), "Windows98" },
59 { QRegExp( "Wi.*95", Qt::CaseInsensitive), "Windows95" },
60 { QRegExp( "Wi.*Me", Qt::CaseInsensitive), "WindowsMe" },
61 { QRegExp( "(Wi.*NT)|(NT[-._v]*4)", Qt::CaseInsensitive), "WindowsNT4" },
62 { QRegExp( "NT[-._v]*3[.,]*[51x]", Qt::CaseInsensitive), "WindowsNT3x" },
63 /* Note: Do not automatically set WindowsXP_64 on 64-bit hosts, as Windows XP 64-bit
64 * is extremely rare -- most users never heard of it even. So always default to 32-bit. */
65 { QRegExp("((Wi.*XP)|(XP)).*", Qt::CaseInsensitive), "WindowsXP" },
66 { QRegExp("((Wi.*2003)|(W2K3)|(Win2K3)).*64", Qt::CaseInsensitive), "Windows2003_64" },
67 { QRegExp("((Wi.*2003)|(W2K3)|(Win2K3)).*32", Qt::CaseInsensitive), "Windows2003" },
68 { QRegExp("((Wi.*Vis)|(Vista)).*64", Qt::CaseInsensitive), "WindowsVista_64" },
69 { QRegExp("((Wi.*Vis)|(Vista)).*32", Qt::CaseInsensitive), "WindowsVista" },
70 { QRegExp( "(Wi.*2016)|(W2K16)|(Win2K16)", Qt::CaseInsensitive), "Windows2016_64" },
71 { QRegExp( "(Wi.*2012)|(W2K12)|(Win2K12)", Qt::CaseInsensitive), "Windows2012_64" },
72 { QRegExp("((Wi.*2008)|(W2K8)|(Win2k8)).*64", Qt::CaseInsensitive), "Windows2008_64" },
73 { QRegExp("((Wi.*2008)|(W2K8)|(Win2K8)).*32", Qt::CaseInsensitive), "Windows2008" },
74 { QRegExp( "(Wi.*2000)|(W2K)|(Win2K)", Qt::CaseInsensitive), "Windows2000" },
75 { QRegExp( "(Wi.*7.*64)|(W7.*64)", Qt::CaseInsensitive), "Windows7_64" },
76 { QRegExp( "(Wi.*7.*32)|(W7.*32)", Qt::CaseInsensitive), "Windows7" },
77 { QRegExp( "(Wi.*8.*1.*64)|(W8.*64)", Qt::CaseInsensitive), "Windows81_64" },
78 { QRegExp( "(Wi.*8.*1.*32)|(W8.*32)", Qt::CaseInsensitive), "Windows81" },
79 { QRegExp( "(Wi.*8.*64)|(W8.*64)", Qt::CaseInsensitive), "Windows8_64" },
80 { QRegExp( "(Wi.*8.*32)|(W8.*32)", Qt::CaseInsensitive), "Windows8" },
81 { QRegExp( "(Wi.*10.*64)|(W10.*64)", Qt::CaseInsensitive), "Windows10_64" },
82 { QRegExp( "(Wi.*10.*32)|(W10.*32)", Qt::CaseInsensitive), "Windows10" },
83 { QRegExp( "Wi.*3.*1", Qt::CaseInsensitive), "Windows31" },
84 /* Set Windows 7 as default for "Windows". */
85 { QRegExp( "Wi.*64", Qt::CaseInsensitive), "Windows7_64" },
86 { QRegExp( "Wi.*32", Qt::CaseInsensitive), "Windows7" },
87
88 /* Solaris: */
89 { QRegExp("Sol.*11", Qt::CaseInsensitive), "Solaris11_64" },
90 { QRegExp("((Op.*Sol)|(os20[01][0-9])|(Sol.*10)|(India)|(Neva)).*64", Qt::CaseInsensitive), "OpenSolaris_64" },
91 { QRegExp("((Op.*Sol)|(os20[01][0-9])|(Sol.*10)|(India)|(Neva)).*32", Qt::CaseInsensitive), "OpenSolaris" },
92 { QRegExp("Sol.*64", Qt::CaseInsensitive), "Solaris_64" },
93 { QRegExp("Sol.*32", Qt::CaseInsensitive), "Solaris" },
94
95 /* OS/2: */
96 { QRegExp( "OS[/|!-]{,1}2.*W.*4.?5", Qt::CaseInsensitive), "OS2Warp45" },
97 { QRegExp( "OS[/|!-]{,1}2.*W.*4", Qt::CaseInsensitive), "OS2Warp4" },
98 { QRegExp( "OS[/|!-]{,1}2.*W", Qt::CaseInsensitive), "OS2Warp3" },
99 { QRegExp("(OS[/|!-]{,1}2.*e)|(eCS.*)", Qt::CaseInsensitive), "OS2eCS" },
100 { QRegExp( "OS[/|!-]{,1}2", Qt::CaseInsensitive), "OS2" },
101 { QRegExp( "eComS.*", Qt::CaseInsensitive), "OS2eCS" },
102
103 /* Other: Must come before Ubuntu/Maverick and before Linux??? */
104 { QRegExp("QN", Qt::CaseInsensitive), "QNX" },
105
106 /* Mac OS X: Must come before Ubuntu/Maverick and before Linux: */
107 { QRegExp("((mac.*10[.,]{0,1}4)|(os.*x.*10[.,]{0,1}4)|(mac.*ti)|(os.*x.*ti)|(Tig)).64", Qt::CaseInsensitive), "MacOS_64" },
108 { QRegExp("((mac.*10[.,]{0,1}4)|(os.*x.*10[.,]{0,1}4)|(mac.*ti)|(os.*x.*ti)|(Tig)).32", Qt::CaseInsensitive), "MacOS" },
109 { QRegExp("((mac.*10[.,]{0,1}5)|(os.*x.*10[.,]{0,1}5)|(mac.*leo)|(os.*x.*leo)|(Leop)).*64", Qt::CaseInsensitive), "MacOS_64" },
110 { QRegExp("((mac.*10[.,]{0,1}5)|(os.*x.*10[.,]{0,1}5)|(mac.*leo)|(os.*x.*leo)|(Leop)).*32", Qt::CaseInsensitive), "MacOS" },
111 { QRegExp("((mac.*10[.,]{0,1}6)|(os.*x.*10[.,]{0,1}6)|(mac.*SL)|(os.*x.*SL)|(Snow L)).*64", Qt::CaseInsensitive), "MacOS106_64" },
112 { QRegExp("((mac.*10[.,]{0,1}6)|(os.*x.*10[.,]{0,1}6)|(mac.*SL)|(os.*x.*SL)|(Snow L)).*32", Qt::CaseInsensitive), "MacOS106" },
113 { QRegExp( "(mac.*10[.,]{0,1}7)|(os.*x.*10[.,]{0,1}7)|(mac.*ML)|(os.*x.*ML)|(Mount)", Qt::CaseInsensitive), "MacOS108_64" },
114 { QRegExp( "(mac.*10[.,]{0,1}8)|(os.*x.*10[.,]{0,1}8)|(Lion)", Qt::CaseInsensitive), "MacOS107_64" },
115 { QRegExp( "(mac.*10[.,]{0,1}9)|(os.*x.*10[.,]{0,1}9)|(mac.*mav)|(os.*x.*mav)|(Mavericks)", Qt::CaseInsensitive), "MacOS109_64" },
116 { QRegExp( "(mac.*yos)|(os.*x.*yos)|(Yosemite)", Qt::CaseInsensitive), "MacOS1010_64" },
117 { QRegExp( "(mac.*cap)|(os.*x.*capit)|(Capitan)", Qt::CaseInsensitive), "MacOS1011_64" },
118 { QRegExp( "(mac.*hig)|(os.*x.*high.*sierr)|(High Sierra)", Qt::CaseInsensitive), "MacOS1013_64" },
119 { QRegExp( "(mac.*sie)|(os.*x.*sierr)|(Sierra)", Qt::CaseInsensitive), "MacOS1012_64" },
120 { QRegExp("((Mac)|(Tig)|(Leop)|(Yose)|(os[ ]*x)).*64", Qt::CaseInsensitive), "MacOS_64" },
121 { QRegExp("((Mac)|(Tig)|(Leop)|(Yose)|(os[ ]*x)).*32", Qt::CaseInsensitive), "MacOS" },
122
123 /* Code names for Linux distributions: */
124 { QRegExp("((bianca)|(cassandra)|(celena)|(daryna)|(elyssa)|(felicia)|(gloria)|(helena)|(isadora)|(julia)|(katya)|(lisa)|(maya)|(nadia)|(olivia)|(petra)|(qiana)|(rebecca)|(rafaela)|(rosa)).*64", Qt::CaseInsensitive), "Ubuntu_64" },
125 { QRegExp("((bianca)|(cassandra)|(celena)|(daryna)|(elyssa)|(felicia)|(gloria)|(helena)|(isadora)|(julia)|(katya)|(lisa)|(maya)|(nadia)|(olivia)|(petra)|(qiana)|(rebecca)|(rafaela)|(rosa)).*32", Qt::CaseInsensitive), "Ubuntu" },
126 { QRegExp("((edgy)|(feisty)|(gutsy)|(hardy)|(intrepid)|(jaunty)|(karmic)|(lucid)|(maverick)|(natty)|(oneiric)|(precise)|(quantal)|(raring)|(saucy)|(trusty)|(utopic)|(vivid)|(wily)|(xenial)|(yakkety)|(zesty)).*64", Qt::CaseInsensitive), "Ubuntu_64" },
127 { QRegExp("((edgy)|(feisty)|(gutsy)|(hardy)|(intrepid)|(jaunty)|(karmic)|(lucid)|(maverick)|(natty)|(oneiric)|(precise)|(quantal)|(raring)|(saucy)|(trusty)|(utopic)|(vivid)|(wily)|(xenial)|(yakkety)|(zesty)).*32", Qt::CaseInsensitive), "Ubuntu" },
128 { QRegExp("((sarge)|(etch)|(lenny)|(squeeze)|(wheezy)|(jessie)|(stretch)|(buster)|(sid)).*64", Qt::CaseInsensitive), "Debian_64" },
129 { QRegExp("((sarge)|(etch)|(lenny)|(squeeze)|(wheezy)|(jessie)|(stretch)|(buster)|(sid)).*32", Qt::CaseInsensitive), "Debian" },
130 { QRegExp("((moonshine)|(werewolf)|(sulphur)|(cambridge)|(leonidas)|(constantine)|(goddard)|(laughlin)|(lovelock)|(verne)|(beefy)|(spherical)).*64", Qt::CaseInsensitive), "Fedora_64" },
131 { QRegExp("((moonshine)|(werewolf)|(sulphur)|(cambridge)|(leonidas)|(constantine)|(goddard)|(laughlin)|(lovelock)|(verne)|(beefy)|(spherical)).*32", Qt::CaseInsensitive), "Fedora" },
132
133 /* Regular names of Linux distributions: */
134 { QRegExp("Arc.*64", Qt::CaseInsensitive), "ArchLinux_64" },
135 { QRegExp("Arc.*32", Qt::CaseInsensitive), "ArchLinux" },
136 { QRegExp("Deb.*64", Qt::CaseInsensitive), "Debian_64" },
137 { QRegExp("Deb.*32", Qt::CaseInsensitive), "Debian" },
138 { QRegExp("((SU)|(Nov)|(SLE)).*64", Qt::CaseInsensitive), "OpenSUSE_64" },
139 { QRegExp("((SU)|(Nov)|(SLE)).*32", Qt::CaseInsensitive), "OpenSUSE" },
140 { QRegExp("Fe.*64", Qt::CaseInsensitive), "Fedora_64" },
141 { QRegExp("Fe.*32", Qt::CaseInsensitive), "Fedora" },
142 { QRegExp("((Gen)|(Sab)).*64", Qt::CaseInsensitive), "Gentoo_64" },
143 { QRegExp("((Gen)|(Sab)).*32", Qt::CaseInsensitive), "Gentoo" },
144 { QRegExp("((Man)|(Mag)).*64", Qt::CaseInsensitive), "Mandriva_64" },
145 { QRegExp("((Man)|(Mag)).*32", Qt::CaseInsensitive), "Mandriva" },
146 { QRegExp("((Red)|(rhel)|(cen)).*64", Qt::CaseInsensitive), "RedHat_64" },
147 { QRegExp("((Red)|(rhel)|(cen)).*32", Qt::CaseInsensitive), "RedHat" },
148 { QRegExp("Tur.*64", Qt::CaseInsensitive), "Turbolinux_64" },
149 { QRegExp("Tur.*32", Qt::CaseInsensitive), "Turbolinux" },
150 { QRegExp("(Ub)|(Min).*64", Qt::CaseInsensitive), "Ubuntu_64" },
151 { QRegExp("(Ub)|(Min).*32", Qt::CaseInsensitive), "Ubuntu" },
152 { QRegExp("Xa.*64", Qt::CaseInsensitive), "Xandros_64" },
153 { QRegExp("Xa.*32", Qt::CaseInsensitive), "Xandros" },
154 { QRegExp("((Or)|(oel)|(ol)).*64", Qt::CaseInsensitive), "Oracle_64" },
155 { QRegExp("((Or)|(oel)|(ol)).*32", Qt::CaseInsensitive), "Oracle" },
156 { QRegExp("Knoppix", Qt::CaseInsensitive), "Linux26" },
157 { QRegExp("Dsl", Qt::CaseInsensitive), "Linux24" },
158 { QRegExp("((Lin)|(lnx)).*2.?2", Qt::CaseInsensitive), "Linux22" },
159 { QRegExp("((Lin)|(lnx)).*2.?4.*64", Qt::CaseInsensitive), "Linux24_64" },
160 { QRegExp("((Lin)|(lnx)).*2.?4.*32", Qt::CaseInsensitive), "Linux24" },
161 { QRegExp("((((Lin)|(lnx)).*2.?6)|(LFS)).*64", Qt::CaseInsensitive), "Linux26_64" },
162 { QRegExp("((((Lin)|(lnx)).*2.?6)|(LFS)).*32", Qt::CaseInsensitive), "Linux26" },
163 { QRegExp("((Lin)|(lnx)).*64", Qt::CaseInsensitive), "Linux26_64" },
164 { QRegExp("((Lin)|(lnx)).*32", Qt::CaseInsensitive), "Linux26" },
165
166 /* Other: */
167 { QRegExp("L4", Qt::CaseInsensitive), "L4" },
168 { QRegExp("((Fr.*B)|(fbsd)).*64", Qt::CaseInsensitive), "FreeBSD_64" },
169 { QRegExp("((Fr.*B)|(fbsd)).*32", Qt::CaseInsensitive), "FreeBSD" },
170 { QRegExp("Op.*B.*64", Qt::CaseInsensitive), "OpenBSD_64" },
171 { QRegExp("Op.*B.*32", Qt::CaseInsensitive), "OpenBSD" },
172 { QRegExp("Ne.*B.*64", Qt::CaseInsensitive), "NetBSD_64" },
173 { QRegExp("Ne.*B.*32", Qt::CaseInsensitive), "NetBSD" },
174 { QRegExp("Net", Qt::CaseInsensitive), "Netware" },
175 { QRegExp("Rocki", Qt::CaseInsensitive), "JRockitVE" },
176 { QRegExp("bs[23]{0,1}-", Qt::CaseInsensitive), "VBoxBS_64" }, /* bootsector tests */
177 { QRegExp("Ot", Qt::CaseInsensitive), "Other" },
178};
179
180UIWizardNewVMPage1::UIWizardNewVMPage1(const QString &strGroup)
181 : m_pNameAndSystemEditor(0)
182 , m_strGroup(strGroup)
183
184{
185 CHost host = vboxGlobal().host();
186 m_fSupportsHWVirtEx = host.GetProcessorFeature(KProcessorFeature_HWVirtEx);
187 m_fSupportsLongMode = host.GetProcessorFeature(KProcessorFeature_LongMode);
188}
189
190void UIWizardNewVMPage1::onNameChanged(QString strNewName)
191{
192 /* Do not forget about achitecture bits, if not yet specified: */
193 if (!strNewName.contains("32") && !strNewName.contains("64"))
194 strNewName += ARCH_BITS == 64 && m_fSupportsHWVirtEx && m_fSupportsLongMode ? "64" : "32";
195
196 /* Search for a matching OS type based on the string the user typed already. */
197 for (size_t i = 0; i < RT_ELEMENTS(gs_OSTypePattern); ++i)
198 if (strNewName.contains(gs_OSTypePattern[i].pattern))
199 {
200 if (m_pNameAndSystemEditor)
201 {
202 m_pNameAndSystemEditor->blockSignals(true);
203 m_pNameAndSystemEditor->setType(vboxGlobal().vmGuestOSType(gs_OSTypePattern[i].pcstId));
204 m_pNameAndSystemEditor->blockSignals(false);
205 }
206 break;
207 }
208}
209
210void UIWizardNewVMPage1::onOsTypeChanged()
211{
212 /* If the user manually edited the OS type, we didn't want our automatic OS type guessing anymore.
213 * So simply disconnect the text-edit signal. */
214 if (m_pNameAndSystemEditor)
215 m_pNameAndSystemEditor->disconnect(SIGNAL(sigNameChanged(const QString &)), thisImp(), SLOT(sltNameChanged(const QString &)));
216}
217
218void UIWizardNewVMPage1::composeMachineFilePath()
219{
220 if (!m_pNameAndSystemEditor)
221 return;
222 if (m_pNameAndSystemEditor->name().isEmpty() || m_pNameAndSystemEditor->path().isEmpty())
223 return;
224 /* Get VBox: */
225 CVirtualBox vbox = vboxGlobal().virtualBox();
226
227 /* Compose machine filename: */
228 m_strMachineFilePath = vbox.ComposeMachineFilename(m_pNameAndSystemEditor->name(),
229 m_strGroup,
230 QString(),
231 m_pNameAndSystemEditor->path());
232 /* Compose machine folder/basename: */
233 const QFileInfo fileInfo(m_strMachineFilePath);
234 m_strMachineFolder = fileInfo.absolutePath();
235 m_strMachineBaseName = fileInfo.completeBaseName();
236
237 if (m_pNameAndSystemEditor)
238 m_pNameAndSystemEditor->setMachineFilePath(m_strMachineFolder);
239}
240
241bool UIWizardNewVMPage1::createMachineFolder()
242{
243 if (!m_pNameAndSystemEditor)
244 return false;
245 /* Cleanup previosly created folder if any: */
246 if (!cleanupMachineFolder())
247 {
248 msgCenter().cannotRemoveMachineFolder(m_strMachineFolder, thisImp());
249 return false;
250 }
251
252 composeMachineFilePath();
253
254 /* Make sure that folder doesn't exists: */
255 if (QDir(m_strMachineFolder).exists())
256 {
257 msgCenter().cannotRewriteMachineFolder(m_strMachineFolder, thisImp());
258 return false;
259 }
260
261 /* Try to create new folder (and it's predecessors): */
262 bool fMachineFolderCreated = QDir().mkpath(m_strMachineFolder);
263 if (!fMachineFolderCreated)
264 {
265 msgCenter().cannotCreateMachineFolder(m_strMachineFolder, thisImp());
266 return false;
267 }
268 m_strCreatedFolder = m_strMachineFolder;
269 return true;
270}
271
272bool UIWizardNewVMPage1::cleanupMachineFolder()
273{
274 /* Make sure folder was previosly created: */
275 if (!m_strCreatedFolder.isEmpty() && m_strCreatedFolder != m_strMachineFolder)
276 {
277 /* Try to cleanup folder (and it's predecessors): */
278 bool fMachineFolderRemoved = QDir().rmpath(m_strCreatedFolder);
279 /* Reset machine folder value: */
280 if (fMachineFolderRemoved)
281 m_strCreatedFolder = QString();
282 /* Return cleanup result: */
283 return fMachineFolderRemoved;
284 }
285 return true;
286}
287
288QString UIWizardNewVMPage1::machineFilePath() const
289{
290 return m_strMachineFilePath;
291}
292
293void UIWizardNewVMPage1::setMachineFilePath(const QString &strMachineFilePath)
294{
295 m_strMachineFilePath = strMachineFilePath;
296}
297
298QString UIWizardNewVMPage1::machineFolder() const
299{
300 return m_strMachineFolder;
301}
302
303void UIWizardNewVMPage1::setMachineFolder(const QString &strMachineFolder)
304{
305 m_strMachineFolder = strMachineFolder;
306}
307
308QString UIWizardNewVMPage1::machineBaseName() const
309{
310 return m_strMachineBaseName;
311}
312
313void UIWizardNewVMPage1::setMachineBaseName(const QString &strMachineBaseName)
314{
315 m_strMachineBaseName = strMachineBaseName;
316}
317
318UIWizardNewVMPageBasic1::UIWizardNewVMPageBasic1(const QString &strGroup)
319 : UIWizardNewVMPage1(strGroup)
320{
321 /* Create widgets: */
322 QVBoxLayout *pMainLayout = new QVBoxLayout(this);
323 {
324 m_pLabel = new QIRichTextLabel(this);
325 m_pNameAndSystemEditor = new UINameAndSystemEditor(this);
326 pMainLayout->addWidget(m_pLabel);
327 pMainLayout->addWidget(m_pNameAndSystemEditor);
328 pMainLayout->addStretch();
329 }
330
331 /* Setup connections: */
332 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigNameChanged, this, &UIWizardNewVMPageBasic1::sltNameChanged);
333 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigPathChanged, this, &UIWizardNewVMPageBasic1::sltPathChanged);
334 connect(m_pNameAndSystemEditor, &UINameAndSystemEditor::sigOsTypeChanged, this, &UIWizardNewVMPageBasic1::sltOsTypeChanged);
335
336 /* Register fields: */
337 registerField("name*", m_pNameAndSystemEditor, "name", SIGNAL(sigNameChanged(const QString &)));
338 registerField("type", m_pNameAndSystemEditor, "type", SIGNAL(sigOsTypeChanged()));
339 registerField("machineFilePath", this, "machineFilePath");
340 registerField("machineFolder", this, "machineFolder");
341 registerField("machineBaseName", this, "machineBaseName");
342}
343
344void UIWizardNewVMPageBasic1::sltNameChanged(const QString &strNewName)
345{
346 /* Call to base-class: */
347 onNameChanged(strNewName);
348 composeMachineFilePath();
349}
350
351void UIWizardNewVMPageBasic1::sltPathChanged(const QString &strNewPath)
352{
353 RT_NOREF(strNewPath);
354 composeMachineFilePath();
355}
356
357void UIWizardNewVMPageBasic1::sltOsTypeChanged()
358{
359 /* Call to base-class: */
360 onOsTypeChanged();
361}
362
363void UIWizardNewVMPageBasic1::retranslateUi()
364{
365 /* Translate page: */
366 setTitle(UIWizardNewVM::tr("Name and operating system"));
367
368 /* Translate widgets: */
369 m_pLabel->setText(UIWizardNewVM::tr("Please choose a descriptive name and destination folder for the new virtual machine "
370 "and select the type of operating system you intend to install on it. "
371 "The name you choose will be used throughout VirtualBox "
372 "to identify this machine."));
373}
374
375void UIWizardNewVMPageBasic1::initializePage()
376{
377 /* Translate page: */
378 retranslateUi();
379}
380
381void UIWizardNewVMPageBasic1::cleanupPage()
382{
383 /* Cleanup: */
384 cleanupMachineFolder();
385 /* Call to base-class: */
386 UIWizardPage::cleanupPage();
387}
388
389bool UIWizardNewVMPageBasic1::validatePage()
390{
391 /* Try to create machine folder: */
392 return createMachineFolder();
393}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette