VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialogSpecific.h

Last change on this file was 104313, checked in by vboxsync, 6 weeks ago

FE/Qt. bugref:10622. Using new UITranslationEventListener in the settings related GUI classes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.0 KB
Line 
1/* $Id: UIAdvancedSettingsDialogSpecific.h 104313 2024-04-12 13:10:30Z 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: */
43class UIActionPool;
44
45/** UIAdvancedSettingsDialog extension encapsulating all the specific functionality of the Global Preferences. */
46class SHARED_LIBRARY_STUFF UIAdvancedSettingsDialogGlobal : public UIAdvancedSettingsDialog
47{
48 Q_OBJECT;
49
50public:
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
59protected:
60
61 /** Loads the dialog data. */
62 virtual bool load() RT_OVERRIDE;
63 /** Saves the dialog data. */
64 virtual void save() RT_OVERRIDE;
65
66 /** Returns the dialog title extension. */
67 virtual QString titleExtension() const RT_OVERRIDE;
68 /** Returns the dialog title. */
69 virtual QString title() const RT_OVERRIDE;
70
71private slots:
72
73 /** Handles translation event. */
74 virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
75
76private:
77
78 /** Prepares all. */
79 void prepare();
80
81 /** Returns whether page with certain @a iPageId is available. */
82 bool isPageAvailable(int iPageId) const;
83};
84
85
86/** UIAdvancedSettingsDialog extension encapsulating all the specific functionality of the Machine Settings. */
87class SHARED_LIBRARY_STUFF UIAdvancedSettingsDialogMachine : public UIAdvancedSettingsDialog
88{
89 Q_OBJECT;
90
91public:
92
93 /** Constructs settings dialog passing @a pParent to the base-class.
94 * @param uMachineId Brings the machine ID.
95 * @param pActionPool Brings the action pool instance.
96 * @param strCategory Brings the name of category to be opened.
97 * @param strControl Brings the name of control to be focused. */
98 UIAdvancedSettingsDialogMachine(QWidget *pParent,
99 const QUuid &uMachineId,
100 UIActionPool *pActionPool,
101 const QString &strCategory = QString(),
102 const QString &strControl = QString());
103
104 /** Update machine stuff.
105 * @param uMachineId Brings the machine ID.
106 * @param strCategory Brings the name of category to be opened.
107 * @param strControl Brings the name of control to be focused. */
108 void setNewMachineId(const QUuid &uMachineId,
109 const QString &strCategory = QString(),
110 const QString &strControl = QString());
111
112protected:
113
114 /** Loads the dialog data. */
115 virtual bool load() RT_OVERRIDE;
116 /** Saves the dialog data. */
117 virtual void save() RT_OVERRIDE;
118
119 /** Returns the dialog title extension. */
120 virtual QString titleExtension() const RT_OVERRIDE;
121 /** Returns the dialog title. */
122 virtual QString title() const RT_OVERRIDE;
123
124 /** Verifies data integrity between certain @a pSettingsPage and other pages. */
125 virtual void recorrelate(UISettingsPage *pSettingsPage) RT_OVERRIDE;
126
127protected slots:
128
129 /** Handles category change to @a cId. */
130 virtual void sltCategoryChanged(int cId) RT_OVERRIDE;
131
132 /** Handle serializartion finished. */
133 virtual void sltHandleSerializationFinished() RT_OVERRIDE;
134
135private slots:
136
137 /** Handles session state change for machine with certain @a uMachineId to @a enmSessionState. */
138 void sltSessionStateChanged(const QUuid &uMachineId, const KSessionState enmSessionState);
139 /** Handles machine state change for machine with certain @a uMachineId to @a enmMachineState. */
140 void sltMachineStateChanged(const QUuid &uMachineId, const KMachineState enmMachineState);
141 /** Handles machine data change for machine with certain @a uMachineId. */
142 void sltMachineDataChanged(const QUuid &uMachineId);
143 /** Handles translation event. */
144 virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
145
146private:
147
148 /** Prepares all. */
149 void prepare();
150
151 /** Returns whether page with certain @a iPageId is available. */
152 bool isPageAvailable(int iPageId) const;
153
154 /** Recalculates configuration access level. */
155 void updateConfigurationAccessLevel();
156
157 /** Holds the machine ID. */
158 QUuid m_uMachineId;
159 /** Holds the action-pool reference. */
160 UIActionPool *m_pActionPool;
161
162 /** Holds the session state. */
163 KSessionState m_enmSessionState;
164 /** Holds the machine state. */
165 KMachineState m_enmMachineState;
166
167 /** Holds the session reference. */
168 CSession m_session;
169 /** Holds the machine reference. */
170 CMachine m_machine;
171 /** Holds the console reference. */
172 CConsole m_console;
173};
174
175
176#endif /* !FEQT_INCLUDED_SRC_settings_UIAdvancedSettingsDialogSpecific_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use