2
* Copyright 2014 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 2.1.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Author: Benjamin Zeller <benjamin.zeller@canonical.com>
19
#ifndef UBUNTUPACKAGINGWIDGET_H
20
#define UBUNTUPACKAGINGWIDGET_H
24
#include <QAbstractListModel>
26
#include "ubuntubzr.h"
27
#include "ubuntuclickmanifest.h"
28
#include "ubuntuprocess.h"
30
#include <projectexplorer/buildstep.h>
33
class UbuntuPackagingWidget;
38
class UbuntuValidationResultModel;
39
class ClickRunChecksParser;
41
class UbuntuPackagingModel : public QObject
44
Q_PROPERTY(bool showValidationUi READ showValidationUi WRITE setShowValidationUi NOTIFY showValidationUiChanged)
45
Q_PROPERTY(bool canBuild READ canBuild WRITE setCanBuild NOTIFY canBuildChanged)
46
Q_PROPERTY(QAbstractItemModel* validationModel READ validationModel NOTIFY validationModelChanged)
47
Q_PROPERTY(QString log READ log WRITE setLog NOTIFY logChanged)
51
enum ClickPackageTask {
52
None, //after the project has packaged do nothing
53
Verify, //after the project has packaged verify it
54
Install //after the project has packaged install it on the device
57
explicit UbuntuPackagingModel(QObject *parent = 0);
58
~UbuntuPackagingModel();
60
bool reviewToolsInstalled ();
61
bool showValidationUi() const;
62
bool canBuild() const;
63
QAbstractItemModel* validationModel() const;
67
void setShowValidationUi(bool arg);
68
void setCanBuild(bool arg);
69
void buildAndInstallPackageRequested ();
70
void buildAndVerifyPackageRequested();
71
void on_pushButtonClickPackage_clicked();
72
void on_pushButtonReviewersTools_clicked();
73
void setLog(QString arg);
74
void appendLog(QString arg);
77
void onMessage(QString msg);
78
void onFinished(QString cmd, int code);
79
void onError(QString msg);
80
void onStarted(QString);
81
void onFinishedAction(const QProcess* proc,QString cmd);
83
void checkClickReviewerTool();
84
void buildFinished (const bool success);
85
void buildPackageRequested();
89
void reviewToolsInstalledChanged(const bool& installed);
90
void showValidationUiChanged(bool arg);
91
void canBuildChanged(bool arg);
92
void validationModelChanged(QAbstractItemModel* arg);
93
void logChanged(QString arg);
94
void beginValidation();
97
void buildClickPackage ();
98
void clearPackageBuildList ();
99
void updateFrameworkList ();
100
void resetValidationResult ();
103
bool m_reviewToolsInstalled;
104
QMetaObject::Connection m_UbuntuMenu_connection;
106
QString m_projectName;
107
QString m_projectDir;
109
QString m_reviewesToolsLocation;
110
UbuntuProcess m_ubuntuProcess;
111
UbuntuValidationResultModel *m_validationModel;
112
ClickRunChecksParser* m_inputParser;
114
//packaging support with buildsteps
115
QSharedPointer<ProjectExplorer::BuildStepList> m_packageBuildSteps;
116
QMetaObject::Connection m_buildManagerConnection;
117
ClickPackageTask m_postPackageTask;
118
bool m_showValidationUi;
128
#endif // UBUNTUPACKAGINGWIDGET_H