Re: [q, fsot] howto dbus

2009-05-23 Thread Michael Tansella
On Friday 22 May 2009 20:10:23 arne anka wrote:
 that's maybe rather ot, but since i need it to program _with_ qt _for_ the
 freerunner ...
 short'n'sweet: has anybody a clear and usable tutorial howto write dbus
 apps with qt, notably registering an app to dbus and recieve dbus
 signals/events?

 say, as a plausible scenario, i want to subscribe to dbus and receive
 information about incoming calls (the same stuff zhone receives) ar make a
 call -- how do i go about?

 the stuff i found so far is to complex and has to little hands-on examples
 to use already existing infrastructure -- i am rather the type that
 embarks from small examples upon larger quests, not from reading lengthy
 texts and code which creates complete apps inclusive gui and all.

Hi,
here is a little DBus Gypsy example, I hope it helps. The correct methodes can 
be found with mdbus.

Greets 
Michael 
___

QDBusConnection GPSConnection = QDBusConnection::systemBus();

/// check connection
if (GPSConnection.isConnected())
qDebug()  successfully connected to system bus \n;
else
qFatal(Failed to connect to session bus);

/// create a proxy object for method calls 
QString ServiceBusName = org.freedesktop.Gypsy;
QString ObjectPath = /org/freedesktop/Gypsy ;
QString MethodPath = ;
GPSInterface = new QDBusInterface(  ServiceBusName,

ObjectPath, 

MethodPath, //method path =  search recursive in all subfolders   


for the called method 

QDBusConnection::systemBus() );

/// due to new frameworkd policies it is necessary to create interfaces with 
the right MethodPath to 
/// call functions (not necessary for connections/signals)  


GPSRescourceInterface = new QDBusInterface( ServiceBusName,

 ObjectPath,

 org.freesmartphone.Resource,

 QDBusConnection::systemBus() );

 
GPSDeviceInterface = new QDBusInterface( ServiceBusName,

 ObjectPath,

 org.freedesktop.Gypsy.Device,

 QDBusConnection::systemBus() );
GPSOusagedInterface = new QDBusInterface( ServiceBusName,

 /org/freesmartphone/Usage,

 org.freesmartphone.Usage,

 QDBusConnection::systemBus() );


connect(GPSInterface, SIGNAL( FixStatusChanged(int) ),this, SLOT( 
handleFixStatusChanged(int) ) );

connect(GPSInterface, SIGNAL( TimeChanged(int) ),this, SLOT( 
handleTimeChanged(int) ) );

connect(GPSInterface, SIGNAL( PositionChanged(int,int,double,double,double) 
),this, SLOT( handlePositionChanged(int,int,double,double,double) ) );

connect(GPSInterface, SIGNAL( ConnectionStatusChanged(bool) ),this, SLOT( 
handleConnectionStatusChanged(bool) ) );

connect(GPSInterface, SIGNAL( CourseChanged(int,int,double,double,double) 
),this, SLOT( handleCourseChanged(int,int,double,double,double) ) );

connect(GPSInterface, SIGNAL( AccuracyChanged(int,double,double,double) 
),this, SLOT( handleAccuracyChanged(int,double,double,double) ) );

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [q, fsot] howto dbus

2009-05-23 Thread arne anka
 QDBusConnection GPSConnection = QDBusConnection::systemBus();
 ...


thanks, no w i at least got an idea how to preceed.
nevertheless, for want of gypsy i tried to connect to a signal from  
kwalletd (kde pasword management daemon), which besides others offers the  
signal

org.kde.kwalletd /modules/kwalletd org.kde.KWallet.walletOpened()

doing

QDBusInterface* KWalletdInterface = new QDBusInterface(org.kde.kwalletd,  
/modules/kwalletd, org.kde.KWallet, QDBusConnection::sessionBus());
connect(KWalletdInterface, SIGNAL(walletOpened()), this, SLOT(slotOne()));

always gives

Object::connect: No such signal org::kde::KWallet::walletOpened()

searching around, i found your thread with exactly the same problem (and  
my rather less helpful comments ;-) -- but you never posted a solution to  
that ...
 http://kerneltrap.org/index.php?q=mailarchive/openmoko-community/2008/11/26/4238514/thread

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [q, fsot] howto dbus

2009-05-23 Thread Johny Tenfinger
On Sat, May 23, 2009 at 20:49, arne anka openm...@ginguppin.de wrote:
 QDBusConnection GPSConnection = QDBusConnection::systemBus();
 ...


 thanks, no w i at least got an idea how to preceed.

For KWallet you could try:

QDBusConnection WalletConnection = QDBusConnection::sessionBus();

KDE stuff sits on session bus (AFAIR), and FSO sits on system bus.

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [q, fsot] howto dbus

2009-05-23 Thread arne anka
 QDBusConnection WalletConnection = QDBusConnection::sessionBus();

thanks, but that's not the problem.
i think i solved it (at least, i hope that's the correct way):

QDBusConnection::sessionBus().connect(org.kde.kwalletd,  
/modules/kwalletd, org.kde.KWallet, walletDeleted, this,  
SLOT(slotFour()));

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


[q, fsot] howto dbus

2009-05-22 Thread arne anka
that's maybe rather ot, but since i need it to program _with_ qt _for_ the  
freerunner ...
short'n'sweet: has anybody a clear and usable tutorial howto write dbus  
apps with qt, notably registering an app to dbus and recieve dbus  
signals/events?

say, as a plausible scenario, i want to subscribe to dbus and receive  
information about incoming calls (the same stuff zhone receives) ar make a  
call -- how do i go about?

the stuff i found so far is to complex and has to little hands-on examples  
to use already existing infrastructure -- i am rather the type that  
embarks from small examples upon larger quests, not from reading lengthy  
texts and code which creates complete apps inclusive gui and all.

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: [q, fsot] howto dbus

2009-05-22 Thread Christian Gagneraud
arne anka wrote:
 that's maybe rather ot, but since i need it to program _with_ qt _for_ the  
 freerunner ...
 short'n'sweet: has anybody a clear and usable tutorial howto write dbus  
 apps with qt, notably registering an app to dbus and recieve dbus  
 signals/events?
 
 say, as a plausible scenario, i want to subscribe to dbus and receive  
 information about incoming calls (the same stuff zhone receives) ar make a  
 call -- how do i go about?
 
 the stuff i found so far is to complex and has to little hands-on examples  
 to use already existing infrastructure -- i am rather the type that  
 embarks from small examples upon larger quests, not from reading lengthy  
 texts and code which creates complete apps inclusive gui and all.

Hi Arne,

I tried some time ago to use FSO DBUS with QT-4.5, as i'm a new comer 
to qt, i've learned the basics with their online doc[1] and 
tutorials[2] and did googling a lot! Then i took a look at telepathy 
as a serious QT/DBUS real-life example.

I tried to use their (telepathy) dbus proxy generator, but finally i 
gave up more by lack of time. The FSO XML specs has to be enhanced to 
ease the work of the generator...
Anyway i will have to go back to this in few month as  we will use FSO 
DBUS interface likely with QT in some incoming project within my company.

If you find anything interesting about QT/DBUS/FSO, please share it!

Have fun!
Chris

[1] http://doc.trolltech.com/4.5/qtdbus.html
[2] http://doc.trolltech.com/4.5/examples.html#d-bus

 
 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community


___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community