swift
dbloaddatadialog.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_DBLOADDATADIALOG_H
7 #define SWIFT_GUI_COMPONENTS_DBLOADDATADIALOG_H
8 
9 #include <QAbstractButton>
10 #include <QDialog>
11 #include <QScopedPointer>
12 #include <QStringListModel>
13 #include <QUrl>
14 
15 #include "gui/swiftguiexport.h"
18 
19 namespace Ui
20 {
21  class CDbLoadDataDialog;
22 }
23 namespace swift::gui::components
24 {
28  class SWIFT_GUI_EXPORT CDbLoadDataDialog : public QDialog
29  {
30  Q_OBJECT
31 
32  public:
34  explicit CDbLoadDataDialog(QWidget *parent = nullptr);
35 
37  virtual ~CDbLoadDataDialog();
38 
40  bool newerOrEmptyEntitiesDetected(swift::misc::network::CEntityFlags::Entity loadEntities);
41 
42  private:
44  QStringListModel *entitiesModel() const;
45 
47  QStringList selectedEntities() const;
48 
50  void onButtonClicked(QAbstractButton *button);
51 
53  void onDataRead(swift::misc::network::CEntityFlags::Entity entity,
54  swift::misc::network::CEntityFlags::ReadState state, int number, const QUrl &url);
55 
57  void onEntityDownloadProgress(swift::misc::network::CEntityFlags::Entity entity, int logId, int progress,
58  qint64 current, qint64 max, const QUrl &url);
59 
61  void onRejected();
62 
64  void consolidate();
65 
66  QScopedPointer<Ui::CDbLoadDataDialog> ui;
67  swift::misc::network::CEntityFlags::Entity m_pendingEntities = swift::misc::network::CEntityFlags::NoEntity;
69  swift::misc::simulation::data::CModelCaches m_models { true, this };
70  int m_pendingEntitiesCount = -1;
71  bool m_consolidating = false;
72  bool m_autoConsolidate = false;
73  };
74 } // namespace swift::gui::components
75 
76 #endif // SWIFT_GUI_COMPONENTS_DBLOADDATADIALOG_H
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
#define SWIFT_GUI_EXPORT
Export a class or function from the library.