1 | /* $Id: UIWizardNewVMPageBasic1.h 85053 2020-07-03 11:33:19Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIWizardNewVMPageBasicNameType class declaration.
|
---|
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 | #ifndef FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicNameType_h
|
---|
19 | #define FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicNameType_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* Local includes: */
|
---|
25 | #include "UIWizardPage.h"
|
---|
26 |
|
---|
27 | /* Forward declarations: */
|
---|
28 | class QCheckBox;
|
---|
29 | class QLabel;
|
---|
30 | class QRadioButton;
|
---|
31 | class QIRichTextLabel;
|
---|
32 | class UIFilePathSelector;
|
---|
33 | class UINameAndSystemEditor;
|
---|
34 |
|
---|
35 | /* 1st page of the New Virtual Machine wizard (base part): */
|
---|
36 | class UIWizardNewVMPageNameType : public UIWizardPageBase
|
---|
37 | {
|
---|
38 | protected:
|
---|
39 |
|
---|
40 | /* Constructor: */
|
---|
41 | UIWizardNewVMPageNameType(const QString &strGroup);
|
---|
42 |
|
---|
43 | /* Handlers: */
|
---|
44 | void onNameChanged(QString strNewName);
|
---|
45 | void onOsTypeChanged();
|
---|
46 |
|
---|
47 | bool createMachineFolder();
|
---|
48 | /** Removes a previously created folder (if exists) before creating a new one.
|
---|
49 | * used during page cleanup and new folder creation. Called upon page Next/Back and
|
---|
50 | * wizard cancel */
|
---|
51 | bool cleanupMachineFolder(bool fWizardCancel = false);
|
---|
52 |
|
---|
53 | /** @name Property getters/setters
|
---|
54 | * @{ */
|
---|
55 | QString machineFilePath() const;
|
---|
56 | void setMachineFilePath(const QString &strMachineFilePath);
|
---|
57 |
|
---|
58 | QString machineFolder() const;
|
---|
59 | void setMachineFolder(const QString &strMachineFolder);
|
---|
60 |
|
---|
61 | QString machineBaseName() const;
|
---|
62 | void setMachineBaseName(const QString &strMachineBaseName);
|
---|
63 |
|
---|
64 | QString guestOSFamiyId() const;
|
---|
65 | QString ISOFilePath() const;
|
---|
66 | bool isUnattendedEnabled() const;
|
---|
67 | bool startHeadless() const;
|
---|
68 | const QString &detectedOSTypeId() const;
|
---|
69 | /** @} */
|
---|
70 |
|
---|
71 |
|
---|
72 | bool determineOSType(const QString &strISOPath);
|
---|
73 | /** calls CVirtualBox::ComposeMachineFilename(...) and sets related member variables */
|
---|
74 | void composeMachineFilePath();
|
---|
75 | bool checkISOFile() const;
|
---|
76 |
|
---|
77 | /** Holds the simple variant button instance. */
|
---|
78 | QRadioButton *m_pButtonSimple;
|
---|
79 | /** Holds the unattended variant button instance. */
|
---|
80 | QRadioButton *m_pButtonUnattended;
|
---|
81 |
|
---|
82 | /** Holds the ISO selector label instance. */
|
---|
83 | QLabel *m_pISOSelectorLabel;
|
---|
84 | /** Holds the ISO selector editor instance. */
|
---|
85 | UIFilePathSelector *m_pISOFilePathSelector;
|
---|
86 |
|
---|
87 | /** Holds the headless start label instance. */
|
---|
88 | QLabel *m_pStartHeadlessLabel;
|
---|
89 | /** Holds the headless start checkbox instance. */
|
---|
90 | QCheckBox *m_pStartHeadlessCheckBox;
|
---|
91 |
|
---|
92 | /** Provides a path selector and a line edit field for path and name entry. */
|
---|
93 | UINameAndSystemEditor *m_pNameAndSystemEditor;
|
---|
94 | QString m_strDetectedOSTypeId;
|
---|
95 |
|
---|
96 | private:
|
---|
97 |
|
---|
98 |
|
---|
99 | /** Full path (including the file name) of the machine's configuration file. */
|
---|
100 | QString m_strMachineFilePath;
|
---|
101 | /** Path of the folder hosting the machine's configuration file. Generated from m_strMachineFilePath. */
|
---|
102 | QString m_strMachineFolder;
|
---|
103 | /** Path of the folder created by this wizard page. Used to remove previously created
|
---|
104 | * folder. see cleanupMachineFolder();*/
|
---|
105 | QString m_strCreatedFolder;
|
---|
106 | /** Base name of the machine is generated from the m_strMachineFilePath. */
|
---|
107 | QString m_strMachineBaseName;
|
---|
108 |
|
---|
109 |
|
---|
110 | QString m_strGroup;
|
---|
111 | bool m_fSupportsHWVirtEx;
|
---|
112 | bool m_fSupportsLongMode;
|
---|
113 |
|
---|
114 |
|
---|
115 | friend class UIWizardNewVM;
|
---|
116 | };
|
---|
117 |
|
---|
118 | /* 1st page of the New Virtual Machine wizard (basic extension): */
|
---|
119 | class UIWizardNewVMPageBasicNameType : public UIWizardPage, public UIWizardNewVMPageNameType
|
---|
120 | {
|
---|
121 | Q_OBJECT;
|
---|
122 | Q_PROPERTY(QString machineFilePath READ machineFilePath WRITE setMachineFilePath);
|
---|
123 | Q_PROPERTY(QString machineFolder READ machineFolder WRITE setMachineFolder);
|
---|
124 | Q_PROPERTY(QString machineBaseName READ machineBaseName WRITE setMachineBaseName);
|
---|
125 | Q_PROPERTY(QString guestOSFamiyId READ guestOSFamiyId);
|
---|
126 | Q_PROPERTY(QString ISOFilePath READ ISOFilePath);
|
---|
127 | Q_PROPERTY(bool isUnattendedEnabled READ isUnattendedEnabled);
|
---|
128 | Q_PROPERTY(bool startHeadless READ startHeadless);
|
---|
129 | Q_PROPERTY(QString detectedOSTypeId READ detectedOSTypeId);
|
---|
130 |
|
---|
131 |
|
---|
132 | public:
|
---|
133 |
|
---|
134 | /* Constructor: */
|
---|
135 | UIWizardNewVMPageBasicNameType(const QString &strGroup);
|
---|
136 | virtual int nextId() const /* override */;
|
---|
137 | void setTypeByISODetectedOSType(const QString &strDetectedOSType);
|
---|
138 | virtual bool isComplete() const; /* override */
|
---|
139 |
|
---|
140 | protected:
|
---|
141 |
|
---|
142 | /* Wrapper to access 'this' from base part: */
|
---|
143 | UIWizardPage* thisImp() { return this; }
|
---|
144 |
|
---|
145 | private slots:
|
---|
146 |
|
---|
147 | /* Handlers: */
|
---|
148 | void sltNameChanged(const QString &strNewText);
|
---|
149 | void sltPathChanged(const QString &strNewPath);
|
---|
150 | void sltOsTypeChanged();
|
---|
151 | void sltISOPathChanged(const QString &strPath);
|
---|
152 | void sltUnattendedCheckBoxToggle();
|
---|
153 |
|
---|
154 | private:
|
---|
155 |
|
---|
156 | void prepare();
|
---|
157 | /* Translation stuff: */
|
---|
158 | void retranslateUi();
|
---|
159 |
|
---|
160 | /* Prepare stuff: */
|
---|
161 | void initializePage();
|
---|
162 | void cleanupPage();
|
---|
163 |
|
---|
164 | /* Validation stuff: */
|
---|
165 | virtual bool validatePage() /* override */;
|
---|
166 |
|
---|
167 | /* Widgets: */
|
---|
168 | QIRichTextLabel *m_pLabel1;
|
---|
169 | QIRichTextLabel *m_pLabel2;
|
---|
170 | };
|
---|
171 |
|
---|
172 | #endif /* !FEQT_INCLUDED_SRC_wizards_newvm_UIWizardNewVMPageBasicNameType_h */
|
---|