VirtualBox

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

Last change on this file was 104313, checked in by vboxsync, 2 months 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: 3.7 KB
Line 
1/* $Id: UIGlobalSettingsGeneral.h 104313 2024-04-12 13:10:30Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIGlobalSettingsGeneral 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_global_UIGlobalSettingsGeneral_h
29#define FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsGeneral_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UISettingsPage.h"
36
37/* Forward declarations: */
38class UIDefaultMachineFolderEditor;
39class UIVRDEAuthLibraryEditor;
40struct UIDataSettingsGlobalGeneral;
41typedef UISettingsCache<UIDataSettingsGlobalGeneral> UISettingsCacheGlobalGeneral;
42
43/** Global settings: General page. */
44class SHARED_LIBRARY_STUFF UIGlobalSettingsGeneral : public UISettingsPageGlobal
45{
46 Q_OBJECT;
47
48public:
49
50 /** Constructs settings page. */
51 UIGlobalSettingsGeneral();
52 /** Destructs settings page. */
53 virtual ~UIGlobalSettingsGeneral() RT_OVERRIDE;
54
55protected:
56
57 /** Returns whether the page content was changed. */
58 virtual bool changed() const RT_OVERRIDE;
59
60 /** Loads settings from external object(s) packed inside @a data to cache.
61 * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
62 virtual void loadToCacheFrom(QVariant &data) RT_OVERRIDE;
63 /** Loads data from cache to corresponding widgets.
64 * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
65 virtual void getFromCache() RT_OVERRIDE;
66
67 /** Saves data from corresponding widgets to cache.
68 * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
69 virtual void putToCache() RT_OVERRIDE;
70 /** Saves settings from cache to external object(s) packed inside @a data.
71 * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
72 virtual void saveFromCacheTo(QVariant &data) RT_OVERRIDE;
73
74 /** Performs validation, updates @a messages list if something is wrong. */
75 virtual bool validate(QList<UIValidationMessage> &messages) RT_OVERRIDE;
76
77 /** Handles filter change. */
78 virtual void handleFilterChange() RT_OVERRIDE;
79
80private slots:
81
82 /** Handles translation event. */
83 virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
84
85private:
86
87 /** Prepares all. */
88 void prepare();
89 /** Prepares widgets. */
90 void prepareWidgets();
91 /** Cleanups all. */
92 void cleanup();
93
94 /** Saves existing data from cache. */
95 bool saveData();
96
97 /** Updates minimum layout hint. */
98 void updateMinimumLayoutHint();
99
100 /** Holds the page data cache instance. */
101 UISettingsCacheGlobalGeneral *m_pCache;
102
103 /** @name Widgets
104 * @{ */
105 /** Holds 'default machine folder' editor instance. */
106 UIDefaultMachineFolderEditor *m_pEditorDefaultMachineFolder;
107 /** Holds 'VRDE auth library' editor instance. */
108 UIVRDEAuthLibraryEditor *m_pEditorVRDEAuthLibrary;
109 /** @} */
110};
111
112#endif /* !FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsGeneral_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use