-
Notifications
You must be signed in to change notification settings - Fork 7
/
adaptorvym.cpp
59 lines (46 loc) · 1.12 KB
/
adaptorvym.cpp
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
#include <QtCore/QMetaObject>
#include <QtCore/QString>
#include <QtCore/QVariant>
#include "adaptorvym.h"
#include "command.h"
#include "mainwindow.h"
extern QString vymInstanceName;
extern QString vymVersion;
extern Main *mainWindow;
extern QList <Command*> vymCommands;
AdaptorVym::AdaptorVym(QObject *obj)
: QDBusAbstractAdaptor(obj)
{
setAutoRelaySignals (true);
}
QDBusVariant AdaptorVym::modelCount()
{
return QDBusVariant (mainWindow->modelCount() );
}
void AdaptorVym::gotoModel(const int &n)
{
mainWindow->gotoWindow (n);
}
QDBusVariant AdaptorVym::getInstanceName()
{
return QDBusVariant (vymInstanceName);
}
QDBusVariant AdaptorVym::getVersion()
{
return QDBusVariant (vymVersion);
}
QDBusVariant AdaptorVym::execute(const QString &s)
{
return QDBusVariant (mainWindow->runScript( s ) );
}
QDBusVariant AdaptorVym::listCommands ()
{
QStringList list;
foreach(Command *command, vymCommands)
list << command->getName();
return QDBusVariant (list.join(",") );
}
QDBusVariant AdaptorVym::currentMapIndex ()
{
return QDBusVariant (mainWindow->currentMapIndex() );
}