1 | /* $Id: UIAdvancedSettingsDialogSpecific.h 103803 2024-03-12 11:15:18Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIAdvancedSettingsDialogSpecific 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_UIAdvancedSettingsDialogSpecific_h
|
---|
29 | #define FEQT_INCLUDED_SRC_settings_UIAdvancedSettingsDialogSpecific_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UIAdvancedSettingsDialog.h"
|
---|
36 |
|
---|
37 | /* COM includes: */
|
---|
38 | #include "CConsole.h"
|
---|
39 | #include "CMachine.h"
|
---|
40 | #include "CSession.h"
|
---|
41 |
|
---|
42 | /* Forward declarations: */
|
---|
43 | class UIActionPool;
|
---|
44 |
|
---|
45 | /** UIAdvancedSettingsDialog extension encapsulating all the specific functionality of the Global Preferences. */
|
---|
46 | class SHARED_LIBRARY_STUFF UIAdvancedSettingsDialogGlobal : public UIAdvancedSettingsDialog
|
---|
47 | {
|
---|
48 | Q_OBJECT;
|
---|
49 |
|
---|
50 | public:
|
---|
51 |
|
---|
52 | /** Constructs settings dialog passing @a pParent to the base-class.
|
---|
53 | * @param strCategory Brings the name of category to be opened.
|
---|
54 | * @param strControl Brings the name of control to be focused. */
|
---|
55 | UIAdvancedSettingsDialogGlobal(QWidget *pParent,
|
---|
56 | const QString &strCategory = QString(),
|
---|
57 | const QString &strControl = QString());
|
---|
58 |
|
---|
59 | protected:
|
---|
60 |
|
---|
61 | /** Handles translation event. */
|
---|
62 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
63 |
|
---|
64 | /** Loads the dialog data. */
|
---|
65 | virtual bool load() RT_OVERRIDE;
|
---|
66 | /** Saves the dialog data. */
|
---|
67 | virtual void save() RT_OVERRIDE;
|
---|
68 |
|
---|
69 | /** Returns the dialog title extension. */
|
---|
70 | virtual QString titleExtension() const RT_OVERRIDE;
|
---|
71 | /** Returns the dialog title. */
|
---|
72 | virtual QString title() const RT_OVERRIDE;
|
---|
73 |
|
---|
74 | private:
|
---|
75 |
|
---|
76 | /** Prepares all. */
|
---|
77 | void prepare();
|
---|
78 |
|
---|
79 | /** Returns whether page with certain @a iPageId is available. */
|
---|
80 | bool isPageAvailable(int iPageId) const;
|
---|
81 | };
|
---|
82 |
|
---|
83 |
|
---|
84 | /** UIAdvancedSettingsDialog extension encapsulating all the specific functionality of the Machine Settings. */
|
---|
85 | class SHARED_LIBRARY_STUFF UIAdvancedSettingsDialogMachine : public UIAdvancedSettingsDialog
|
---|
86 | {
|
---|
87 | Q_OBJECT;
|
---|
88 |
|
---|
89 | public:
|
---|
90 |
|
---|
91 | /** Constructs settings dialog passing @a pParent to the base-class.
|
---|
92 | * @param uMachineId Brings the machine ID.
|
---|
93 | * @param pActionPool Brings the action pool instance.
|
---|
94 | * @param strCategory Brings the name of category to be opened.
|
---|
95 | * @param strControl Brings the name of control to be focused. */
|
---|
96 | UIAdvancedSettingsDialogMachine(QWidget *pParent,
|
---|
97 | const QUuid &uMachineId,
|
---|
98 | UIActionPool *pActionPool,
|
---|
99 | const QString &strCategory = QString(),
|
---|
100 | const QString &strControl = QString());
|
---|
101 |
|
---|
102 | /** Update machine stuff.
|
---|
103 | * @param uMachineId Brings the machine ID.
|
---|
104 | * @param strCategory Brings the name of category to be opened.
|
---|
105 | * @param strControl Brings the name of control to be focused. */
|
---|
106 | void setNewMachineId(const QUuid &uMachineId,
|
---|
107 | const QString &strCategory = QString(),
|
---|
108 | const QString &strControl = QString());
|
---|
109 |
|
---|
110 | protected:
|
---|
111 |
|
---|
112 | /** Handles translation event. */
|
---|
113 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
114 |
|
---|
115 | /** Loads the dialog data. */
|
---|
116 | virtual bool load() RT_OVERRIDE;
|
---|
117 | /** Saves the dialog data. */
|
---|
118 | virtual void save() RT_OVERRIDE;
|
---|
119 |
|
---|
120 | /** Returns the dialog title extension. */
|
---|
121 | virtual QString titleExtension() const RT_OVERRIDE;
|
---|
122 | /** Returns the dialog title. */
|
---|
123 | virtual QString title() const RT_OVERRIDE;
|
---|
124 |
|
---|
125 | /** Verifies data integrity between certain @a pSettingsPage and other pages. */
|
---|
126 | virtual void recorrelate(UISettingsPage *pSettingsPage) RT_OVERRIDE;
|
---|
127 |
|
---|
128 | protected slots:
|
---|
129 |
|
---|
130 | /** Handles category change to @a cId. */
|
---|
131 | virtual void sltCategoryChanged(int cId) RT_OVERRIDE;
|
---|
132 |
|
---|
133 | /** Handle serializartion finished. */
|
---|
134 | virtual void sltHandleSerializationFinished() RT_OVERRIDE;
|
---|
135 |
|
---|
136 | private slots:
|
---|
137 |
|
---|
138 | /** Handles session state change for machine with certain @a uMachineId to @a enmSessionState. */
|
---|
139 | void sltSessionStateChanged(const QUuid &uMachineId, const KSessionState enmSessionState);
|
---|
140 | /** Handles machine state change for machine with certain @a uMachineId to @a enmMachineState. */
|
---|
141 | void sltMachineStateChanged(const QUuid &uMachineId, const KMachineState enmMachineState);
|
---|
142 | /** Handles machine data change for machine with certain @a uMachineId. */
|
---|
143 | void sltMachineDataChanged(const QUuid &uMachineId);
|
---|
144 |
|
---|
145 | private:
|
---|
146 |
|
---|
147 | /** Prepares all. */
|
---|
148 | void prepare();
|
---|
149 |
|
---|
150 | /** Returns whether page with certain @a iPageId is available. */
|
---|
151 | bool isPageAvailable(int iPageId) const;
|
---|
152 |
|
---|
153 | /** Recalculates configuration access level. */
|
---|
154 | void updateConfigurationAccessLevel();
|
---|
155 |
|
---|
156 | /** Holds the machine ID. */
|
---|
157 | QUuid m_uMachineId;
|
---|
158 | /** Holds the action-pool reference. */
|
---|
159 | UIActionPool *m_pActionPool;
|
---|
160 |
|
---|
161 | /** Holds the session state. */
|
---|
162 | KSessionState m_enmSessionState;
|
---|
163 | /** Holds the machine state. */
|
---|
164 | KMachineState m_enmMachineState;
|
---|
165 |
|
---|
166 | /** Holds the session reference. */
|
---|
167 | CSession m_session;
|
---|
168 | /** Holds the machine reference. */
|
---|
169 | CMachine m_machine;
|
---|
170 | /** Holds the console reference. */
|
---|
171 | CConsole m_console;
|
---|
172 | };
|
---|
173 |
|
---|
174 |
|
---|
175 | #endif /* !FEQT_INCLUDED_SRC_settings_UIAdvancedSettingsDialogSpecific_h */
|
---|