1 | /* $Id: UIWizardNewVMPageBasic1.h 62493 2016-07-22 18:44:18Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIWizardNewVMPageBasic1 class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2016 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 __UIWizardNewVMPageBasic1_h__
|
---|
19 | #define __UIWizardNewVMPageBasic1_h__
|
---|
20 |
|
---|
21 | /* Local includes: */
|
---|
22 | #include "UIWizardPage.h"
|
---|
23 |
|
---|
24 | /* Forward declarations: */
|
---|
25 | class UINameAndSystemEditor;
|
---|
26 | class QIRichTextLabel;
|
---|
27 |
|
---|
28 | /* 1st page of the New Virtual Machine wizard (base part): */
|
---|
29 | class UIWizardNewVMPage1 : public UIWizardPageBase
|
---|
30 | {
|
---|
31 | protected:
|
---|
32 |
|
---|
33 | /* Constructor: */
|
---|
34 | UIWizardNewVMPage1(const QString &strGroup);
|
---|
35 |
|
---|
36 | /* Handlers: */
|
---|
37 | void onNameChanged(QString strNewName);
|
---|
38 | void onOsTypeChanged();
|
---|
39 |
|
---|
40 | /** Adjusts tool-tip according to @a strNewName. */
|
---|
41 | void adjustToolTip(const QString &strNewName = QString());
|
---|
42 |
|
---|
43 | /* Helping stuff: */
|
---|
44 | bool machineFolderCreated();
|
---|
45 | bool createMachineFolder();
|
---|
46 | bool cleanupMachineFolder();
|
---|
47 |
|
---|
48 | /** Composes and returns machine file-path on the basis of passed @a strUserMachineLocation. */
|
---|
49 | QString composeMachineFilePath(const QString &strUserMachineLocation);
|
---|
50 |
|
---|
51 | /** Returns the machine folder value. */
|
---|
52 | QString machineFolder() const { return m_strMachineFolder; }
|
---|
53 | /** Defines the @a strMachineFolder value. */
|
---|
54 | void setMachineFolder(const QString &strMachineFolder) { m_strMachineFolder = strMachineFolder; }
|
---|
55 |
|
---|
56 | /** Returns the machine base-name value. */
|
---|
57 | QString machineBaseName() const { return m_strMachineBaseName; }
|
---|
58 | /** Defines the @a strMachineBaseName value. */
|
---|
59 | void setMachineBaseName(const QString &strMachineBaseName) { m_strMachineBaseName = strMachineBaseName; }
|
---|
60 |
|
---|
61 | /** Returns the machine file-path value. */
|
---|
62 | QString machineFilePath() const { return m_strMachineFilePath; }
|
---|
63 | /** Defines the @a strMachineFilePath value. */
|
---|
64 | void setMachineFilePath(const QString &strMachineFilePath) { m_strMachineFilePath = strMachineFilePath; }
|
---|
65 |
|
---|
66 | /** Holds the machine folder value. */
|
---|
67 | QString m_strMachineFolder;
|
---|
68 | /** Holds the machine base-name value. */
|
---|
69 | QString m_strMachineBaseName;
|
---|
70 | /** Holds the machine file-path value. */
|
---|
71 | QString m_strMachineFilePath;
|
---|
72 |
|
---|
73 | /* Widgets: */
|
---|
74 | UINameAndSystemEditor *m_pNameAndSystemEditor;
|
---|
75 |
|
---|
76 | /* Variables: */
|
---|
77 | QString m_strGroup;
|
---|
78 | bool m_fSupportsHWVirtEx;
|
---|
79 | bool m_fSupportsLongMode;
|
---|
80 | };
|
---|
81 |
|
---|
82 | /* 1st page of the New Virtual Machine wizard (basic extension): */
|
---|
83 | class UIWizardNewVMPageBasic1 : public UIWizardPage, public UIWizardNewVMPage1
|
---|
84 | {
|
---|
85 | Q_OBJECT;
|
---|
86 | Q_PROPERTY(QString machineFolder READ machineFolder WRITE setMachineFolder);
|
---|
87 | Q_PROPERTY(QString machineBaseName READ machineBaseName WRITE setMachineBaseName);
|
---|
88 | Q_PROPERTY(QString machineFilePath READ machineFilePath WRITE setMachineFilePath);
|
---|
89 |
|
---|
90 | public:
|
---|
91 |
|
---|
92 | /* Constructor: */
|
---|
93 | UIWizardNewVMPageBasic1(const QString &strGroup);
|
---|
94 |
|
---|
95 | protected:
|
---|
96 |
|
---|
97 | /* Wrapper to access 'this' from base part: */
|
---|
98 | UIWizardPage* thisImp() { return this; }
|
---|
99 |
|
---|
100 | private slots:
|
---|
101 |
|
---|
102 | /* Handlers: */
|
---|
103 | void sltNameChanged(const QString &strNewText);
|
---|
104 | void sltOsTypeChanged();
|
---|
105 |
|
---|
106 | /** Adjusts tool-tip according to @a strNewName. */
|
---|
107 | void sltAdjustToolTip(const QString &strNewName);
|
---|
108 |
|
---|
109 | private:
|
---|
110 |
|
---|
111 | /* Translation stuff: */
|
---|
112 | void retranslateUi();
|
---|
113 |
|
---|
114 | /* Prepare stuff: */
|
---|
115 | void initializePage();
|
---|
116 | void cleanupPage();
|
---|
117 |
|
---|
118 | /* Validation stuff: */
|
---|
119 | bool validatePage();
|
---|
120 |
|
---|
121 | /* Widgets: */
|
---|
122 | QIRichTextLabel *m_pLabel;
|
---|
123 | };
|
---|
124 |
|
---|
125 | #endif // __UIWizardNewVMPageBasic1_h__
|
---|
126 |
|
---|