VirtualBox

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

Last change on this file since 104158 was 101241, checked in by vboxsync, 17 months ago

FE/Qt: bugref:10513: Global Preferences: A bit of cleanup for Input and Proxy pages.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/* $Id: UIGlobalSettingsProxy.h 101241 2023-09-22 15:40:32Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIGlobalSettingsProxy class declaration.
4 */
5
6/*
7 * Copyright (C) 2011-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_UIGlobalSettingsProxy_h
29#define FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsProxy_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UISettingsPage.h"
36#include "VBoxUtils.h"
37
38/* Forward declarations: */
39class UIProxyFeaturesEditor;
40struct UIDataSettingsGlobalProxy;
41typedef UISettingsCache<UIDataSettingsGlobalProxy> UISettingsCacheGlobalProxy;
42
43/** Global settings: Proxy page. */
44class SHARED_LIBRARY_STUFF UIGlobalSettingsProxy : public UISettingsPageGlobal
45{
46 Q_OBJECT;
47
48public:
49
50 /** Constructs Proxy settings page. */
51 UIGlobalSettingsProxy();
52 /** Destructs Proxy settings page. */
53 virtual ~UIGlobalSettingsProxy() 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 translation event. */
78 virtual void retranslateUi() RT_OVERRIDE;
79
80private:
81
82 /** Prepares all. */
83 void prepare();
84 /** Prepares wıdgets. */
85 void prepareWidgets();
86 /** Cleanups all. */
87 void cleanup();
88
89 /** Saves existing data from cache. */
90 bool saveData();
91
92 /** Holds the page data cache instance. */
93 UISettingsCacheGlobalProxy *m_pCache;
94
95 /** @name Widgets
96 * @{ */
97 /** Holds the 'proxy features' editor instance. */
98 UIProxyFeaturesEditor *m_pEditorProxyFeatures;
99 /** @} */
100};
101
102#endif /* !FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsProxy_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