forked from sehraf/Lua4RS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLua4RSWidget.h
95 lines (73 loc) · 2.62 KB
/
Lua4RSWidget.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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#ifndef LUA4RSWIDGET_H
#define LUA4RSWIDGET_H
#include <retroshare-gui/mainpage.h>
namespace Ui {
class Lua4RSWidget;
}
class QModelIndex;
class QTableWidgetItem;
class QTreeWidgetItem;
class LuaCore;
class LuaContainer;
class LuaList;
class Lua4RSWidget : public MainPage
{
Q_OBJECT
public:
explicit Lua4RSWidget(QWidget *parent = 0);
~Lua4RSWidget();
void disableOutput();
public slots:
void clearOutput();
void appendOutput(const std::string &s);
void appendOutput(const QString &s);
void appendLog(const std::string &s);
void appendLog(const QString &s);
private:
void setLuaCodes(LuaList* list);
void switchContainer(LuaContainer* container);
void newScript();
bool saveScript(bool showErrorMsg = true);
// checks whether things entered in GUI are sane (like name is not empry)
bool saneValues();
// all scripts helper
LuaContainer* allScriptsGetLuaContainerFromSelectedRow();
LuaContainer* allScriptsGetLuaContainerFromRow(const int row);
void allScriptsAddRow(LuaContainer* container);
// init the gui at startup and after a container switch
void cleanUi();
// this function will fill every form with it's corresponding values
void luaContainerToUi(LuaContainer* container);
// or the other way round
bool uiToLuaContainer(LuaContainer* container);
Ui::Lua4RSWidget *ui;
LuaCore* _lua;
LuaContainer* _activeContainer;
// needed for shutdown process (when gui is gone but things may still be running)
bool _disableOutput;
private slots:
void on_pb_run_clicked();
void on_pb_newscript_clicked();
void on_pb_editscript_clicked();
void on_pb_deletescript_clicked();
void on_pb_load_clicked();
void on_pb_save_clicked();
void on_cbx_enable_toggled(bool checked);
void on_cbx_timeconstraint_toggled(bool checked);
void on_tied_timefrom_editingFinished();
void on_tied_timeto_editingFinished();
void on_tw_allscripts_cellClicked(int row, int column);
void on_tw_allscripts_cellDoubleClicked(int row, int column);
void on_dd_everyunits_currentIndexChanged(int index);
void on_spb_everycount_editingFinished();
void on_pb_pastehint_released();
void on_tw_hints_itemDoubleClicked(QTreeWidgetItem *item, int column);
void on_spb_everycount_valueChanged(int arg1);
void on_rb_runonevent_toggled(bool checked);
void on_rb_once_toggled(bool checked);
void on_rb_startup_toggled(bool checked);
void on_rb_shutdown_toggled(bool checked);
void on_rb_every_toggled(bool checked);
void on_dd_events_currentIndexChanged(int index);
};
#endif // LUA4RSMAINWIDGET_H