GNOME Bugzilla – Bug 631617
What API for gnome-shell?
Last modified: 2010-10-28 09:48:53 UTC
Quite some time ago there was a discussion on the future of gnome-power-manager status icon in gnome-shell, concluded with the decision that g-p-m should expose some DBus API for gnome-shell specific use. I then drafted a possibility on http://live.gnome.org/GnomeShell/Design/Guidelines/SystemStatus/BatteryPower but soon realized that a lot of code would need to be duplicated between gnome-shell and g-p-m to implement it. Also, option a) on that wiki page would not really benefit g-p-m, since removing the status icon would mean reworking a lot of code (not at all an example of MVC...), thus it would not be a priority. b) is interesting, except that differently from say bluetooth-applet, where this has been applied successfully, g-p-m has its own purpose as a daemon, so there would be two applications concurrently accessing UPower data, even though through the same code. So pratically, it is either that API or c), a 1:1 DBus transposition of GpmEngine, which is dirty API but requires little duplicated code and few changes in g-p-m. What do you, developers and maintainers of g-p-m, think is the best option?
I've allocated a couple of days next week to work on this and create something for the shell to use. I'm crazy busy this weekend, but I promise I'll write something up in more detail on Monday.
(In reply to comment #1) > I'll write something up in more detail on Monday. hughsie: ping?
(In reply to comment #1) > I've allocated a couple of days next week to work on this and create something > for the shell to use. I'm crazy busy this weekend, but I promise I'll write > something up in more detail on Monday. Sorry, Just getting GTK to build with 2.91.1 was impossible (well, it was possible, but it would crash on running, which was sub-optimal) and now I've been spending time porting it to the new GtkApplication code. I'm going to migrate everything away from dbus-glib today, and port to GDBus. THen it's trivial to add methods and signals for gnome-shell to use.
Created attachment 173334 [details] [review] Ensure Icon and Tooltip properties are not NULL DBus cannot handle NULL, thus will assert if those properties are NULL and no error is set. Rather than including a new error, just return the empty string. Great work anyway, shell integration is almost ready!
Created attachment 173339 [details] [review] Ensure correct values for Icon and Tooltip properties DBus cannot handle NULL, thus will assert if those properties are NULL and no error is set. Rather than including a new error, just return the empty string.
Created attachment 173351 [details] [review] Use correct DBus types for UPower data Battery percentage is a double, time is a guint64. Change the API to reflect that. https://bugzilla.gnome.org/show_bug.cgi?id=626759
Both committed, thanks.