VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.h@ 65684

Last change on this file since 65684 was 65684, checked in by vboxsync, 8 years ago

FE/Qt: Global preferences: General page: Integrate settings caching.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 3.3 KB
Line 
1/* $Id: UIGlobalSettingsGeneral.h 65684 2017-02-08 15:42:47Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIGlobalSettingsGeneral 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 ___UIGlobalSettingsGeneral_h___
19#define ___UIGlobalSettingsGeneral_h___
20
21/* GUI includes: */
22#include "UISettingsPage.h"
23#include "UIGlobalSettingsGeneral.gen.h"
24
25
26/** Global settings: General page data structure. */
27struct UIDataSettingsGlobalGeneral
28{
29 /** Constructs data. */
30 UIDataSettingsGlobalGeneral()
31 : m_strDefaultMachineFolder(QString())
32 , m_strVRDEAuthLibrary(QString())
33 , m_fHostScreenSaverDisabled(false)
34 {}
35
36 /** Returns whether the @a other passed data is equal to this one. */
37 bool equal(const UIDataSettingsGlobalGeneral &other) const
38 {
39 return true
40 && (m_strDefaultMachineFolder == other.m_strDefaultMachineFolder)
41 && (m_strVRDEAuthLibrary == other.m_strVRDEAuthLibrary)
42 && (m_fHostScreenSaverDisabled == other.m_fHostScreenSaverDisabled)
43 ;
44 }
45
46 /** Returns whether the @a other passed data is equal to this one. */
47 bool operator==(const UIDataSettingsGlobalGeneral &other) const { return equal(other); }
48 /** Returns whether the @a other passed data is different from this one. */
49 bool operator!=(const UIDataSettingsGlobalGeneral &other) const { return !equal(other); }
50
51 /** Holds the default machine folder path. */
52 QString m_strDefaultMachineFolder;
53 /** Holds the VRDE authentication library name. */
54 QString m_strVRDEAuthLibrary;
55 /** Holds whether host screen-saver should be disabled. */
56 bool m_fHostScreenSaverDisabled;
57};
58typedef UISettingsCache<UIDataSettingsGlobalGeneral> UISettingsCacheGlobalGeneral;
59
60
61/** Global settings: General page. */
62class UIGlobalSettingsGeneral : public UISettingsPageGlobal, public Ui::UIGlobalSettingsGeneral
63{
64 Q_OBJECT;
65
66public:
67
68 /* Constructor: */
69 UIGlobalSettingsGeneral();
70
71protected:
72
73 /* Load data to cache from corresponding external object(s),
74 * this task COULD be performed in other than GUI thread: */
75 void loadToCacheFrom(QVariant &data);
76 /* Load data to corresponding widgets from cache,
77 * this task SHOULD be performed in GUI thread only: */
78 void getFromCache();
79
80 /* Save data from corresponding widgets to cache,
81 * this task SHOULD be performed in GUI thread only: */
82 void putToCache();
83 /* Save data from cache to corresponding external object(s),
84 * this task COULD be performed in other than GUI thread: */
85 void saveFromCacheTo(QVariant &data);
86
87 /* Helper: Navigation stuff: */
88 void setOrderAfter(QWidget *pWidget);
89
90 /* Helper: Translation stuff: */
91 void retranslateUi();
92
93private:
94
95 /* Cache: */
96 UISettingsCacheGlobalGeneral m_cache;
97};
98
99#endif /* !___UIGlobalSettingsGeneral_h___ */
100
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