Changeset View
Changeset View
Standalone View
Standalone View
src/backends/R/rvariablemodel.h
- This file was copied from src/backends/python/pythonserver.h.
Show All 9 Lines | 1 | /* | |||
---|---|---|---|---|---|
10 | GNU General Public License for more details. | 10 | GNU General Public License for more details. | ||
11 | 11 | | |||
12 | You should have received a copy of the GNU General Public License | 12 | You should have received a copy of the GNU General Public License | ||
13 | along with this program; if not, write to the Free Software | 13 | along with this program; if not, write to the Free Software | ||
14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, | 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
15 | Boston, MA 02110-1301, USA. | 15 | Boston, MA 02110-1301, USA. | ||
16 | 16 | | |||
17 | --- | 17 | --- | ||
18 | Copyright (C) 2015 Minh Ngo <minh@fedoraproject.org> | 18 | Copyright (C) 2018 Nikita Sirgienko <warquark@gmail.com> | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef _PYTHONSERVER_H | 21 | #ifndef _RVARIABLEMODEL_H | ||
22 | #define _PYTHONSERVER_H | 22 | #define _RVARIABLEMODEL_H | ||
23 | #include <QObject> | | |||
24 | #include <QString> | | |||
25 | 23 | | |||
26 | struct _object; | 24 | #include "defaultvariablemodel.h" | ||
asemke: whitespace? | |||||
27 | using PyObject = _object; | | |||
28 | 25 | | |||
29 | class PythonServer : public QObject | 26 | class RSession; | ||
27 | | ||||
28 | class RVariableModel : public Cantor::DefaultVariableModel | ||||
30 | { | 29 | { | ||
31 | Q_OBJECT | 30 | Q_OBJECT | ||
32 | public: | 31 | public: | ||
33 | explicit PythonServer(QObject* parent = nullptr); | 32 | RVariableModel( RSession* session); | ||
33 | ~RVariableModel() override = default; | ||||
34 | | ||||
35 | void update() override; | ||||
36 | void clearFunctions(); | ||||
37 | | ||||
38 | Q_SIGNALS: | ||||
39 | void functionsAdded(const QStringList& names); | ||||
asemke: can the signals be made part of the base class? | |||||
40 | void functionsRemoved(const QStringList& names); | ||||
34 | 41 | | |||
35 | public Q_SLOTS: | 42 | public Q_SLOTS: | ||
36 | Q_SCRIPTABLE void login(); | 43 | void parseResult(const QStringList& names, const QStringList& values, const QStringList& funcs); | ||
37 | Q_SCRIPTABLE void setFilePath(const QString& path); | | |||
38 | Q_SCRIPTABLE void runPythonCommand(const QString& command) const; | | |||
39 | Q_SCRIPTABLE QString getOutput() const; | | |||
40 | Q_SCRIPTABLE QString getError() const; | | |||
41 | 44 | | |||
42 | private: | 45 | private: | ||
43 | PyObject* m_pModule; | 46 | QStringList m_functions; | ||
44 | QString filePath; | | |||
45 | }; | 47 | }; | ||
46 | 48 | | |||
47 | #endif | 49 | #endif /* _RVARIABLEMODEL_H */ |
whitespace?