GNOME Bugzilla – Bug 623963
[PATCH] Support arbitrary time combo values
Last modified: 2010-07-16 17:10:59 UTC
Created attachment 165565 [details] [review] Proposed patch When I have changed the gconf value for keys like /apps/gnome-power-manager/timeout/sleep_computer_ac to an unusual setting (15m, 5h), the combo boxes in the preference dialog show nothing instead of the time I entered. Here's a patch to notice when that happens and to add an entry to the combo for the current gconf value. A couple notes: 1) This works because the dialog doesn't dynamically notice when gconf changes. If support for that was added, we would have to also adjust the combo if the new gconf value was also not in the list. 2) If the gconf value is only slightly off (try entering 61 seconds), you'll see two "1 minute" entries. Not sure how to do this better besides increasing the granularity of the user-friendly strings, and it's a bit of a corner case anyway.
Looks good to me. Please commit.
I had to fix one more thing that came up with further testing (use GArray when writing back to gsettings, not just when reading from it). Made sure it still works in new gnome-control-center plugin mode too. commit 8fa1a0769956e61f0978fa62870af6f808a93a99 Author: Michael Terry <mike@mterry.name> Date: Fri Jul 16 13:05:48 2010 -0400 Support arbitrary time combo values Allow time combo preference widgets to use a value they didn't expect from GSettings. This avoids getting a blank combo when a user has edited the value themselves. Closes: bgo#623963