Comboboxes are blank when set to unsupported option in dconf/gsettings

Bug #1096322 reported by Cody Garver
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Switchboard Power Plug
Fix Released
Medium
Julien Spautz

Bug Description

We don't have a pre-determined option for "When the power is critically low:" under Battery Power in Power plug so the dropdown appears blank. We should pick either "Hibernate" or "Shutdown" and set it in what I assume is a dconf entry.

Tags: defaults

Related branches

Revision history for this message
Cody Garver (codygarver) wrote :
Revision history for this message
Cody Garver (codygarver) wrote :

Upon investigation I discovered there is already a critical-battery-action set but I guess it's not being read by lp:switchboard-plug-power for some reason.

Changed in elementaryos:
status: New → Incomplete
Changed in switchboard-plug-power:
milestone: none → luna-beta3
importance: Undecided → Medium
Revision history for this message
Heath Paddock (heathbar) wrote :

If you change the value in dconf-editor to either hibernate or shutdown, then the power plug works correctly. However, if you click the "Set to Default" button then it doesn't.

Looking under the hood: settings.get_enum ("critical-battery-action");
returns a 1 when critical-battery-action is set to default (hibernate) in dconf-editor
returns a 3 if you select hibernate in dconf-editor
returns a 2 if you select shutdown in dconf-editor

Since power plug is expecting a 2 or 3, the default value of 1 is ignored. So why do we get a 1 when the key is set to the default, hibernate, when hibernate is the 3rd item in the list?

Revision history for this message
Julien Spautz (julien-spautz) wrote :

When I set the key to default using dconf editor it says 'hibernate', but gsettings returns 'suspend' for some reason. There is no 'suspend' option in the power plug, so this is why it's empty…

We could either add the other options like 'suspend', 'interactive', 'none' and whatever 'blank' means, or map not supported options to either hibernate or shutdown, which is not really transparent, especially for more experienced users that use dconf/gsettings.

Revision history for this message
Julien Spautz (julien-spautz) wrote :

I added the other options and mapped 'blank' to 'do nothing' because they seem to be the same thing.

Changed in switchboard-plug-power:
assignee: nobody → Julien Spautz (julien-spautz)
status: New → In Progress
Revision history for this message
Julien Spautz (julien-spautz) wrote :

This bug can also be reproduced with other combo boxes, like 'When sleep button is pressed', when set to a value that the plug doesn't support, like 'nothing' using gsettings or dconf(-editor). The problem is it doesn't make a lot of sense to 'shutdown' when you press the sleep button.

Should we allow such options or change silly options like the one mentioned above?

Allowing these options would make the plug slightly cluttered, but it would give the user more control.
Not including these options would probably mean that we have to reset changes that a user has made in dconf/gsettings when the plug is opened (so we don't display wrong information).

I prefer the first one, any other possibilities, opinions?

summary: - Battery Power "critically low" is blank
+ Comboboxes are blank when set to unsupported option in dconf/gsettings
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

No implicit resetting please, IMHO. I'd hate to discover that the setting has somehow changed without me even knowing, only when it's too late.

IMO shutting down on pressing sleep button is valid. You never know what meaning those hardware buttons have to the user anyway.
There are also all kinds of weird setups out there which might actually need it - e.g. having different buttons for power-on and poweroff so that you can't switch a system off accidentally.

Cody Garver (codygarver)
no longer affects: elementaryos
Cody Garver (codygarver)
Changed in switchboard-plug-power:
status: In Progress → Confirmed
assignee: Julien Spautz (julien-spautz) → nobody
Changed in switchboard-plug-power:
assignee: nobody → Julien Spautz (julien-spautz)
status: Confirmed → In Progress
Cody Garver (codygarver)
Changed in switchboard-plug-power:
status: In Progress → Fix Released
Cody Garver (codygarver)
Changed in switchboard-plug-power:
milestone: luna-beta3 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.