Re: [Vala] No signals in GDBus
- From: Michael Terry <mike mterry name>
- To: JM <interflug1 gmx net>
- Cc: vala-list gnome org
- Subject: Re: [Vala] No signals in GDBus
- Date: Sun, 19 Sep 2010 12:55:44 -0400
It should work like that. I do something similar in a project I maintain:
http://bazaar.launchpad.net/~deja-dup-team/deja-dup/trunk/annotate/head%3A/common/Network.vala
It's a stand-alone class that reports on network status as
NetworkManager and/or ConnMan sees it. You could play with that for
testing, as I know it works. But it basically does what you do:
void handle_signal(string sender_name, string signal_name,
GLib.Variant parameters);
proxy.g_signal.connect(handle_signal);
-mt
On 19 September 2010 12:13, JM <interflug1 gmx net> wrote:
The function Bus.get_proxy_sync(BusType.SESSION, "org.example.Demo",
"/org/example/Demo") should return a DBusProxy. Unfortunately in vala it
cannot be connected as usual (as I would expect in the example):
demonotify.g_properties_changed.connect( () =>
{ print("properties_changed reached client 2");});
demonotify.g_signal.connect( () => { print("g_signal reached client
2");});
Do you have a working example?
Regards
Jörn
On 18 September 2010 04:05, JM <interflug1 gmx net> wrote:
Please give me a hint what I'm doing wrong here. I'm using vala-0.9.8
release.
I know that normally, DBusProxy has only 2 signals (really, sort of
meta-signals): "g-signal" and "g-properties-changed"
(http://library.gnome.org/devel/gio/unstable/GDBusProxy.html#GDBusProxy.signals)
I'm not familiar with the [DBus (name = "org.example.Demo")] syntax,
though I get what it is trying to do. If you instead just used a base
DBusProxy, connected to the two above signals, and checked which
signal/property the emissions were actually for before doing anything,
I believe it will work (does for me).
-mt
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]