VirtualBox

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

Last change on this file was 104313, checked in by vboxsync, 7 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: 3.3 KB
Line 
1/* $Id: UIGlobalSettingsInterface.h 104313 2024-04-12 13:10:30Z 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
73private slots:
74
75 /** Handles translation event. */
76 virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
77
78private:
79
80 /** Prepares all. */
81 void prepare();
82 /** Prepares widgets. */
83 void prepareWidgets();
84 /** Cleanups all. */
85 void cleanup();
86
87 /** Saves existing data from cache. */
88 bool saveData();
89
90 /** Holds the page data cache instance. */
91 UISettingsCacheGlobalInterface *m_pCache;
92
93 /** @name Widgets
94 * @{ */
95 /** Holds the 'color theme' editor instance. */
96 UIColorThemeEditor *m_pEditorColorTheme;
97 /** @} */
98};
99
100#endif /* !FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsInterface_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use