1 | /* $Id: UIGlobalSettingsUpdate.h 76532 2018-12-30 06:08:06Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIGlobalSettingsUpdate class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2017 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef ___UIGlobalSettingsUpdate_h___
|
---|
19 | #define ___UIGlobalSettingsUpdate_h___
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* GUI includes: */
|
---|
25 | #include "UISettingsPage.h"
|
---|
26 | #include "UIGlobalSettingsUpdate.gen.h"
|
---|
27 | #include "UIUpdateDefs.h"
|
---|
28 |
|
---|
29 | /* Forward declarations: */
|
---|
30 | struct UIDataSettingsGlobalUpdate;
|
---|
31 | typedef UISettingsCache<UIDataSettingsGlobalUpdate> UISettingsCacheGlobalUpdate;
|
---|
32 |
|
---|
33 | /** Global settings: Update page. */
|
---|
34 | class SHARED_LIBRARY_STUFF UIGlobalSettingsUpdate : public UISettingsPageGlobal,
|
---|
35 | public Ui::UIGlobalSettingsUpdate
|
---|
36 | {
|
---|
37 | Q_OBJECT;
|
---|
38 |
|
---|
39 | public:
|
---|
40 |
|
---|
41 | /** Constructs Update settings page. */
|
---|
42 | UIGlobalSettingsUpdate();
|
---|
43 | /** Destructs Update settings page. */
|
---|
44 | ~UIGlobalSettingsUpdate();
|
---|
45 |
|
---|
46 | protected:
|
---|
47 |
|
---|
48 | /** Loads data into the cache from corresponding external object(s),
|
---|
49 | * this task COULD be performed in other than the GUI thread. */
|
---|
50 | virtual void loadToCacheFrom(QVariant &data) /* override */;
|
---|
51 | /** Loads data into corresponding widgets from the cache,
|
---|
52 | * this task SHOULD be performed in the GUI thread only. */
|
---|
53 | virtual void getFromCache() /* override */;
|
---|
54 |
|
---|
55 | /** Saves data from corresponding widgets to the cache,
|
---|
56 | * this task SHOULD be performed in the GUI thread only. */
|
---|
57 | virtual void putToCache() /* override */;
|
---|
58 | /** Saves data from the cache to corresponding external object(s),
|
---|
59 | * this task COULD be performed in other than the GUI thread. */
|
---|
60 | virtual void saveFromCacheTo(QVariant &data) /* overrride */;
|
---|
61 |
|
---|
62 | /** Defines TAB order for passed @a pWidget. */
|
---|
63 | virtual void setOrderAfter(QWidget *pWidget) /* override */;
|
---|
64 |
|
---|
65 | /** Handles translation event. */
|
---|
66 | virtual void retranslateUi() /* override */;
|
---|
67 |
|
---|
68 | private slots:
|
---|
69 |
|
---|
70 | /** Handles whether update is @a fEnabled. */
|
---|
71 | void sltHandleUpdateToggle(bool fEnabled);
|
---|
72 | /** Handles update period change. */
|
---|
73 | void sltHandleUpdatePeriodChange();
|
---|
74 |
|
---|
75 | private:
|
---|
76 |
|
---|
77 | /** Prepares all. */
|
---|
78 | void prepare();
|
---|
79 | /** Cleanups all. */
|
---|
80 | void cleanup();
|
---|
81 |
|
---|
82 | /** Returns period type. */
|
---|
83 | VBoxUpdateData::PeriodType periodType() const;
|
---|
84 | /** Returns branch type. */
|
---|
85 | VBoxUpdateData::BranchType branchType() const;
|
---|
86 |
|
---|
87 | /** Saves existing update data from the cache. */
|
---|
88 | bool saveUpdateData();
|
---|
89 |
|
---|
90 | /** Holds the last checked button reference. */
|
---|
91 | QRadioButton *m_pLastChosenRadio;
|
---|
92 |
|
---|
93 | /** Holds the page data cache instance. */
|
---|
94 | UISettingsCacheGlobalUpdate *m_pCache;
|
---|
95 | };
|
---|
96 |
|
---|
97 | #endif /* !___UIGlobalSettingsUpdate_h___ */
|
---|