All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WaresDevPackage.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 /**
34  @file WaresDevPackage.hpp
35  @brief Header of ...
36 
37  @author Aline LIBRES <aline.libres@gmail.com>
38  */
39 
40 
41 #ifndef __OPENFLUID_WARESDEV_WARESDEVPACKAGE_HPP__
42 #define __OPENFLUID_WARESDEV_WARESDEVPACKAGE_HPP__
43 
44 
45 #include <QString>
46 #include <QMap>
47 #include <QDir>
48 #include <QProcess>
49 
50 #include <openfluid/dllexport.hpp>
53 
54 
55 namespace openfluid { namespace waresdev {
56 
57 
58 class OPENFLUID_API WaresDevPackage: public QObject
59 {
60  Q_OBJECT
61 
62  private slots:
63 
64  void processStandardOutput();
65 
66  void processErrorOutput();
67 
68 
69  protected:
70 
71  static QString m_CMakeCmd;
72 
74 
75  QStringList m_WaresPaths;
76 
77  QString m_Packagers;
78 
80 
81  QString m_PackageName;
82 
84 
86 
87  QString m_ConfFilePath;
88 
89  QProcess* mp_Process = nullptr;
90 
91  WaresDevPackage(const QString& PackageFilePath, const QString& TempSubFolderName);
92 
93  void createAndLauchProcess(const QString& Command);
94 
95 
96  signals:
97 
98  void info(const QString& Message);
99 
100  void error(const QString& Message);
101 
102  void finished(bool Ok, const QString& Message);
103 
104  void progressed(int Value);
105 
106 
107  public:
108 
109  virtual ~WaresDevPackage();
110 
111  QStringList getWaresPaths();
112 
113  static bool checkCMakeProgram();
114 
115  QString getPackagers();
116 
117  QString getPackageDescription();
118 
119  QDir getPackageTempDir();
120 
121 };
122 
123 
124 // =====================================================================
125 // =====================================================================
126 
127 
129 {
130  Q_OBJECT
131 
132  private:
133 
134  void writeConfFile();
135 
136  void compress();
137 
138 
139  public slots:
140 
141  void exportToPackage();
142 
143 
144  public:
145 
146  WaresDevExportPackage(const QString& PackageFilePath, const QStringList& WaresPaths,
147  const QString& Packagers, const QString& PackageDescription);
148 
149 };
150 
151 
152 // =====================================================================
153 // =====================================================================
154 
155 
157 {
158  Q_OBJECT
159 
160  private:
161 
162  QStringList m_SelectedWarePaths;
163 
164  void uncompress();
165 
166  void readConfFile();
167 
168 
169  public slots:
170 
171  void fetchInformation();
172 
173  void copyWares();
174 
175 
176  public:
177 
178  WaresDevImportPackage(const QString& PackageFilePath);
179 
180  void setSelectedWares(const QStringList& SelectedWarePaths);
181 
182 };
183 
184 
185 } } // namespaces
186 
187 
188 #endif /* __OPENFLUID_WARESDEV_WARESDEVPACKAGE_HPP__ */
QString m_PackageFilePath
Definition: WaresDevPackage.hpp:73
Header of ...
Definition: WaresDevPackage.hpp:128
QString m_PackageDescription
Definition: WaresDevPackage.hpp:79
QStringList m_WaresPaths
Definition: WaresDevPackage.hpp:75
QDir m_PackageTempDir
Definition: WaresDevPackage.hpp:83
#define OPENFLUID_API
Definition: dllexport.hpp:87
static QString m_CMakeCmd
Definition: WaresDevPackage.hpp:71
Definition: WaresDevPackage.hpp:58
QString m_PackageName
Definition: WaresDevPackage.hpp:81
QString m_Packagers
Definition: WaresDevPackage.hpp:77
QString m_ConfFilePath
Definition: WaresDevPackage.hpp:87
QString m_PackageTempPath
Definition: WaresDevPackage.hpp:85
Definition: WaresDevPackage.hpp:156