~kalikiana/ubuntu-sdk-ide/nondesktopsnapcraft

« back to all changes in this revision

Viewing changes to dist/qtcreator/src/plugins/ubuntu/src/ubuntu/snap/project/snaprunconfiguration.h

  • Committer: Tarmac
  • Author(s): Benjamin Zeller
  • Date: 2016-11-07 12:08:43 UTC
  • mfrom: (161.1.6 ubuntu-sdk-ide)
  • Revision ID: tarmac-20161107120843-3rj83ckfgvkay0s2
- Support running snapcraft projects from the IDE
- Patch RunControlFactories to disable unwanted RC modes for snapcraft projects.

Approved by ubuntu-sdk-build-bot, Zoltan Balogh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef UBUNTU_INTERNAL_SNAPRUNCONFIGURATION_H
 
2
#define UBUNTU_INTERNAL_SNAPRUNCONFIGURATION_H
 
3
 
 
4
#include "snaprunconfigurationfactory.h"
 
5
 
 
6
#include <projectexplorer/runconfiguration.h>
 
7
#include <utils/fileutils.h>
 
8
 
 
9
#include <QStringList>
 
10
 
 
11
class QComboBox;
 
12
 
 
13
namespace Utils {
 
14
    class PathChooser;
 
15
}
 
16
 
 
17
namespace ProjectExplorer {
 
18
    class WorkingDirectoryAspect;
 
19
    class ArgumentsAspect;
 
20
    class TerminalAspect;
 
21
    class LocalEnvironmentAspect;
 
22
}
 
23
 
 
24
namespace Ubuntu {
 
25
namespace Internal {
 
26
 
 
27
class SnapcraftStep;
 
28
 
 
29
class SnapRunConfiguration : public ProjectExplorer::RunConfiguration
 
30
{
 
31
    Q_OBJECT
 
32
    friend class SnapRunConfigurationFactory;
 
33
protected:
 
34
    SnapRunConfiguration(ProjectExplorer::Target *parent);
 
35
    SnapRunConfiguration(ProjectExplorer::Target *parent, SnapRunConfiguration *source);
 
36
 
 
37
public:
 
38
 
 
39
    QString command () const;
 
40
    void setCommand (const QString &command);
 
41
 
 
42
    // ProjectConfiguration interface
 
43
    virtual bool fromMap(const QVariantMap &map) override;
 
44
    virtual QVariantMap toMap() const override;
 
45
 
 
46
    // RunConfiguration interface
 
47
    virtual bool isEnabled() const override;
 
48
    virtual QString disabledReason() const override;
 
49
    virtual QWidget *createConfigurationWidget() override;
 
50
    virtual ProjectExplorer::Runnable runnable() const override;
 
51
 
 
52
private:
 
53
    SnapcraftStep *activeSnapcraftStep() const;
 
54
    void updateCommandList(const QStringList &commands);
 
55
    void updateConfiguration();
 
56
 
 
57
private:
 
58
    QString m_command;
 
59
    QMetaObject::Connection m_currBuildConfConn;
 
60
    ProjectExplorer::WorkingDirectoryAspect* m_workingDirectoryAspect;
 
61
    ProjectExplorer::ArgumentsAspect* m_argumentAspect;
 
62
    ProjectExplorer::TerminalAspect* m_terminalAspect;
 
63
    ProjectExplorer::LocalEnvironmentAspect* m_localEnvironmentAspect;
 
64
};
 
65
 
 
66
class SnapRunConfigurationWidget : public QWidget
 
67
{
 
68
    Q_OBJECT
 
69
public:
 
70
    SnapRunConfigurationWidget(SnapRunConfiguration *config);
 
71
 
 
72
protected:
 
73
    void updateComboBox ();
 
74
 
 
75
protected slots:
 
76
    void commandSelected (const int index);
 
77
 
 
78
private:
 
79
    SnapRunConfiguration *m_rc;
 
80
    QComboBox *m_commandsBox;
 
81
    bool m_updating;
 
82
};
 
83
 
 
84
} // namespace Internal
 
85
} // namespace Ubuntu
 
86
 
 
87
#endif // UBUNTU_INTERNAL_SNAPRUNCONFIGURATION_H