1 | /* $Id: UIMachineSettingsInterface.h 101717 2023-11-02 12:22:25Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIMachineSettingsInterface 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_UIMachineSettingsInterface_h
|
---|
29 | #define FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsInterface_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 QLabel;
|
---|
39 | class UIActionPool;
|
---|
40 | class UIMenuBarEditorWidget;
|
---|
41 | class UIMiniToolbarSettingsEditor;
|
---|
42 | class UIStatusBarEditorWidget;
|
---|
43 | class UIVisualStateEditor;
|
---|
44 | struct UIDataSettingsMachineInterface;
|
---|
45 | typedef UISettingsCache<UIDataSettingsMachineInterface> UISettingsCacheMachineInterface;
|
---|
46 |
|
---|
47 | /** Machine settings: User Interface page. */
|
---|
48 | class SHARED_LIBRARY_STUFF UIMachineSettingsInterface : public UISettingsPageMachine
|
---|
49 | {
|
---|
50 | Q_OBJECT;
|
---|
51 |
|
---|
52 | public:
|
---|
53 |
|
---|
54 | /** Constructs User Interface settings page. */
|
---|
55 | UIMachineSettingsInterface(const QUuid &uMachineId);
|
---|
56 | /** Destructs User Interface settings page. */
|
---|
57 | virtual ~UIMachineSettingsInterface() RT_OVERRIDE;
|
---|
58 |
|
---|
59 | protected:
|
---|
60 |
|
---|
61 | /** Returns whether the page content was changed. */
|
---|
62 | virtual bool changed() const RT_OVERRIDE;
|
---|
63 |
|
---|
64 | /** Loads settings from external object(s) packed inside @a data to cache.
|
---|
65 | * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
|
---|
66 | virtual void loadToCacheFrom(QVariant &data) RT_OVERRIDE;
|
---|
67 | /** Loads data from cache to corresponding widgets.
|
---|
68 | * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
|
---|
69 | virtual void getFromCache() RT_OVERRIDE;
|
---|
70 |
|
---|
71 | /** Saves data from corresponding widgets to cache.
|
---|
72 | * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
|
---|
73 | virtual void putToCache() RT_OVERRIDE;
|
---|
74 | /** Saves settings from cache to external object(s) packed inside @a data.
|
---|
75 | * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
|
---|
76 | virtual void saveFromCacheTo(QVariant &data) RT_OVERRIDE;
|
---|
77 |
|
---|
78 | /** Handles translation event. */
|
---|
79 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
80 |
|
---|
81 | /** Handles filter change. */
|
---|
82 | virtual void handleFilterChange() RT_OVERRIDE;
|
---|
83 |
|
---|
84 | /** Performs final page polishing. */
|
---|
85 | virtual void polishPage() RT_OVERRIDE;
|
---|
86 |
|
---|
87 | private:
|
---|
88 |
|
---|
89 | /** Prepares all. */
|
---|
90 | void prepare();
|
---|
91 | /** Prepares widgets. */
|
---|
92 | void prepareWidgets();
|
---|
93 | /** Prepares connections. */
|
---|
94 | void prepareConnections();
|
---|
95 | /** Cleanups all. */
|
---|
96 | void cleanup();
|
---|
97 |
|
---|
98 | /** Saves existing data from cache. */
|
---|
99 | bool saveData();
|
---|
100 | /** Saves existing 'Menu-bar' data from cache. */
|
---|
101 | bool saveMenuBarData();
|
---|
102 | /** Saves existing 'Status-bar' data from cache. */
|
---|
103 | bool saveStatusBarData();
|
---|
104 | /** Saves existing 'Mini-toolbar' data from cache. */
|
---|
105 | bool saveMiniToolbarData();
|
---|
106 | /** Saves existing 'Visual State' data from cache. */
|
---|
107 | bool saveVisualStateData();
|
---|
108 |
|
---|
109 | /** Updates minimum layout hint. */
|
---|
110 | void updateMinimumLayoutHint();
|
---|
111 |
|
---|
112 | /** Holds the machine ID copy. */
|
---|
113 | const QUuid m_uMachineId;
|
---|
114 | /** Holds the action-pool instance. */
|
---|
115 | UIActionPool *m_pActionPool;
|
---|
116 |
|
---|
117 | /** Holds the page data cache instance. */
|
---|
118 | UISettingsCacheMachineInterface *m_pCache;
|
---|
119 |
|
---|
120 | /** @name Widgets
|
---|
121 | * @{ */
|
---|
122 | /** Holds the menu-bar editor instance. */
|
---|
123 | UIMenuBarEditorWidget *m_pEditorMenuBar;
|
---|
124 | /** Holds the visual state editor instance. */
|
---|
125 | UIVisualStateEditor *m_pEditorVisualState;
|
---|
126 | /** Holds the mini-toolbar settings editor instance. */
|
---|
127 | UIMiniToolbarSettingsEditor *m_pEditorMiniToolabSettings;
|
---|
128 | /** Holds the status-bar editor instance. */
|
---|
129 | UIStatusBarEditorWidget *m_pEditorStatusBar;
|
---|
130 | /** @} */
|
---|
131 | };
|
---|
132 |
|
---|
133 | #endif /* !FEQT_INCLUDED_SRC_settings_machine_UIMachineSettingsInterface_h */
|
---|