blob: e5428185cea2c3eb9a200b380c1cda1b6bcfe7ce (
plain) (
blame)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
#ifndef VMCHOOSER_VSESSION_H_
#define VMCHOOSER_VSESSION_H_
#include <QString>
#include <QList>
#include <QDomDocument>
#include <QDir>
#include <QProcess>
#include "session.h"
#include "httpxmldownloader.h"
enum ImgType {
VMWARE,
VBOX,
OTHER
};
class VSession : public Session {
public:
bool init(const QString& xml, const QString& baseDirPath);
ImgType imgtype() const;
bool isActive() const;
bool isLocked() const;
bool isValid() const;
int priority() const;
QString shortDescription() const {
return getAttribute("short_description");
}
QString description() const {
return getAttribute("description");
}
QIcon icon() const;
QString os() const {
return getAttribute("os");
}
QString getAttribute(const QString& nodeName,
const QString& attribute = "param") const;
QList<QString> keywords() const;
bool containsKeywords(const QList<QString>& keywords) const;
QString getNodeText(const QString& nodeName) const;
void addNodeWithAttribute(const QString& nodeName,
const QString& value,
const QString& attribute = "param",
bool replace = true);
void addUserAndHostname();
void mergePoolXml();
QString toXml() const;
bool run() const;
int type() const;
bool operator<(const Session& other) const;
static QList<Session*> readXmlDir(const QString& path);
static QList<Session*> readXmlFile(const QString& filepath);
static void addSessionsAfterDownload(QNetworkReply* reply);
private:
QList<QString> keywords_;
QDomDocument doc_;
QString baseDirPath_;
QProcess *_process;
void readKeywords();
};
#endif /*VMCHOOSER_VSESSION_H_*/
|