[Kstars-devel] KDE/kdeedu/kstars/kstars
Jasem Mutlaq
mutlaqja at ikarustech.com
Wed Aug 8 19:26:25 CEST 2007
SVN commit 697998 by mutlaqja:
Using XML for DBus interfaces, which autogenerates adaptors that are
used in the KStars and SimClock classes. The service name is
'org.kde.kstars' and the two objects thus far are /KStars and
/KStars/SimClock. There are plans to make INDI calls seperate, but I
intend to implement that in KDE 4.1
You can test this by launcing kstars, and then at konsole:
dbus-send --dest=org.kde.kstars --print-reply=x /KStars
org.kde.kstars.zoomOut
I have no idea why --print-reply is needed, but the call doesn't work
without it. Similary for SimClock:
dbus-send --dest=org.kde.kstars --print-reply=h /KStars/SimClock
org.kde.kstars.SimClock.stop
You can also use dbus-viewer to find all the available object paths and
corresponding methods.
CCMAIL:kstars-devel at kde.org
M +3 -0 CMakeLists.txt
M +5 -2 kstars.cpp
D kstarsinterface.h
A org.kde.kstars.SimClock.xml
A org.kde.kstars.xml
M +4 -1 simclock.cpp
D simclockinterface.h
--- trunk/KDE/kdeedu/kstars/kstars/CMakeLists.txt #697997:697998
@@ -187,6 +187,9 @@
toggleaction.cpp thumbnailpicker.cpp thumbnaileditor.cpp quaternion.cpp
)
+qt4_add_dbus_adaptor(kstars_SRCS org.kde.kstars.xml kstars.h KStars)
+qt4_add_dbus_adaptor(kstars_SRCS org.kde.kstars.SimClock.xml simclock.h SimClock)
+
set( kstars_KCFG_SRCS Options.kcfgc )
kde4_add_kcfg_files(kstars_SRCS ${kstars_KCFG_SRCS})
--- trunk/KDE/kdeedu/kstars/kstars/kstars.cpp #697997:697998
@@ -48,7 +48,8 @@
#include "imagesequence.h"
#include <toggleaction.h>
-// to remove warnings
+#include "kstarsadaptor.h"
+
#include "indimenu.h"
#include "indidriver.h"
@@ -60,7 +61,9 @@
DialogIsObsolete(false), StartClockRunning( clockrun ),
StartDateString( startdate )
{
- QDBusConnection::sessionBus().registerObject("/kstars", this, QDBusConnection::ExportScriptableSlots);
+ new KstarsAdaptor(this);
+ QDBusConnection::sessionBus().registerObject("/KStars", this);
+ QDBusConnection::sessionBus().registerService("org.kde.kstars");
connect( qApp, SIGNAL( aboutToQuit() ), this, SLOT( slotAboutToQuit() ) );
--- trunk/KDE/kdeedu/kstars/kstars/simclock.cpp #697997:697998
@@ -22,6 +22,7 @@
#include <klocale.h>
#include "kstars.h"
+#include "simclockadaptor.h"
int SimClock::idgen = 1;
@@ -31,7 +32,9 @@
QObject(parent),
tmr(this)
{
- QDBusConnection::sessionBus().registerObject("/kstars/SimClock", this, QDBusConnection::ExportScriptableSlots);
+ new SimClockAdaptor(this);
+ QDBusConnection::sessionBus().registerObject("/KStars/SimClock", this);
+
if (! when.isValid() ) tmr.stop();
setUTC(when);
julianmark = UTC.djd();
More information about the Kstars-devel
mailing list