swift
copysettingsandcachescomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_GUI_COMPONENTS_COPYSETTINGSANDCACHESCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_COPYSETTINGSANDCACHESCOMPONENT_H
8 
9 #include <QCheckBox>
10 #include <QList>
11 #include <QScopedPointer>
12 #include <QWizardPage>
13 
18 #include "core/data/vatsimsetup.h"
24 #include "gui/swiftguiexport.h"
25 #include "misc/applicationinfo.h"
27 #include "misc/directories.h"
34 
35 namespace Ui
36 {
37  class CCopySettingsAndCachesComponent;
38 }
39 namespace swift::gui::components
40 {
45  {
46  Q_OBJECT
47 
48  public:
50  explicit CCopySettingsAndCachesComponent(QWidget *parent = nullptr);
51 
54 
56  void reloadOtherVersions(int deferMs = -1);
57 
58  private:
60  void onOtherVersionChanged(const swift::misc::CApplicationInfo &info);
61 
63  void initAll();
64 
66  void initAudio();
67 
69  void initNetwork();
70 
72  void initUi();
73 
75  void initSimulator();
76 
78  void initMisc();
79 
81  void initModel();
82 
84  int copy();
85 
87  void selectAll();
88 
90  void deselectAll();
91 
93  QList<QCheckBox *> checkBoxes() const;
94 
96  bool parsingMessage(bool success, const QString &msg, const QString &value);
97 
99  void displayStatusMessage(const swift::misc::CStatusMessage &msg, const QString &value);
100 
102  void allCheckBoxesReadOnly();
103 
105  static void readOnlyCheckbox(QCheckBox *cb, bool readOnly);
106 
108  static QString checkBoxText(const QString &text, bool setting);
109 
111 
112  swift::misc::CSetting<swift::core::audio::TInputDevice> m_settingsAudioInputDevice { this };
113  swift::misc::CSetting<swift::core::audio::TOutputDevice> m_settingsAudioOutputDevice { this };
114  swift::misc::CSetting<settings::TGeneralGui> m_settingsGuiGeneral { this };
115  swift::misc::CSetting<settings::TDockWidget> m_settingsDockWidget { this };
116  swift::misc::CSetting<settings::TViewUpdateSettings> m_settingsViewUpdate { this };
118  this
119  };
120  swift::misc::CSetting<settings::TextMessageSettings> m_settingsTextMessage { this };
121  swift::misc::CSetting<swift::core::application::TEnabledSimulators> m_settingsEnabledSimulators { this };
127  this
128  };
130  this
131  };
133 
135  this
136  };
137  swift::misc::CData<swift::core::data::TLauncherSetup> m_cacheLauncherSetup { this };
138  swift::misc::CData<swift::core::data::TVatsimSetup> m_cacheVatsimSetup { this };
140  this
141  };
143  this
144  };
146  this
147  };
149  this
150  };
151  };
152 
157  {
158  public:
161 
163  void setConfigComponent(CCopySettingsAndCachesComponent *config) { m_copyCachesAndSettings = config; }
164 
166  void initializePage() override;
167 
169  bool validatePage() override;
170 
171  private:
172  CCopySettingsAndCachesComponent *m_copyCachesAndSettings = nullptr;
173  };
174 } // namespace swift::gui::components
175 
176 #endif // SWIFT_GUI_COMPONENTS_COPYSETTINGSANDCACHESCOMPONENT_H
Using this class provides a QFrame with the overlay functionality already integrated.
void setConfigComponent(CCopySettingsAndCachesComponent *config)
Set config.
Description of a swift application.
Streamable status message, e.g.
High level reusable GUI components.
Definition: aboutdialog.cpp:14
Q_OBJECTQ_OBJECT
QObject * parent() const const
QWizardPage(QWidget *parent)