GNOME Bugzilla – Bug 455095
Export battery info to gnome-power-manager
Last modified: 2007-07-11 09:51:48 UTC
Exported D-Bus API: i GetNumberBatteries() i (percentage) b (on_ac) GetBatteryState(i) signal(BatteryStateChanged) signal(NumberBatteriesChanged)
Would need to send one last signal(BatteryStateChanged) when disconnecting. So we'd change this to: signal(BatteryStateChanged) (i, b)
Dude, why not just send signal(NumberBatteriesChanged) (i) when disconnecting. You'll also want to use: signal(BatteryStateChanged) (i [index], i [percentage], b [on_ac]) signal(NumberBatteriesChanged) (i [number]) We need to know what battery has changed for BatteryStateChanged and so we don't have to do a GetNumberBatteries right after we receive NumberBatteriesChanged.
D-Bus interface added, although there's nothing actually emitting signals. Let me know if this is right. 2007-07-11 Bastien Nocera <hadess@hadess.net> * configure.in: Add dbus dependency * libgsm/Makefile.am: Only bind the .la to libgnokii, rest will fall into place * libgsm/phonemgr-marshal.list: add marshaller for the D-Bus exported objects * src/Makefile.am: * src/main.c: (phonemgr_object_class_init), (phonemgr_object_init), (main): * src/org_gnome_phonemgr_Battery.xml: Add a D-Bus interface to send out signals when battery status changes
Fixed, the interface is in http://svn.gnome.org/viewcvs/phonemgr/trunk/src/org_gnome_phone_Manager.xml?view=markup 2007-07-11 Bastien Nocera <hadess@hadess.net> * libgsm/glibgsmtest.c: (battery): * libgsm/phonemgr-listener.c: (phonemgr_listener_emit_battery), (phonemgr_listener_push): * libgsm/phonemgr-listener.h: Change the public API to use on_ac rather than on_battery to match gnome-power-manager's external API * src/app.h: * src/connection.c: (on_status), (on_battery), (initialise_connection): * src/main.c: (main): * src/phonemgr-object.c: (phonemgr_object_emit_number_batteries_changed), (phonemgr_object_emit_battery_state_changed): * src/phonemgr-object.h: Emit battery related signals on the D-Bus interface for gnome-power-manager's benefit (Closes: #455095) 2007-07-11 Bastien Nocera <hadess@hadess.net> * src/app.h: * src/connection.c: (on_status), (free_connection), (initialise_connection): Remove an unneeded timeout id, use g_timeout_add_seconds() for our reconnector function * src/Makefile.am: * src/main.c: (main): * src/org_gnome_phone_Manager.xml: * src/org_gnome_phonemgr_Battery.xml: * src/phonemgr-object.c: (phonemgr_object_class_init), (phonemgr_object_emit_number_batteries_changed), (phonemgr_object_emit_battery_state_changed), (phonemgr_object_init): * src/phonemgr-object.h: Move the battery signal code to another file, rename to org.gnome.phone.Manager