swift
installxswiftbuscomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2017 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_INSTALLXSWIFTBUSCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_INSTALLXSWIFTBUSCOMPONENT_H
8 
9 #include <QFileDialog>
10 #include <QNetworkReply>
11 #include <QScopedPointer>
12 #include <QWizard>
13 
16 #include "gui/loadindicator.h"
18 #include "misc/db/updateinfo.h"
21 
22 namespace Ui
23 {
24  class CInstallXSwiftBusComponent;
25 }
26 namespace swift::gui::components
27 {
32  {
33  Q_OBJECT
34 
35  public:
37  explicit CInstallXSwiftBusComponent(QWidget *parent = nullptr);
38 
41 
43  void setDefaultDownloadName(const QString &defaultDownload);
44 
45  private:
46  static constexpr std::chrono::milliseconds OverlayMsgTimeout { 5000 };
47 
48  QScopedPointer<Ui::CInstallXSwiftBusComponent> ui;
50  this
51  };
53  this, &CInstallXSwiftBusComponent::updatesChanged
54  };
56  this
57  };
58  const QFileDialog::Options m_fileDialogOptions { QFileDialog::ShowDirsOnly | QFileDialog::ReadOnly |
59  QFileDialog::DontResolveSymlinks };
60 
61  // the xSwiftBus artifacts
62  QString m_defaultDownloadName;
63  swift::misc::db::CArtifactList m_xSwiftBusArtifacts;
64 
66  void selectPluginDirectory();
67 
69  void selectDownloadDirectory();
70 
72  void installXSwiftBus();
73 
75  void triggerDownloadingOfXSwiftBusFile();
76 
78  void downloadedXSwiftBusFile(const swift::misc::CStatusMessage &status);
79 
81  swift::misc::network::CRemoteFile getRemoteFileSelected() const;
82 
84  QString downloadDir() const;
85 
87  QString xSwiftBusDir() const;
88 
90  bool existsDownloadDir() const;
91 
93  bool existsXSwiftBusPluginDir() const;
94 
96  QString getXPlanePluginDirectory() const;
97 
99  void updatesChanged();
100 
102  void openInstallDir();
103 
105  void openDownloadDir();
106  };
107 
111  class CInstallXSwiftBusWizardPage : public QWizardPage
112  {
113  Q_OBJECT
114 
115  public:
117  using QWizardPage::QWizardPage;
118 
120  void setConfigComponent(CInstallXSwiftBusComponent *config) { m_config = config; }
121 
123  virtual bool validatePage() override;
124 
125  private:
126  CInstallXSwiftBusComponent *m_config = nullptr;
127  };
128 } // namespace swift::gui::components
129 #endif // SWIFT_GUI_COMPONENTS_INSTALLXSWIFTBUSCOMPONENT_H
Enable widget class for load indicator.
Using this class provides a QFrame with the overlay functionality already integrated.
void setDefaultDownloadName(const QString &defaultDownload)
Set a default name for download.
CInstallXSwiftBusComponent(QWidget *parent=nullptr)
Default constructor.
Wizard page for CInstallXSwiftBusWizardPage.
void setConfigComponent(CInstallXSwiftBusComponent *config)
Set config.
Streamable status message, e.g.
High level reusable GUI components.
Definition: aboutdialog.cpp:13