swift
dbautosimulatorstashingcomponent.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2016 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_DBAUTOSIMULATORSTASHINGCOMPONENT_H
7 #define SWIFT_GUI_COMPONENTS_DBAUTOSIMULATORSTASHINGCOMPONENT_H
8 
9 #include <QDialog>
10 #include <QScopedPointer>
11 
12 #include "core/progress.h"
14 #include "gui/swiftguiexport.h"
17 #include "misc/statusmessage.h"
18 
19 namespace Ui
20 {
21  class CDbAutoSimulatorStashingComponent;
22 }
23 namespace swift::gui::components
24 {
30  public QDialog,
33  {
34  Q_OBJECT
36 
37  public:
39  enum State
40  {
41  Idle,
42  Running,
43  Completed
44  };
45 
47  explicit CDbAutoSimulatorStashingComponent(QWidget *parent = nullptr);
48 
50  virtual ~CDbAutoSimulatorStashingComponent() override;
51 
53  bool isCompleted() const { return m_state == Completed; }
54 
56  virtual void updateProgressIndicator(int percent) override;
57 
58  public slots:
60  virtual void accept() override;
61 
63  virtual int exec() override;
64 
65  private:
67  void initGui();
68 
70  swift::gui::views::CAircraftModelView *currentModelView() const;
71 
73  void addStatusMessage(const swift::misc::CStatusMessage &msg);
74 
76  void addStatusMessages(const swift::misc::CStatusMessageList &msgs);
77 
79  void addStatusMessage(const swift::misc::CStatusMessage &msg,
81 
83  void tryToStash();
84 
85  QScopedPointer<Ui::CDbAutoSimulatorStashingComponent> ui;
86  State m_state = Idle;
88  };
89 } // namespace swift::gui::components
90 
91 #endif // SWIFT_GUI_COMPONENTS_DBAUTOSIMULATORSTASHINGCOMPONENT_H
Implementing class features a progress bar or something similar.
Definition: progress.h:16
Allows to automatically update models if found in own model set, but already existing for a sibling s...
Allows subcomponents to gain access to model component.
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
Aircraft model (used by another pilot, my models on disk)
Definition: aircraftmodel.h:71
Value object encapsulating a list of aircraft models.
High level reusable GUI components.
Definition: aboutdialog.cpp:13
#define SWIFT_GUI_EXPORT
Export a class or function from the library.