VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInterface.h@ 104158

Last change on this file since 104158 was 101053, checked in by vboxsync, 18 months ago

FE/Qt: bugref:10513: Tiny cleanup for Preferences dialog / editors.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.2 KB
Line 
1/* $Id: UIGlobalSettingsInterface.h 101053 2023-09-07 13:50:15Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIGlobalSettingsInterface 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_global_UIGlobalSettingsInterface_h
29#define FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsInterface_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 UIColorThemeEditor;
39struct UIDataSettingsGlobalInterface;
40typedef UISettingsCache<UIDataSettingsGlobalInterface> UISettingsCacheGlobalInterface;
41
42/** Global settings: User Interface page. */
43class SHARED_LIBRARY_STUFF UIGlobalSettingsInterface : public UISettingsPageGlobal
44{
45 Q_OBJECT;
46
47public:
48
49 /** Constructs User Interface settings page. */
50 UIGlobalSettingsInterface();
51 /** Destructs User Interface settings page. */
52 virtual ~UIGlobalSettingsInterface() RT_OVERRIDE;
53
54protected:
55
56 /** Returns whether the page content was changed. */
57 virtual bool changed() const RT_OVERRIDE;
58
59 /** Loads settings from external object(s) packed inside @a data to cache.
60 * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
61 virtual void loadToCacheFrom(QVariant &data) RT_OVERRIDE;
62 /** Loads data from cache to corresponding widgets.
63 * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
64 virtual void getFromCache() RT_OVERRIDE;
65
66 /** Saves data from corresponding widgets to cache.
67 * @note This task WILL be performed in the GUI thread only, all widget interactions here! */
68 virtual void putToCache() RT_OVERRIDE;
69 /** Saves settings from cache to external object(s) packed inside @a data.
70 * @note This task WILL be performed in other than the GUI thread, no widget interactions! */
71 virtual void saveFromCacheTo(QVariant &data) RT_OVERRIDE;
72
73 /** Handles translation event. */
74 virtual void retranslateUi() RT_OVERRIDE;
75
76private:
77
78 /** Prepares all. */
79 void prepare();
80 /** Prepares widgets. */
81 void prepareWidgets();
82 /** Cleanups all. */
83 void cleanup();
84
85 /** Saves existing data from cache. */
86 bool saveData();
87
88 /** Holds the page data cache instance. */
89 UISettingsCacheGlobalInterface *m_pCache;
90
91 /** @name Widgets
92 * @{ */
93 /** Holds the 'color theme' editor instance. */
94 UIColorThemeEditor *m_pEditorColorTheme;
95 /** @} */
96};
97
98#endif /* !FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsInterface_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette