ca87590cb28f22bccab88dc2f87c5ce2682b1ba1vboxsync * VBox Qt GUI - UIWizardNewVMPageBasic1 class implementation.
dfd576109cb676448a2c4574150060aa3d8626bavboxsync * Copyright (C) 2006-2012 Oracle Corporation
dfd576109cb676448a2c4574150060aa3d8626bavboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
dfd576109cb676448a2c4574150060aa3d8626bavboxsync * available from http://www.virtualbox.org. This file is free software;
dfd576109cb676448a2c4574150060aa3d8626bavboxsync * you can redistribute it and/or modify it under the terms of the GNU
dfd576109cb676448a2c4574150060aa3d8626bavboxsync * General Public License (GPL) as published by the Free Software
dfd576109cb676448a2c4574150060aa3d8626bavboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
dfd576109cb676448a2c4574150060aa3d8626bavboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
dfd576109cb676448a2c4574150060aa3d8626bavboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
8bf8c6b1914c9e7e60b1547888400668f1774497vboxsync/* Qt includes: */
8bf8c6b1914c9e7e60b1547888400668f1774497vboxsync/* GUI includes: */
8bf8c6b1914c9e7e60b1547888400668f1774497vboxsync/* COM includes: */
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync/* Defines some patterns to guess the right OS type. Should be in sync with
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync * VirtualBox-settings-common.xsd in Main. The list is sorted by priority. The
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync * first matching string found, will be used. */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Windows: */
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "Wi.*98", Qt::CaseInsensitive), "Windows98" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "Wi.*95", Qt::CaseInsensitive), "Windows95" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "Wi.*Me", Qt::CaseInsensitive), "WindowsMe" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "(Wi.*NT)|(NT4)", Qt::CaseInsensitive), "WindowsNT4" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Wi.*XP)|(\\bXP\\b)).*64", Qt::CaseInsensitive), "WindowsXP_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Wi.*XP)|(\\bXP\\b)).*32", Qt::CaseInsensitive), "WindowsXP" },
bb391899270663062ca7b98e86b84ee81df0bd91vboxsync { QRegExp("((Wi.*2003)|(W2K3)|(Win2K3)).*64", Qt::CaseInsensitive), "Windows2003_64" },
8479dde500c894a9bf1011e9869eb9a14886ac07vboxsync { QRegExp("((Wi.*2003)|(W2K3)|(Win2K3)).*32", Qt::CaseInsensitive), "Windows2003" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Wi.*V)|(Vista)).*64", Qt::CaseInsensitive), "WindowsVista_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Wi.*V)|(Vista)).*32", Qt::CaseInsensitive), "WindowsVista" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "(Wi.*2012)|(W2K12)|(Win2K12)", Qt::CaseInsensitive), "Windows2012_64" },
bb391899270663062ca7b98e86b84ee81df0bd91vboxsync { QRegExp("((Wi.*2008)|(W2K8)|(Win2k8)).*64", Qt::CaseInsensitive), "Windows2008_64" },
8479dde500c894a9bf1011e9869eb9a14886ac07vboxsync { QRegExp("((Wi.*2008)|(W2K8)|(Win2K8)).*32", Qt::CaseInsensitive), "Windows2008" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "(Wi.*2000)|(W2K)|(Win2K)", Qt::CaseInsensitive), "Windows2000" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "(Wi.*7.*64)|(W7.*64)", Qt::CaseInsensitive), "Windows7_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "(Wi.*7.*32)|(W7.*32)", Qt::CaseInsensitive), "Windows7" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "(Wi.*8.*1.*64)|(W8.*64)", Qt::CaseInsensitive), "Windows81_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "(Wi.*8.*1.*32)|(W8.*32)", Qt::CaseInsensitive), "Windows81" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "(Wi.*8.*64)|(W8.*64)", Qt::CaseInsensitive), "Windows8_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "(Wi.*8.*32)|(W8.*32)", Qt::CaseInsensitive), "Windows8" },
cc7c64583027833283da7bfbaad8b0aea64b106dvboxsync { QRegExp( "(Wi.*10.*64)|(W10.*64)", Qt::CaseInsensitive), "Windows10_64" },
cc7c64583027833283da7bfbaad8b0aea64b106dvboxsync { QRegExp( "(Wi.*10.*32)|(W10.*32)", Qt::CaseInsensitive), "Windows10" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "Wi.*3.*1", Qt::CaseInsensitive), "Windows31" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "Wi.*64", Qt::CaseInsensitive), "WindowsXP_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "Wi.*32", Qt::CaseInsensitive), "WindowsXP" },
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Solaris: */
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("So.*11", Qt::CaseInsensitive), "Solaris11_64" },
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync { QRegExp("((Op.*So)|(os20[01][0-9])|(So.*10)|(India)|(Neva)).*64", Qt::CaseInsensitive), "OpenSolaris_64" },
8479dde500c894a9bf1011e9869eb9a14886ac07vboxsync { QRegExp("((Op.*So)|(os20[01][0-9])|(So.*10)|(India)|(Neva)).*32", Qt::CaseInsensitive), "OpenSolaris" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("So.*64", Qt::CaseInsensitive), "Solaris_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("So.*32", Qt::CaseInsensitive), "Solaris" },
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* OS/2: */
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "OS[/|!-]{,1}2.*W.*4.?5", Qt::CaseInsensitive), "OS2Warp45" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "OS[/|!-]{,1}2.*W.*4", Qt::CaseInsensitive), "OS2Warp4" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "OS[/|!-]{,1}2.*W", Qt::CaseInsensitive), "OS2Warp3" },
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync { QRegExp("(OS[/|!-]{,1}2.*e)|(eCS.*)", Qt::CaseInsensitive), "OS2eCS" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp( "OS[/|!-]{,1}2", Qt::CaseInsensitive), "OS2" },
31af0809234b92fa847f397fe0f531852eef9437vboxsync { QRegExp( "eComS.*", Qt::CaseInsensitive), "OS2eCS" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync /* Other: Must come before Ubuntu/Maverick and before Linux??? */
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync /* Mac OS X: Must come before Ubuntu/Maverick and before Linux: */
61d92277af894c016739aa447ea1ae493c7c2dd9vboxsync { QRegExp("((mac.*10[.,]{0,1}4)|(os.*x.*10[.,]{0,1}4)|(mac.*ti)|(os.*x.*ti)|(Tig)).64", Qt::CaseInsensitive), "MacOS_64" },
8479dde500c894a9bf1011e9869eb9a14886ac07vboxsync { QRegExp("((mac.*10[.,]{0,1}4)|(os.*x.*10[.,]{0,1}4)|(mac.*ti)|(os.*x.*ti)|(Tig)).32", Qt::CaseInsensitive), "MacOS" },
61d92277af894c016739aa447ea1ae493c7c2dd9vboxsync { QRegExp("((mac.*10[.,]{0,1}5)|(os.*x.*10[.,]{0,1}5)|(mac.*leo)|(os.*x.*leo)|(Leop)).*64", Qt::CaseInsensitive), "MacOS_64" },
8479dde500c894a9bf1011e9869eb9a14886ac07vboxsync { QRegExp("((mac.*10[.,]{0,1}5)|(os.*x.*10[.,]{0,1}5)|(mac.*leo)|(os.*x.*leo)|(Leop)).*32", Qt::CaseInsensitive), "MacOS" },
61d92277af894c016739aa447ea1ae493c7c2dd9vboxsync { QRegExp("((mac.*10[.,]{0,1}6)|(os.*x.*10[.,]{0,1}6)|(mac.*SL)|(os.*x.*SL)|(Snow L)).*64", Qt::CaseInsensitive), "MacOS106_64" },
8479dde500c894a9bf1011e9869eb9a14886ac07vboxsync { QRegExp("((mac.*10[.,]{0,1}6)|(os.*x.*10[.,]{0,1}6)|(mac.*SL)|(os.*x.*SL)|(Snow L)).*32", Qt::CaseInsensitive), "MacOS106" },
61d92277af894c016739aa447ea1ae493c7c2dd9vboxsync { QRegExp( "(mac.*10[.,]{0,1}7)|(os.*x.*10[.,]{0,1}7)|(mac.*ML)|(os.*x.*ML)|(Mount)", Qt::CaseInsensitive), "MacOS108_64" },
61d92277af894c016739aa447ea1ae493c7c2dd9vboxsync { QRegExp( "(mac.*10[.,]{0,1}8)|(os.*x.*10[.,]{0,1}8)|(Lion)", Qt::CaseInsensitive), "MacOS107_64" },
61d92277af894c016739aa447ea1ae493c7c2dd9vboxsync { QRegExp( "(mac.*10[.,]{0,1}9)|(os.*x.*10[.,]{0,1}9)|(mac.*mav)|(os.*x.*mav)|(Mavericks)", Qt::CaseInsensitive), "MacOS109_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Mac)|(Tig)|(Leop)|(os[ ]*x)).*64", Qt::CaseInsensitive), "MacOS_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Mac)|(Tig)|(Leop)|(os[ ]*x)).*32", Qt::CaseInsensitive), "MacOS" },
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Code names for Linux distributions: */
cde90b576dc73aaba98be144e3e2c7ef30e3141evboxsync { QRegExp("((edgy)|(feisty)|(gutsy)|(hardy)|(intrepid)|(jaunty)|(karmic)|(lucid)|(maverick)|(natty)|(oneiric)|(precise)|(quantal)|(raring)|(saucy)|(trusty)).*64", Qt::CaseInsensitive), "Ubuntu_64" },
cde90b576dc73aaba98be144e3e2c7ef30e3141evboxsync { QRegExp("((edgy)|(feisty)|(gutsy)|(hardy)|(intrepid)|(jaunty)|(karmic)|(lucid)|(maverick)|(natty)|(oneiric)|(precise)|(quantal)|(raring)|(saucy)|(trusty)).*32", Qt::CaseInsensitive), "Ubuntu" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((sarge)|(etch)|(lenny)|(squeeze)|(wheezy)|(jessie)|(sid)).*64", Qt::CaseInsensitive), "Debian_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((sarge)|(etch)|(lenny)|(squeeze)|(wheezy)|(jessie)|(sid)).*32", Qt::CaseInsensitive), "Debian" },
4b61ef28507afd1de7cd011df328ccd32aa4f86bvboxsync { QRegExp("((moonshine)|(werewolf)|(sulphur)|(cambridge)|(leonidas)|(constantine)|(goddard)|(laughlin)|(lovelock)|(verne)|(beefy)|(spherical)).*64", Qt::CaseInsensitive), "Fedora_64" },
8479dde500c894a9bf1011e9869eb9a14886ac07vboxsync { QRegExp("((moonshine)|(werewolf)|(sulphur)|(cambridge)|(leonidas)|(constantine)|(goddard)|(laughlin)|(lovelock)|(verne)|(beefy)|(spherical)).*32", Qt::CaseInsensitive), "Fedora" },
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Regular names of Linux distributions: */
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Arc.*64", Qt::CaseInsensitive), "ArchLinux_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Arc.*32", Qt::CaseInsensitive), "ArchLinux" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Deb.*64", Qt::CaseInsensitive), "Debian_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Deb.*32", Qt::CaseInsensitive), "Debian" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((SU)|(Nov)|(SLE)).*64", Qt::CaseInsensitive), "OpenSUSE_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((SU)|(Nov)|(SLE)).*32", Qt::CaseInsensitive), "OpenSUSE" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Fe.*64", Qt::CaseInsensitive), "Fedora_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Fe.*32", Qt::CaseInsensitive), "Fedora" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Gen)|(Sab)).*64", Qt::CaseInsensitive), "Gentoo_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Gen)|(Sab)).*32", Qt::CaseInsensitive), "Gentoo" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Man)|(Mag)).*64", Qt::CaseInsensitive), "Mandriva_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Man)|(Mag)).*32", Qt::CaseInsensitive), "Mandriva" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Red)|(rhel)|(cen)).*64", Qt::CaseInsensitive), "RedHat_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Red)|(rhel)|(cen)).*32", Qt::CaseInsensitive), "RedHat" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Tur.*64", Qt::CaseInsensitive), "Turbolinux_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Tur.*32", Qt::CaseInsensitive), "Turbolinux" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Ub.*64", Qt::CaseInsensitive), "Ubuntu_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Ub.*32", Qt::CaseInsensitive), "Ubuntu" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Xa.*64", Qt::CaseInsensitive), "Xandros_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Xa.*32", Qt::CaseInsensitive), "Xandros" },
856de2f28f0a0eff609bc5ab2f6a517d611fc5b2vboxsync { QRegExp("((Or)|(oel)|(ol)).*64", Qt::CaseInsensitive), "Oracle_64" },
856de2f28f0a0eff609bc5ab2f6a517d611fc5b2vboxsync { QRegExp("((Or)|(oel)|(ol)).*32", Qt::CaseInsensitive), "Oracle" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Knoppix", Qt::CaseInsensitive), "Linux26" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Dsl", Qt::CaseInsensitive), "Linux24" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Lin)|(lnx)).*2.?2", Qt::CaseInsensitive), "Linux22" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Lin)|(lnx)).*2.?4.*64", Qt::CaseInsensitive), "Linux24_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Lin)|(lnx)).*2.?4.*32", Qt::CaseInsensitive), "Linux24" },
919658f3bd72e1624c951c8bb7986ee6651e7e95vboxsync { QRegExp("((((Lin)|(lnx)).*2.?6)|(LFS)).*64", Qt::CaseInsensitive), "Linux26_64" },
8479dde500c894a9bf1011e9869eb9a14886ac07vboxsync { QRegExp("((((Lin)|(lnx)).*2.?6)|(LFS)).*32", Qt::CaseInsensitive), "Linux26" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Lin)|(lnx)).*64", Qt::CaseInsensitive), "Linux26_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("((Lin)|(lnx)).*32", Qt::CaseInsensitive), "Linux26" },
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Other: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync { QRegExp("((Fr.*B)|(fbsd)).*64", Qt::CaseInsensitive), "FreeBSD_64" },
8479dde500c894a9bf1011e9869eb9a14886ac07vboxsync { QRegExp("((Fr.*B)|(fbsd)).*32", Qt::CaseInsensitive), "FreeBSD" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Op.*B.*64", Qt::CaseInsensitive), "OpenBSD_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Op.*B.*32", Qt::CaseInsensitive), "OpenBSD" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Ne.*B.*64", Qt::CaseInsensitive), "NetBSD_64" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Ne.*B.*32", Qt::CaseInsensitive), "NetBSD" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Net", Qt::CaseInsensitive), "Netware" },
0fe81f339d381d1b5cfb9b60b4733d475089c87fvboxsync { QRegExp("Rocki", Qt::CaseInsensitive), "JRockitVE" },
1f37cfc44ea630e28fd964240a80b6255ed6d64dvboxsyncUIWizardNewVMPage1::UIWizardNewVMPage1(const QString &strGroup)
3b4e1520eadd6f083bcc2bfb561068fa5dbb6ab9vboxsync m_fSupportsHWVirtEx = host.GetProcessorFeature(KProcessorFeature_HWVirtEx);
3b4e1520eadd6f083bcc2bfb561068fa5dbb6ab9vboxsync m_fSupportsLongMode = host.GetProcessorFeature(KProcessorFeature_LongMode);
8479dde500c894a9bf1011e9869eb9a14886ac07vboxsyncvoid UIWizardNewVMPage1::onNameChanged(QString strNewName)
e74a4fc62598eed9b21523a1eaae224540f496c4vboxsync /* Do not forget about achitecture bits, if not yet specified: */
e74a4fc62598eed9b21523a1eaae224540f496c4vboxsync if (!strNewName.contains("32") && !strNewName.contains("64"))
e74a4fc62598eed9b21523a1eaae224540f496c4vboxsync strNewName += ARCH_BITS == 64 && m_fSupportsHWVirtEx && m_fSupportsLongMode ? "64" : "32";
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Search for a matching OS type based on the string the user typed already. */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync for (size_t i = 0; i < RT_ELEMENTS(gs_OSTypePattern); ++i)
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync if (strNewName.contains(gs_OSTypePattern[i].pattern))
6e9130e5552f77fc3e844b0d6f12332a1f1003bcvboxsync m_pNameAndSystemEditor->setType(vboxGlobal().vmGuestOSType(gs_OSTypePattern[i].pcstId));
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* If the user manually edited the OS type, we didn't want our automatic OS type guessing anymore.
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync * So simply disconnect the text-edit signal. */
6e9130e5552f77fc3e844b0d6f12332a1f1003bcvboxsync m_pNameAndSystemEditor->disconnect(SIGNAL(sigNameChanged(const QString &)), thisImp(), SLOT(sltNameChanged(const QString &)));
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Cleanup previosly created folder if any: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync if (machineFolderCreated() && !cleanupMachineFolder())
072f9d45583716b8940901b43edd43d68d6845ffvboxsync msgCenter().cannotRemoveMachineFolder(m_strMachineFolder, thisImp());
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync return false;
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Get VBox: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Get default machines directory: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync QString strDefaultMachinesFolder = vbox.GetSystemProperties().GetDefaultMachineFolder();
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Compose machine filename: */
2e6a98507125b65b3bbdee58d5856aa59e8c33c9vboxsync QString strMachineFilename = vbox.ComposeMachineFilename(m_pNameAndSystemEditor->name(), m_strGroup, QString::null, strDefaultMachinesFolder);
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Compose machine folder/basename: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync QString strMachineFolder = fileInfo.absolutePath();
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync QString strMachineBaseName = fileInfo.completeBaseName();
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Make sure that folder doesn't exists: */
072f9d45583716b8940901b43edd43d68d6845ffvboxsync msgCenter().cannotRewriteMachineFolder(strMachineFolder, thisImp());
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync return false;
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Try to create new folder (and it's predecessors): */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync bool fMachineFolderCreated = QDir().mkpath(strMachineFolder);
072f9d45583716b8940901b43edd43d68d6845ffvboxsync msgCenter().cannotCreateMachineFolder(strMachineFolder, thisImp());
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync return false;
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Initialize fields: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync return true;
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Make sure folder was previosly created: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync return false;
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Try to cleanup folder (and it's predecessors): */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync bool fMachineFolderRemoved = QDir().rmpath(m_strMachineFolder);
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Reset machine folder value: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Return cleanup result: */
1f37cfc44ea630e28fd964240a80b6255ed6d64dvboxsyncUIWizardNewVMPageBasic1::UIWizardNewVMPageBasic1(const QString &strGroup)
dfd576109cb676448a2c4574150060aa3d8626bavboxsync /* Create widgets: */
5d74c7672f6c2d1f2ab95efcb6713e97ca361113vboxsync m_pNameAndSystemEditor = new UINameAndSystemEditor(this);
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Setup connections: */
6e9130e5552f77fc3e844b0d6f12332a1f1003bcvboxsync connect(m_pNameAndSystemEditor, SIGNAL(sigNameChanged(const QString &)), this, SLOT(sltNameChanged(const QString &)));
6e9130e5552f77fc3e844b0d6f12332a1f1003bcvboxsync connect(m_pNameAndSystemEditor, SIGNAL(sigOsTypeChanged()), this, SLOT(sltOsTypeChanged()));
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Register fields: */
6e9130e5552f77fc3e844b0d6f12332a1f1003bcvboxsync registerField("name*", m_pNameAndSystemEditor, "name", SIGNAL(sigNameChanged(const QString &)));
6e9130e5552f77fc3e844b0d6f12332a1f1003bcvboxsync registerField("type", m_pNameAndSystemEditor, "type", SIGNAL(sigOsTypeChanged()));
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync registerField("machineFolder", this, "machineFolder");
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync registerField("machineBaseName", this, "machineBaseName");
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsyncvoid UIWizardNewVMPageBasic1::sltNameChanged(const QString &strNewName)
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Call to base-class: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Call to base-class: */
dfd576109cb676448a2c4574150060aa3d8626bavboxsync /* Translate page: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync setTitle(UIWizardNewVM::tr("Name and operating system"));
dfd576109cb676448a2c4574150060aa3d8626bavboxsync /* Translate widgets: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync m_pLabel->setText(UIWizardNewVM::tr("Please choose a descriptive name for the new virtual machine "
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync "and select the type of operating system you intend to install on it. "
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync "The name you choose will be used throughout VirtualBox "
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync "to identify this machine."));
dfd576109cb676448a2c4574150060aa3d8626bavboxsync /* Translate page: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Cleanup: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Call to base-class: */
b3a643fa111c6f3a826cf2e84e0806e4d19e3ba9vboxsync /* Try to create machine folder: */