~ubuntu-branches/ubuntu/vivid/qtcreator-plugin-ubuntu/vivid

« back to all changes in this revision

Viewing changes to src/ubuntu/ubuntupackagingmodel.h

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Benjamin Zeller
  • Date: 2015-01-30 06:05:59 UTC
  • mfrom: (1.1.81)
  • Revision ID: package-import@ubuntu.com-20150130060559-1kirdtmm6bl6eb26
Tags: 3.1.1+15.04.20150130-0ubuntu1
[ Benjamin Zeller ]
Refactoring of the publish Tab

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2014 Canonical Ltd.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 *
 
16
 * Author: Benjamin Zeller <benjamin.zeller@canonical.com>
 
17
 */
 
18
 
 
19
#ifndef UBUNTUPACKAGINGWIDGET_H
 
20
#define UBUNTUPACKAGINGWIDGET_H
 
21
 
 
22
#include <QWidget>
 
23
#include <QProcess>
 
24
#include <QAbstractListModel>
 
25
#include <QPointer>
 
26
#include "ubuntubzr.h"
 
27
#include "ubuntuclickmanifest.h"
 
28
#include "ubuntuprocess.h"
 
29
 
 
30
#include <projectexplorer/buildstep.h>
 
31
 
 
32
namespace Ui {
 
33
class UbuntuPackagingWidget;
 
34
}
 
35
 
 
36
namespace Ubuntu{
 
37
namespace Internal{
 
38
class UbuntuValidationResultModel;
 
39
class ClickRunChecksParser;
 
40
 
 
41
class UbuntuPackagingModel : public QObject
 
42
{
 
43
    Q_OBJECT
 
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)
 
48
 
 
49
public:
 
50
 
 
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
 
55
    };
 
56
 
 
57
    explicit UbuntuPackagingModel(QObject *parent = 0);
 
58
    ~UbuntuPackagingModel();
 
59
 
 
60
    bool reviewToolsInstalled ();
 
61
    bool showValidationUi() const;
 
62
    bool canBuild() const;
 
63
    QAbstractItemModel* validationModel() const;
 
64
    QString log() const;
 
65
 
 
66
public slots:
 
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);
 
75
 
 
76
protected slots:
 
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);
 
82
 
 
83
    void checkClickReviewerTool();
 
84
    void buildFinished (const bool success);
 
85
    void buildPackageRequested();
 
86
    void targetChanged();
 
87
 
 
88
signals:
 
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();
 
95
 
 
96
private:
 
97
    void buildClickPackage ();
 
98
    void clearPackageBuildList ();
 
99
    void updateFrameworkList ();
 
100
    void resetValidationResult ();
 
101
 
 
102
private:
 
103
    bool m_reviewToolsInstalled;
 
104
    QMetaObject::Connection m_UbuntuMenu_connection;
 
105
    QProcess m_click;
 
106
    QString m_projectName;
 
107
    QString m_projectDir;
 
108
    QString m_reply;
 
109
    QString m_reviewesToolsLocation;
 
110
    UbuntuProcess m_ubuntuProcess;
 
111
    UbuntuValidationResultModel *m_validationModel;
 
112
    ClickRunChecksParser* m_inputParser;
 
113
 
 
114
    //packaging support with buildsteps
 
115
    QSharedPointer<ProjectExplorer::BuildStepList> m_packageBuildSteps;
 
116
    QMetaObject::Connection m_buildManagerConnection;
 
117
    ClickPackageTask m_postPackageTask;
 
118
    bool m_showValidationUi;
 
119
    bool m_canBuild;
 
120
    QString m_log;
 
121
};
 
122
 
 
123
 
 
124
}
 
125
}
 
126
 
 
127
 
 
128
#endif // UBUNTUPACKAGINGWIDGET_H