-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvagrantinterface.h
50 lines (40 loc) · 1.18 KB
/
vagrantinterface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef VAGRANTINTERFACE_H
#define VAGRANTINTERFACE_H
#include <QObject>
#include <QScriptEngine>
#include <QScriptValueIterator>
#include <QSettings>
#include <QDir>
#include <QFile>
#include <QStringList>
#include <QtGui>
typedef struct {
QString name;
QString id;
} VagrantVirtualBoxMachineInfo;
typedef struct {
QList<VagrantVirtualBoxMachineInfo> registeredVmIds;
QString vagrantPath;
QString name;
bool valid;
} VagrantConfig;
class VagrantInterface : public QObject
{
Q_OBJECT
public:
explicit VagrantInterface(QObject *parent = 0);
QList<VagrantConfig> getVagrantSystems();
void initVagrant(QSettings *setting);
void saveVagrant(QSettings *setting);
bool addVagrantSystem(QString path);
void removeVagrantSystem(QString path);
VagrantConfig getByVirtualBoxId(QString id);
void executeCommand(QString id, QString command, QString cmd);
signals:
void vagrantSystemsUpdated(QList<VagrantConfig> systems);
public slots:
private:
QList<VagrantConfig> vagrantConfigs;
QList<VagrantVirtualBoxMachineInfo> parseVagrantCfg(QString file);
};
#endif // VAGRANTINTERFACE_H