swift
copymodelsfromotherswiftversionscomponent.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_COPYMODELSFROMOTHERSWIFTVERSIONS_H
7 #define SWIFT_GUI_COMPONENTS_COPYMODELSFROMOTHERSWIFTVERSIONS_H
8 
9 #include <QFrame>
10 #include <QScopedPointer>
11 #include <QWizardPage>
12 
14 #include "misc/applicationinfo.h"
16 
17 namespace Ui
18 {
19  class CCopyModelsFromOtherSwiftVersionsComponent;
20 }
21 namespace swift::gui::components
22 {
27  {
28  Q_OBJECT
29 
30  public:
32  explicit CCopyModelsFromOtherSwiftVersionsComponent(QWidget *parent = nullptr);
33 
36 
38  void reloadOtherVersions(int deferMs = -1);
39 
40  private:
42  void copy();
43 
45  bool readDataFile(const QString &modelFile, swift::misc::simulation::CAircraftModelList &models,
46  const swift::misc::CApplicationInfo &otherVersion,
48 
50  bool confirmOverride(const QString &msg);
51 
53  void onVersionChanged(const swift::misc::CApplicationInfo &otherVersion);
54 
55  QScopedPointer<Ui::CCopyModelsFromOtherSwiftVersionsComponent> ui;
56 
57  // caches will be explicitly initialized in copy
58  swift::misc::simulation::data::CModelCaches m_modelCaches { false, this };
59  swift::misc::simulation::data::CModelSetCaches m_modelSetCaches { false, this };
60  };
61 
66  {
67  Q_OBJECT
68 
69  public:
71  using QWizardPage::QWizardPage;
72 
74  void setConfigComponent(CCopyModelsFromOtherSwiftVersionsComponent *config) { m_copyModels = config; }
75 
77  virtual void initializePage() override;
78 
80  virtual bool validatePage() override;
81 
82  private:
83  CCopyModelsFromOtherSwiftVersionsComponent *m_copyModels = nullptr;
84  };
85 } // namespace swift::gui::components
86 
87 #endif // SWIFT_GUI_COMPONENTS_COPYMODELSFROMOTHERSWIFTVERSIONS_H
Using this class provides a QFrame with the overlay functionality already integrated.
void setConfigComponent(CCopyModelsFromOtherSwiftVersionsComponent *config)
Set config.
Description of a swift application.
Value object encapsulating a list of aircraft models.
Simple hardcoded info about the corresponding simulator.
Definition: simulatorinfo.h:41
Bundle of caches for all simulators.
Definition: modelcaches.h:339
Bundle of caches for model sets of all simulators.
Definition: modelcaches.h:382
High level reusable GUI components.
Definition: aboutdialog.cpp:13