VirtualBox

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

Last change on this file was 104313, checked in by vboxsync, 2 months 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: UIGlobalSettingsLanguage.h 104313 2024-04-12 13:10:30Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIGlobalSettingsLanguage 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_UIGlobalSettingsLanguage_h
29#define FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsLanguage_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UISettingsPage.h"
36
37/* Forward declartions: */
38class UILanguageSettingsEditor;
39struct UIDataSettingsGlobalLanguage;
40typedef UISettingsCache<UIDataSettingsGlobalLanguage> UISettingsCacheGlobalLanguage;
41
42/** Global settings: Language page. */
43class SHARED_LIBRARY_STUFF UIGlobalSettingsLanguage : public UISettingsPageGlobal
44{
45 Q_OBJECT;
46
47public:
48
49 /** Constructs Language settings page. */
50 UIGlobalSettingsLanguage();
51 /** Destructs Language settings page. */
52 virtual ~UIGlobalSettingsLanguage() 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 /** Handles translation event. */
75 virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
76
77private:
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 UISettingsCacheGlobalLanguage *m_pCache;
91
92 /** @name Widgets
93 * @{ */
94 /** Holds the 'language settings' editor instance. */
95 UILanguageSettingsEditor *m_pEditorLanguageSettings;
96 /** @} */
97};
98
99#endif /* !FEQT_INCLUDED_SRC_settings_global_UIGlobalSettingsLanguage_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use