-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbgstate.h
More file actions
41 lines (28 loc) · 904 Bytes
/
bgstate.h
File metadata and controls
41 lines (28 loc) · 904 Bytes
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
#ifndef BGSTATE_H
#define BGSTATE_H
#include <QObject>
#include <QString>
#include "sol.hpp"
class BGState : public QObject
{
Q_OBJECT
public:
explicit BGState(QObject *parent = nullptr);
//OUTPUT to console will be connected via signal from bgstate
enum Errors { SunShine = 0, LuaIsDead = -1, NoNetwork = -2, NoPermissions = -3, NoIdea = -4 };
Q_ENUM(Errors)
Q_INVOKABLE Errors search(QString rockname, QString version, QString options);
Q_INVOKABLE Errors installRock(QString rockname, QString version, QString options);
signals:
void lrStdOut(QString value);
void lrError(QString value);
public slots:
private:
sol::state m_lua;
bool m_dead;
bool loadLuaRocks();
void addPackagePath(QString path);
void runScript(QString script);
// 'scripts\LuaRocks\luarocks.lua'
};
#endif // BGSTATE_H