After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 631617 - What API for gnome-shell?
What API for gnome-shell?
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on:
Blocks: 622451
 
 
Reported: 2010-10-07 15:16 UTC by Giovanni Campagna
Modified: 2010-10-28 09:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Ensure Icon and Tooltip properties are not NULL (1.24 KB, patch)
2010-10-27 15:56 UTC, Giovanni Campagna
none Details | Review
Ensure correct values for Icon and Tooltip properties (1.30 KB, patch)
2010-10-27 16:58 UTC, Giovanni Campagna
none Details | Review
Use correct DBus types for UPower data (2.60 KB, patch)
2010-10-27 20:45 UTC, Giovanni Campagna
none Details | Review

Description Giovanni Campagna 2010-10-07 15:16:31 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?
Comment 1 Richard Hughes 2010-10-09 07:48:32 UTC
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.
Comment 2 André Klapper 2010-10-24 17:20:57 UTC
(In reply to comment #1)
> I'll write something up in more detail on Monday.

hughsie: ping?
Comment 3 Richard Hughes 2010-10-25 08:19:44 UTC
(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.
Comment 4 Giovanni Campagna 2010-10-27 15:56:28 UTC
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!
Comment 5 Giovanni Campagna 2010-10-27 16:58:09 UTC
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.
Comment 6 Giovanni Campagna 2010-10-27 20:45:22 UTC
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
Comment 7 Richard Hughes 2010-10-28 09:48:53 UTC
Both committed, thanks.