1 | /* $Id: UIMachineSettingsDisplay.h 103803 2024-03-12 11:15:18Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMachineSettingsDisplay class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2008-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_UIMachineSettingsDisplay_h
|
---|
29 | #define FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsDisplay_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* COM includes: */
|
---|
35 | #include "KGraphicsControllerType.h"
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "UISettingsPage.h"
|
---|
39 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class QITabWidget;
|
---|
42 | class UIGraphicsControllerEditor;
|
---|
43 | #ifdef VBOX_WITH_3D_ACCELERATION
|
---|
44 | class UIDisplayScreenFeaturesEditor;
|
---|
45 | #endif
|
---|
46 | class UIMonitorCountEditor;
|
---|
47 | class UIRecordingSettingsEditor;
|
---|
48 | class UIScaleFactorEditor;
|
---|
49 | class UIVideoMemoryEditor;
|
---|
50 | class UIVRDESettingsEditor;
|
---|
51 | struct UIDataSettingsMachineDisplay;
|
---|
52 | typedef UISettingsCache<UIDataSettingsMachineDisplay> UISettingsCacheMachineDisplay;
|
---|
53 |
|
---|
54 | /** Machine settings: Display page. */
|
---|
55 | class SHARED_LIBRARY_STUFF UIMachineSettingsDisplay : public UISettingsPageMachine
|
---|
56 | {
|
---|
57 | Q_OBJECT;
|
---|
58 |
|
---|
59 | public:
|
---|
60 |
|
---|
61 | /** Constructs Display settings page. */
|
---|
62 | UIMachineSettingsDisplay();
|
---|
63 | /** Destructs Display settings page. */
|
---|
64 | virtual ~UIMachineSettingsDisplay() RT_OVERRIDE;
|
---|
65 |
|
---|
66 | /** Defines @a comGuestOSType. */
|
---|
67 | void setGuestOSTypeId(const QString &strGuestOSTypeId);
|
---|
68 |
|
---|
69 | #ifdef VBOX_WITH_3D_ACCELERATION
|
---|
70 | /** Returns whether 3D Acceleration is enabled. */
|
---|
71 | bool isAcceleration3DSelected() const;
|
---|
72 | #endif
|
---|
73 |
|
---|
74 | /** Returns recommended graphics controller type. */
|
---|
75 | KGraphicsControllerType graphicsControllerTypeRecommended() const;
|
---|
76 | /** Returns current graphics controller type. */
|
---|
77 | KGraphicsControllerType graphicsControllerTypeCurrent() const;
|
---|
78 |
|
---|
79 | protected:
|
---|
80 |
|
---|
81 | /** Returns whether the page content was changed. */
|
---|
82 | virtual bool changed() const RT_OVERRIDE;
|
---|
83 |
|
---|
84 | /** Loads settings from external object(s) packed inside @a data to cache.
|
---|
85 | * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
|
---|
86 | virtual void loadToCacheFrom(QVariant &data) RT_OVERRIDE;
|
---|
87 | /** Loads data from cache to corresponding widgets.
|
---|
88 | * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
|
---|
89 | virtual void getFromCache() RT_OVERRIDE;
|
---|
90 |
|
---|
91 | /** Saves data from corresponding widgets to cache.
|
---|
92 | * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
|
---|
93 | virtual void putToCache() RT_OVERRIDE;
|
---|
94 | /** Saves settings from cache to external object(s) packed inside @a data.
|
---|
95 | * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
|
---|
96 | virtual void saveFromCacheTo(QVariant &data) RT_OVERRIDE;
|
---|
97 |
|
---|
98 | /** Performs validation, updates @a messages list if something is wrong. */
|
---|
99 | virtual bool validate(QList<UIValidationMessage> &messages) RT_OVERRIDE;
|
---|
100 |
|
---|
101 | /** Defines TAB order for passed @a pWidget. */
|
---|
102 | virtual void setOrderAfter(QWidget *pWidget) RT_OVERRIDE;
|
---|
103 |
|
---|
104 | /** Handles translation event. */
|
---|
105 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
106 |
|
---|
107 | /** Handles filter change. */
|
---|
108 | virtual void handleFilterChange() RT_OVERRIDE;
|
---|
109 |
|
---|
110 | /** Performs final page polishing. */
|
---|
111 | virtual void polishPage() RT_OVERRIDE;
|
---|
112 |
|
---|
113 | private slots:
|
---|
114 |
|
---|
115 | /** Handles monitor count change. */
|
---|
116 | void sltHandleMonitorCountChange();
|
---|
117 | /** Handles Graphics Controller combo change. */
|
---|
118 | void sltHandleGraphicsControllerComboChange();
|
---|
119 | #ifdef VBOX_WITH_3D_ACCELERATION
|
---|
120 | /** Handles 3D Acceleration feature state change. */
|
---|
121 | void sltHandle3DAccelerationFeatureStateChange();
|
---|
122 | #endif
|
---|
123 |
|
---|
124 | private:
|
---|
125 |
|
---|
126 | /** Prepares all. */
|
---|
127 | void prepare();
|
---|
128 | /** Prepares widgets. */
|
---|
129 | void prepareWidgets();
|
---|
130 | /** Prepares 'Screen' tab. */
|
---|
131 | void prepareTabScreen();
|
---|
132 | /** Prepares 'Remote Display' tab. */
|
---|
133 | void prepareTabRemoteDisplay();
|
---|
134 | /** Prepares 'Recording' tab. */
|
---|
135 | void prepareTabRecording();
|
---|
136 | /** Prepares connections. */
|
---|
137 | void prepareConnections();
|
---|
138 | /** Cleanups all. */
|
---|
139 | void cleanup();
|
---|
140 |
|
---|
141 | /** Returns whether the VRAM requirements are important. */
|
---|
142 | bool shouldWeWarnAboutLowVRAM();
|
---|
143 |
|
---|
144 | /** Updates guest-screen count. */
|
---|
145 | void updateGuestScreenCount();
|
---|
146 | /** Saves existing data from cache. */
|
---|
147 | bool saveData();
|
---|
148 | /** Saves existing 'Screen' data from cache. */
|
---|
149 | bool saveScreenData();
|
---|
150 | /** Saves existing 'Remote Display' data from cache. */
|
---|
151 | bool saveRemoteDisplayData();
|
---|
152 | /** Saves existing 'Recording' data from cache. */
|
---|
153 | bool saveRecordingData();
|
---|
154 |
|
---|
155 | /** Updates minimum layout hint. */
|
---|
156 | void updateMinimumLayoutHint();
|
---|
157 |
|
---|
158 | /** Holds the guest OS type. */
|
---|
159 | QString m_strGuestOSTypeId;
|
---|
160 | #ifdef VBOX_WITH_3D_ACCELERATION
|
---|
161 | /** Holds whether the guest OS supports WDDM. */
|
---|
162 | bool m_fWddmModeSupported;
|
---|
163 | #endif
|
---|
164 | /** Holds recommended graphics controller type. */
|
---|
165 | KGraphicsControllerType m_enmGraphicsControllerTypeRecommended;
|
---|
166 |
|
---|
167 | /** Holds the page data cache instance. */
|
---|
168 | UISettingsCacheMachineDisplay *m_pCache;
|
---|
169 |
|
---|
170 | /** @name Widgets
|
---|
171 | * @{ */
|
---|
172 | /** Holds the tab-widget instance. */
|
---|
173 | QITabWidget *m_pTabWidget;
|
---|
174 |
|
---|
175 | /** Holds the 'Screen' tab instance. */
|
---|
176 | UIEditor *m_pTabScreen;
|
---|
177 | /** Holds the video memory size editor instance. */
|
---|
178 | UIVideoMemoryEditor *m_pEditorVideoMemorySize;
|
---|
179 | /** Holds the monitor count spinbox instance. */
|
---|
180 | UIMonitorCountEditor *m_pEditorMonitorCount;
|
---|
181 | /** Holds the scale factor editor instance. */
|
---|
182 | UIScaleFactorEditor *m_pEditorScaleFactor;
|
---|
183 | /** Holds the graphics controller editor instance. */
|
---|
184 | UIGraphicsControllerEditor *m_pEditorGraphicsController;
|
---|
185 | #ifdef VBOX_WITH_3D_ACCELERATION
|
---|
186 | /** Holds the display screen features editor instance. */
|
---|
187 | UIDisplayScreenFeaturesEditor *m_pEditorDisplayScreenFeatures;
|
---|
188 | #endif
|
---|
189 |
|
---|
190 | /** Holds the 'Remote Display' tab instance. */
|
---|
191 | UIEditor *m_pTabRemoteDisplay;
|
---|
192 | /** Holds the VRDE settings editor instance. */
|
---|
193 | UIVRDESettingsEditor *m_pEditorVRDESettings;
|
---|
194 |
|
---|
195 | /** Holds the 'Recording' tab instance. */
|
---|
196 | UIEditor *m_pTabRecording;
|
---|
197 | /** Holds the Recording settings editor instance. */
|
---|
198 | UIRecordingSettingsEditor *m_pEditorRecordingSettings;
|
---|
199 | /** @} */
|
---|
200 | };
|
---|
201 |
|
---|
202 | #endif /* !FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsDisplay_h */
|
---|