summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-10-17 12:04:02 +0200
committerBastien Nocera <hadess@hadess.net>2013-10-17 17:41:39 +0200
commitbcb3e743218cc101101b59c046113ba106217c84 (patch)
treeaf47e20e35d47b7b0a49337e3e1df1780cb68ce3
parent92c5e5eb0ac885a100b036d80437f25b9b4ebe6c (diff)
downloadgnome-settings-daemon-bcb3e743218cc101101b59c046113ba106217c84.tar.gz
power: Set on_low_battery when the warning level changes
-rw-r--r--plugins/power/gsd-power-manager.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 6fa66fa0..236f8bc8 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -325,8 +325,6 @@ engine_ups_discharging (GsdPowerManager *manager, UpDevice *device)
"icon-name", &icon_name,
NULL);
- main_battery_or_ups_low_changed (manager, TRUE);
-
/* only show text if there is a valid time */
if (time_to_empty > 0)
remaining_text = gpm_get_timestring (time_to_empty);
@@ -432,8 +430,6 @@ engine_charge_low (GsdPowerManager *manager, UpDevice *device)
message = g_strdup_printf (_("Approximately %s remaining (%.0f%%)"), remaining_text, percentage);
g_free (remaining_text);
- main_battery_or_ups_low_changed (manager, TRUE);
-
} else if (kind == UP_DEVICE_KIND_UPS) {
/* TRANSLATORS: UPS is starting to get a little low */
title = _("UPS low");
@@ -567,8 +563,6 @@ engine_charge_critical (GsdPowerManager *manager, UpDevice *device)
message = g_strdup_printf (_("Computer will shutdown very soon unless it is plugged in."));
}
- main_battery_or_ups_low_changed (manager, TRUE);
-
} else if (kind == UP_DEVICE_KIND_UPS) {
gchar *remaining_text;
gchar *tmp;
@@ -807,8 +801,9 @@ engine_device_warning_changed_cb (UpDevice *device, GParamSpec *pspec, GsdPowerM
g_debug ("fully charged or charging, hiding notifications if any");
notify_close_if_showing (&manager->priv->notification_low);
notify_close_if_showing (&manager->priv->notification_ups_discharging);
- main_battery_or_ups_low_changed (manager, FALSE);
}
+
+ main_battery_or_ups_low_changed (manager, (warning != UP_DEVICE_LEVEL_NONE));
}
static void
@@ -1717,7 +1712,7 @@ idle_configure (GsdPowerManager *manager)
static void
main_battery_or_ups_low_changed (GsdPowerManager *manager,
- gboolean is_low)
+ gboolean is_low)
{
if (is_low == manager->priv->battery_is_low)
return;