Re: [gpm] little chance in 50-no-critical-on-ac.patch (ubuntu)
- From: Richard Hughes <hughsient gmail com>
- To: David Zeuthen <david fubar dk>
- Cc: gnome-power-manager-list gnome org, Michaël Arnauts <michael arnauts gmail com>
- Subject: Re: [gpm] little chance in 50-no-critical-on-ac.patch (ubuntu)
- Date: Tue, 21 Feb 2006 12:39:26 +0000
On Mon, 2006-02-20 at 16:35 -0500, David Zeuthen wrote:
> On Mon, 2006-02-20 at 20:52 +0100, Micha�Arnauts wrote:
> > This is what is in CVS:
> > (in battery_status_changed_primary)
> >
> > if (warning_type == GPM_WARNING_ACTION) {
> > gpm_tray_icon_notify (GPM_TRAY_ICON (manager->priv->tray_icon),
> > 5000,
> > _("Critical action"),
> > NULL,
> > _("The battery is below the critical level and "
> > "this computer is about to shutdown."));
> > /* wait 10 seconds for user-panic */
> > g_usleep (1000 * 1000 * 10);
>
> So you're block the the UI of g-p-m here? That's bad, isn't it?
> Shouldn't you be using g_timeout_add() instead and have some kind of
> state machine?
Why a state machine? What's wrong with doing:
static gboolean
manager_critical_action_do (GpmManager *manager)
{
manager_policy_do (manager, GPM_PREF_BATTERY_CRITICAL);
return FALSE;
}
...
/* wait 10 seconds for user-panic */
g_timeout_add (1000*10, (GSourceFunc)manager_critical_action_do, manager);
...
That would solve the UI issue wouldn't it?
Richard.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]