1 | /* $Id: UIGlobalSettingsUpdate.h 101053 2023-09-07 13:50:15Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIGlobalSettingsUpdate 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_UIGlobalSettingsUpdate_h
|
---|
29 | #define FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsUpdate_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UISettingsPage.h"
|
---|
36 | #include "UIUpdateDefs.h"
|
---|
37 |
|
---|
38 | /* Forward declarations: */
|
---|
39 | class UIUpdateSettingsEditor;
|
---|
40 | struct UIDataSettingsGlobalUpdate;
|
---|
41 | typedef UISettingsCache<UIDataSettingsGlobalUpdate> UISettingsCacheGlobalUpdate;
|
---|
42 |
|
---|
43 | /** Global settings: Update page. */
|
---|
44 | class SHARED_LIBRARY_STUFF UIGlobalSettingsUpdate : public UISettingsPageGlobal
|
---|
45 | {
|
---|
46 | Q_OBJECT;
|
---|
47 |
|
---|
48 | public:
|
---|
49 |
|
---|
50 | /** Constructs settings page. */
|
---|
51 | UIGlobalSettingsUpdate();
|
---|
52 | /** Destructs settings page. */
|
---|
53 | virtual ~UIGlobalSettingsUpdate() RT_OVERRIDE;
|
---|
54 |
|
---|
55 | protected:
|
---|
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 | /** Handles translation event. */
|
---|
75 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
76 |
|
---|
77 | private:
|
---|
78 |
|
---|
79 | /** Prepares all. */
|
---|
80 | void prepare();
|
---|
81 | /** Prepares widgets. */
|
---|
82 | void prepareWidgets();
|
---|
83 | /** Cleanups all. */
|
---|
84 | void cleanup();
|
---|
85 |
|
---|
86 | /** Saves existing data from cache. */
|
---|
87 | bool saveData();
|
---|
88 |
|
---|
89 | /** Holds the page data cache instance. */
|
---|
90 | UISettingsCacheGlobalUpdate *m_pCache;
|
---|
91 |
|
---|
92 | /** @name Widgets
|
---|
93 | * @{ */
|
---|
94 | /** Holds the 'update settings' editor instance. */
|
---|
95 | UIUpdateSettingsEditor *m_pEditorUpdateSettings;
|
---|
96 | /** @} */
|
---|
97 | };
|
---|
98 |
|
---|
99 | #endif /* !FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsUpdate_h */
|
---|