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 
110  QScopedPointer<Ui::CCopySettingsAndCachesComponent> ui;
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  this
134  };
136  this
137  };
139 
141  this
142  };
143  swift::misc::CData<swift::core::data::TLauncherSetup> m_cacheLauncherSetup { this };
144  swift::misc::CData<swift::core::data::TVatsimSetup> m_cacheVatsimSetup { this };
146  this
147  };
149  this
150  };
152  this
153  };
155  this
156  };
157  };
158 
162  class CCopySettingsAndCachesWizardPage : public QWizardPage
163  {
164  public:
166  using QWizardPage::QWizardPage;
167 
169  void setConfigComponent(CCopySettingsAndCachesComponent *config) { m_copyCachesAndSettings = config; }
170 
172  virtual void initializePage() override;
173 
175  virtual bool validatePage() override;
176 
177  private:
178  CCopySettingsAndCachesComponent *m_copyCachesAndSettings = nullptr;
179  };
180 } // namespace swift::gui::components
181 
182 #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:13