Comment 17 for bug 407491

Revision history for this message
Scott Howard (showard314) wrote : Re: [Bug 407491] Re: [karmic] gnome-power-preferences not storing settings

Notes to developers (or me if I can get around to it...):
in src/gpm-prefs-core.c
function "gpm_prefs_setup_action_combo"
has the order:
shutdown
suspend
hibernate
blank
ask
nothing

but the enumeration is:

typedef enum {
GPM_ACTION_POLICY_BLANK,
GPM_ACTION_POLICY_SUSPEND,
GPM_ACTION_POLICY_SHUTDOWN,
GPM_ACTION_POLICY_HIBERNATE,
GPM_ACTION_POLICY_INTERACTIVE,
GPM_ACTION_POLICY_NOTHING
} GpmActionPolicy;

this causes a problem in:

gpm_prefs_action_combo_changed_cb (GtkWidget *widget, GpmPrefs *prefs)

because:
 actions = (const GpmActionPolicy *) g_object_get_data (G_OBJECT
(widget), "actions");

 active = gtk_combo_box_get_active (GTK_COMBO_BOX (widget));
 policy = actions[active];

policy calls the "active" value of the "actions" array, which does not
correspond to the checkbox order!

Fix: re-enumerate the actions order or re-write the "append" to
checkbox list to be the correct order

bug possibly originated here:
http://git.gnome.org/cgit/gnome-power-manager/commit/?id=8bf6879f00e17d7feb39cecb820ad0ad33e2e827

I have two other bugs I'm working on before I can get a change for
this one, if someone wants to take a stab at it please go ahead - I
won't be able to get to this for maybe 3 weeks (i'll be away).

On Thu, Aug 6, 2009 at 2:00 PM, A. Bram Neijt<email address hidden> wrote:
> The settings are off-by-one for me, and it looks like storing the settings work. And the settings take effect as soon as they are set. Your log showed:
> TI:17:26:54     TH:0x207f070    FI:gpm-prefs-core.c     FN:gpm_prefs_action_combo_changed_cb,267
>  - Changing /apps/gnome-power-manager/buttons/lid_battery to blank
>
> Which means that you have set the lid closed when on battery to "blank". Start gnome-power-preferences with --verbose again and try every entry in the pull-down list. If your bug is the same as mine, the verbose output will show that the preferences manager will set the option just above the one you choose. Just to make this clear, my findings are:
> 1) What --verbose output is set, and stored/retained. If you then close the preferences manager it will work properly according to what the output told you (not what the GUI shows).
> 2) As soon as you open gnome-power-preferences, it resets the options (shown in verbose) to new values which are again wrongly shown in the GUI. Closing it after that will have changed your settings even if you didn't do anything.
>
> I'm using 64bit with the latest updates (2.27.5-0ubuntu1). I tried
> installing 64bit karmic alpha 3 in KVM and this did not confirm the bug.
> However, KVM did not have suspend and hibernate options, so it may be a
> problem with the insertion of the extra options, or a wrong enumeration
> value??
>
> --
> [karmic] gnome-power-preferences not storing settings
> https://bugs.launchpad.net/bugs/407491
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “gnome-power-manager” package in Ubuntu: Confirmed
> Status in gnome-power-manager in Ubuntu Karmic: Confirmed
>
> Bug description:
> Binary package hint: gnome-power-manager
>
> Actions:
> Open gnome-power-preferences
> Change settings
> Close gnome-power-preferences
>
> Result:
> Power management does not follow the set options. Opening the preference window again, shows the settings according to some default and do not reflect the choices I made earlier.
>
> Expected result:
> The settings should have been stored in the configuration.
>
> The attached log shows the output of:
> gnome-power-preferences --verbose > attached_file.log
> gnome-power-preferences --verbose >> attached_file.log
>
> It seems like the settings are not properly stored and/or reset on opening the application.
>
> ProblemType: Bug
> Architecture: amd64
> Date: Fri Jul 31 22:29:36 2009
> DistroRelease: Ubuntu 9.10
> Package: gnome-power-manager 2.27.2+git20090729-0ubuntu2
> ProcEnviron:
>  SHELL=/bin/bash
>  PATH=(custom, user)
>  LANG=en_US.UTF-8
> ProcVersionSignature: Ubuntu 2.6.31-4.23-generic
> SourcePackage: gnome-power-manager
> Uname: Linux 2.6.31-4-generic x86_64
>