Manual for OpenFLUID 2.1.10

WaresSrcImportDialog.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30  */
31 
32 /**
33  @file WaresSrcImportDialog.hpp
34  @brief Header of ...
35 
36  @author Aline LIBRES <aline.libres@gmail.com>
37  */
38 
39 
40 #ifndef __OPENFLUID_UIWARESDEV_WARESSRCIMPORTDIALOG_HPP__
41 #define __OPENFLUID_UIWARESDEV_WARESSRCIMPORTDIALOG_HPP__
42 
43 
44 #include <QListWidget>
45 #include <QAbstractButton>
46 #include <QButtonGroup>
47 
48 #include <openfluid/dllexport.hpp>
49 #include <openfluid/ware/TypeDefs.hpp>
50 #include <openfluid/config.hpp>
52 
53 
54 namespace Ui {
55 class WaresSrcImportDialog;
56 }
57 
58 namespace openfluid { namespace waresdev {
59 class WaresDevImportPackage;
60 class WaresHubImportWorker;
61 } }
62 
63 
64 namespace openfluid { namespace ui { namespace waresdev {
65 
66 
68 {
69  Q_OBJECT
70 
71  private slots :
72 
73  bool check();
74 
75  void onSourceChanged(QAbstractButton* ClickedButton);
76 
77  void onPackagePathButtonClicked();
78 
79  void onWareshubConnectButtonClicked();
80 
81  void import();
82 
83 
84  private:
85 
86  Ui::WaresSrcImportDialog* ui;
87 
88  QButtonGroup m_SourceBtGroup;
89 
90  QString m_PackagePathLabelDefault = "<i>No package selected</i>";
91 
92  QList<QWidget*> m_WaresHubConnectionInfoWidgets;
93 
94  QString m_WaresHubButtonDisconnectLabel = tr("Disconnect");
95 
96  std::map<openfluid::ware::WareType, QListWidget*> m_ListWidgetsByWareType;
97 
98  std::map<QString, openfluid::ware::WareType> m_WareTypeConverter = {
99  { QString::fromStdString(openfluid::config::SIMULATORS_PATH), openfluid::ware::WareType::SIMULATOR },
100  { QString::fromStdString(openfluid::config::OBSERVERS_PATH), openfluid::ware::WareType::OBSERVER },
101  { QString::fromStdString(openfluid::config::BUILDEREXTS_PATH), openfluid::ware::WareType::BUILDEREXT } };
102 
103  openfluid::waresdev::WaresDevImportPackage* mp_ImportFilePkg = nullptr;
104 
105  openfluid::waresdev::WaresHubImportWorker* mp_WaresHubImportWorker = nullptr;
106 
107  QMap<openfluid::ware::WareType, QStringList> m_AlreadySelectedWaresHubWares;
108 
109  void updatePackageInfo();
110 
111  void updatePackageWaresList();
112 
113  void updateWaresHubWaresList();
114 
115  QStringList getSelectedWares();
116 
117  std::map<openfluid::ware::WareType, QStringList> getSelectedWaresByType();
118 
119 
120  public:
121 
122  explicit WaresSrcImportDialog(QWidget* Parent);
123 
125 
126 };
127 
128 
129 } } } //namespaces
130 
131 
132 #endif /* __OPENFLUID_UIWARESDEV_WARESSRCIMPORTDIALOG_HPP__ */
Definition: WaresHubImportWorker.hpp:56
Definition: ApplicationException.hpp:47
Definition: WaresSrcImportDialog.hpp:67
Definition: AboutDialog.hpp:50
Definition: WaresDevPackage.hpp:152
#define OPENFLUID_API
Definition: dllexport.hpp:86
Definition: MessageDialog.hpp:55