[gnome-settings-daemon] power: Actually do the critical action when required



commit 5dc6165d9182789c1174ba38125794bcc8749519
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jul 1 18:09:25 2011 +0100

    power: Actually do the critical action when required

 plugins/power/gsd-power-manager.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index f17c489..b914b02 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -160,6 +160,7 @@ static void     gsd_power_manager_finalize    (GObject              *object);
 
 static UpDevice *engine_get_composite_device (GsdPowerManager *manager, UpDevice *original_device);
 static UpDevice *engine_update_composite_device (GsdPowerManager *manager, UpDevice *original_device);
+static void      do_power_action_type (GsdPowerManager *manager, GsdPowerActionType action_type);
 
 G_DEFINE_TYPE (GsdPowerManager, gsd_power_manager, G_TYPE_OBJECT)
 
@@ -1017,10 +1018,16 @@ engine_ups_discharging (GsdPowerManager *manager, UpDevice *device)
 static gboolean
 manager_critical_action_do (GsdPowerManager *manager)
 {
+        GsdPowerActionType action_type;
+
         /* stop playing the alert as it's too late to do anything now */
         if (manager->priv->critical_alert_timeout_id > 0)
                 play_loop_stop (manager);
 
+        action_type = g_settings_get_enum (manager->priv->settings,
+                                           "critical-battery-action");
+        do_power_action_type (manager, action_type);
+
         return FALSE;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]