GNOME Bugzilla – Bug 757880
Offer configuration of the power button
Last modified: 2015-11-13 15:23:15 UTC
Not for VMs or tablets, but for laptops and desktops.
See also https://bugzilla.gnome.org/show_bug.cgi?id=755953
Created attachment 315341 [details] [review] power: Add configuration for Power Button When running on something other than a VM or a tablet, which have hard-coded actions when the power button is pressed, offer to configure the power button to either suspend (default), hibernate, or do nothing.
Created attachment 315342 [details] [review] power: Don't throw errors when D-Bus calls are cancelled
Review of attachment 315342 [details] [review]: sure
Review of attachment 315341 [details] [review]: ::: panels/power/cc-power-panel.c @@ +200,3 @@ + cancellable, + &error); + if (connection == NULL) { This file uses standard glib/gtk+ style so: if (condition) { statement; } @@ +222,3 @@ + if (variant == NULL) { + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + g_debug ("Failed to get property '%s': %s", "Chassis", error->message); g_warning as above? ::: panels/power/power.ui @@ +113,3 @@ + <col id="0" translatable="yes">Nothing</col> + <col id="1">0</col> + </row> I'd prefer that this was created in code with the real enum values for the second column and the strings from an array indexed by the enums so that if more values are added later we don't have a potentially difficult to track bug
(In reply to Rui Matos from comment #5) > Review of attachment 315341 [details] [review] [review]: > > ::: panels/power/cc-power-panel.c > @@ +200,3 @@ > + cancellable, > + &error); > + if (connection == NULL) { > > This file uses standard glib/gtk+ style so: > > if (condition) > { > statement; > } > > @@ +222,3 @@ > + if (variant == NULL) { > + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) > + g_debug ("Failed to get property '%s': %s", "Chassis", > error->message); > > g_warning as above? No system bus -> system is utterly busted. No logind -> non-Linux or non-systemd system > ::: panels/power/power.ui > @@ +113,3 @@ > + <col id="0" translatable="yes">Nothing</col> > + <col id="1">0</col> > + </row> > > I'd prefer that this was created in code with the real enum values for the > second column and the strings from an array indexed by the enums so that if > more values are added later we don't have a potentially difficult to track > bug Right...
Created attachment 315412 [details] [review] power: Add configuration for Power Button When running on something other than a VM or a tablet, which have hard-coded actions when the power button is pressed, offer to configure the power button to either suspend (default), hibernate, or do nothing.
Attachment 315342 [details] pushed as dc49fb6 - power: Don't throw errors when D-Bus calls are cancelled Attachment 315412 [details] pushed as 3a34080 - power: Add configuration for Power Button