1 | /* $Id: UIMachineSettingsGeneral.h 101752 2023-11-03 15:56:43Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMachineSettingsGeneral class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsGeneral_h
|
---|
29 | #define FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsGeneral_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UISettingsPage.h"
|
---|
36 |
|
---|
37 | /* Forward declarations: */
|
---|
38 | class QITabWidget;
|
---|
39 | class UIDescriptionEditor;
|
---|
40 | class UIDiskEncryptionSettingsEditor;
|
---|
41 | class UIDragAndDropEditor;
|
---|
42 | class UINameAndSystemEditor;
|
---|
43 | class UISharedClipboardEditor;
|
---|
44 | class UISnapshotFolderEditor;
|
---|
45 | struct UIDataSettingsMachineGeneral;
|
---|
46 | typedef UISettingsCache<UIDataSettingsMachineGeneral> UISettingsCacheMachineGeneral;
|
---|
47 |
|
---|
48 | /** Machine settings: General page. */
|
---|
49 | class SHARED_LIBRARY_STUFF UIMachineSettingsGeneral : public UISettingsPageMachine
|
---|
50 | {
|
---|
51 | Q_OBJECT;
|
---|
52 |
|
---|
53 | public:
|
---|
54 |
|
---|
55 | /** Constructs General settings page. */
|
---|
56 | UIMachineSettingsGeneral();
|
---|
57 | /** Destructs General settings page. */
|
---|
58 | virtual ~UIMachineSettingsGeneral() RT_OVERRIDE;
|
---|
59 |
|
---|
60 | /** Returns the VM OS type Id. */
|
---|
61 | QString guestOSTypeId() const;
|
---|
62 |
|
---|
63 | protected:
|
---|
64 |
|
---|
65 | /** Returns whether the page content was changed. */
|
---|
66 | virtual bool changed() const RT_OVERRIDE;
|
---|
67 |
|
---|
68 | /** Loads data into the cache from the corresponding external object(s).
|
---|
69 | * @note This task COULD be performed in other than GUI thread. */
|
---|
70 | virtual void loadToCacheFrom(QVariant &data) RT_OVERRIDE;
|
---|
71 | /** Loads data into the corresponding widgets from cache,
|
---|
72 | * @note This task SHOULD be performed in GUI thread only! */
|
---|
73 | virtual void getFromCache() RT_OVERRIDE;
|
---|
74 |
|
---|
75 | /** Saves the data from the corresponding widgets into the cache,
|
---|
76 | * @note This task SHOULD be performed in GUI thread only! */
|
---|
77 | virtual void putToCache() RT_OVERRIDE;
|
---|
78 | /** Save data from cache into the corresponding external object(s).
|
---|
79 | * @note This task COULD be performed in other than GUI thread. */
|
---|
80 | virtual void saveFromCacheTo(QVariant &data) RT_OVERRIDE;
|
---|
81 |
|
---|
82 | /** Performs validation, updates @a messages list if something is wrong. */
|
---|
83 | virtual bool validate(QList<UIValidationMessage> &messages) RT_OVERRIDE;
|
---|
84 |
|
---|
85 | /** Defines TAB order for passed @a pWidget. */
|
---|
86 | virtual void setOrderAfter(QWidget *pWidget) RT_OVERRIDE;
|
---|
87 |
|
---|
88 | /** Handles translation event. */
|
---|
89 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
90 |
|
---|
91 | /** Handles filter change. */
|
---|
92 | virtual void handleFilterChange() RT_OVERRIDE;
|
---|
93 |
|
---|
94 | /** Performs final page polishing. */
|
---|
95 | virtual void polishPage() RT_OVERRIDE;
|
---|
96 |
|
---|
97 | private slots:
|
---|
98 |
|
---|
99 | /** Handles encryption cipher change. */
|
---|
100 | void sltHandleEncryptionCipherChanged();
|
---|
101 | /** Handles encryption password change. */
|
---|
102 | void sltHandleEncryptionPasswordChanged();
|
---|
103 |
|
---|
104 | private:
|
---|
105 |
|
---|
106 | /** Prepares all. */
|
---|
107 | void prepare();
|
---|
108 | /** Prepares widgets. */
|
---|
109 | void prepareWidgets();
|
---|
110 | /** Prepares 'Basic' tab. */
|
---|
111 | void prepareTabBasic();
|
---|
112 | /** Prepares 'Advanced' tab. */
|
---|
113 | void prepareTabAdvanced();
|
---|
114 | /** Prepares 'Description' tab. */
|
---|
115 | void prepareTabDescription();
|
---|
116 | /** Prepares 'Encryption' tab. */
|
---|
117 | void prepareTabEncryption();
|
---|
118 | /** Prepares connections. */
|
---|
119 | void prepareConnections();
|
---|
120 | /** Cleanups all. */
|
---|
121 | void cleanup();
|
---|
122 |
|
---|
123 | /** Saves existing general data from cache. */
|
---|
124 | bool saveData();
|
---|
125 | /** Saves existing 'Basic' data from cache. */
|
---|
126 | bool saveBasicData();
|
---|
127 | /** Saves existing 'Advanced' data from cache. */
|
---|
128 | bool saveAdvancedData();
|
---|
129 | /** Saves existing 'Description' data from cache. */
|
---|
130 | bool saveDescriptionData();
|
---|
131 | /** Saves existing 'Encryption' data from cache. */
|
---|
132 | bool saveEncryptionData();
|
---|
133 |
|
---|
134 | /** Updates minimum layout hint. */
|
---|
135 | void updateMinimumLayoutHint();
|
---|
136 |
|
---|
137 | /** Holds whether the encryption cipher was changed.
|
---|
138 | * We are holding that argument here because we do not know
|
---|
139 | * the old <i>cipher</i> for sure to compare the new one with. */
|
---|
140 | bool m_fEncryptionCipherChanged;
|
---|
141 | /** Holds whether the encryption password was changed.
|
---|
142 | * We are holding that argument here because we do not know
|
---|
143 | * the old <i>password</i> at all to compare the new one with. */
|
---|
144 | bool m_fEncryptionPasswordChanged;
|
---|
145 |
|
---|
146 | /** Holds the page data cache instance. */
|
---|
147 | UISettingsCacheMachineGeneral *m_pCache;
|
---|
148 |
|
---|
149 | /** @name Widgets
|
---|
150 | * @{ */
|
---|
151 | /** Holds the tab-widget instance. */
|
---|
152 | QITabWidget *m_pTabWidget;
|
---|
153 |
|
---|
154 | /** Holds the 'Basic' tab instance. */
|
---|
155 | UIEditor *m_pTabBasic;
|
---|
156 | /** Holds the name and system editor instance. */
|
---|
157 | UINameAndSystemEditor *m_pEditorNameAndSystem;
|
---|
158 |
|
---|
159 | /** Holds the 'Advanced' tab instance. */
|
---|
160 | UIEditor *m_pTabAdvanced;
|
---|
161 | /** Holds the snapshot folder editor instance. */
|
---|
162 | UISnapshotFolderEditor *m_pEditorSnapshotFolder;
|
---|
163 | /** Holds the shared clipboard editor instance. */
|
---|
164 | UISharedClipboardEditor *m_pEditorClipboard;
|
---|
165 | /** Holds the drag and drop editor instance. */
|
---|
166 | UIDragAndDropEditor *m_pEditorDragAndDrop;
|
---|
167 |
|
---|
168 | /** Holds the 'Description' tab instance. */
|
---|
169 | UIEditor *m_pTabDescription;
|
---|
170 | /** Holds the description editor instance. */
|
---|
171 | UIDescriptionEditor *m_pEditorDescription;
|
---|
172 |
|
---|
173 | /** Holds the 'Encryption' tab instance. */
|
---|
174 | UIEditor *m_pTabEncryption;
|
---|
175 | /** Holds the cipher settings editor instance. */
|
---|
176 | UIDiskEncryptionSettingsEditor *m_pEditorDiskEncryptionSettings;
|
---|
177 | /** @} */
|
---|
178 | };
|
---|
179 |
|
---|
180 | #endif /* !FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsGeneral_h */
|
---|