GNOME Bugzilla – Bug 455099
Handle phone batteries through gnome-phone-manager
Last modified: 2009-06-22 21:47:54 UTC
API explained in bug 455095 gnome-phone-manager would send the NumberBatteriesChanged signal, and set NumberBatteries to 1 when connected, 0 when disconnected.
2007-07-25 Richard Hughes <richard@hughsie.com> * src/gpm-cell.c: (gpm_cell_refresh_hal_all), (hal_device_property_modified_cb), (gpm_cell_set_type), (gpm_cell_set_hal_udi), (gpm_cell_set_phone_index), (gpm_cell_get_icon), (gpm_cell_print), (gpm_cell_get_description), (phone_device_refresh_cb), (gpm_cell_init), (gpm_cell_finalize): * src/gpm-phone.c: (gpm_phone_coldplug), (gpm_phone_get_present), (gpm_phone_get_percentage), (gpm_phone_get_on_ac), (gpm_phone_get_num_batteries), (gpm_phone_battery_state_changed), (gpm_phone_num_batteries_changed), (gpm_phone_dbus_connect), (gpm_phone_dbus_disconnect), (phone_device_refresh_cb), (gpm_st_phone): Add in checks for the object type, and also remember to disconnect the signal when GpmCell is unref'ed, else we segfault on phone connect, disconnect, connect. 2007-07-25 Richard Hughes <richard@hughsie.com> * src/Makefile.am: * src/gpm-cell.c: * src/gpm-cell-array.c: (gpm_cell_array_index_udi), (gpm_cell_array_coldplug), (phone_device_added_cb), (phone_device_removed_cb), (gpm_cell_array_init), (gpm_cell_array_finalize): Add support for GpmPhone devices. These show as laptop batteries for now, soon to be fixed. * src/gpm-marshal.list: * src/gpm-phone.c: (gpm_phone_coldplug), (gpm_phone_battery_state_changed), (gpm_phone_num_batteries_changed), (gpm_phone_class_init), (gpm_phone_dbus_connect), (gpm_phone_dbus_disconnect), (gpm_st_mainloop_wait), (gpm_st_phone): Listen for the correct signals, and add the correct GpmCell device. * src/gpm-self-test.c: (main): * src/gpm-self-test.h: Add the phone self-checks.