summaryrefslogtreecommitdiff
path: root/src/gpm-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpm-manager.c')
-rw-r--r--src/gpm-manager.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index f6c498e..ce2b695 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -56,7 +56,7 @@
#include "gpm-backlight.h"
#include "gpm-kbd-backlight.h"
#include "gpm-session.h"
-#include "gpm-stock-icons.h"
+#include "gpm-icon-names.h"
#include "gpm-tray-icon.h"
#include "gpm-engine.h"
#include "gpm-upower.h"
@@ -239,6 +239,8 @@ gpm_manager_play_loop_start (GpmManager *manager, GpmManagerSound action, gboole
(GSourceFunc) gpm_manager_play_loop_timeout_cb,
manager);
+ g_source_set_name_by_id (manager->priv->critical_alert_timeout_id, "[GpmManager] play-loop");
+
/* play the sound, using sounds from the naming spec */
context = ca_gtk_context_get_for_screen (gdk_screen_get_default ());
retval = ca_context_play (context, 0,
@@ -579,13 +581,13 @@ gpm_manager_sleep_failure (GpmManager *manager, gboolean is_suspend, const gchar
g_string_append (string, _("Computer failed to suspend."));
/* TRANSLATORS: title text */
title = _("Failed to suspend");
- icon = GPM_STOCK_SUSPEND;
+ icon = GPM_ICON_SUSPEND;
} else {
/* TRANSLATORS: message text */
g_string_append (string, _("Computer failed to hibernate."));
/* TRANSLATORS: title text */
title = _("Failed to hibernate");
- icon = GPM_STOCK_HIBERNATE;
+ icon = GPM_ICON_HIBERNATE;
}
/* TRANSLATORS: message text */
@@ -926,7 +928,7 @@ gpm_manager_button_pressed_cb (GpmButton *button, const gchar *type, GpmManager
_("Power Information"),
message,
GPM_MANAGER_NOTIFY_TIMEOUT_LONG,
- GTK_STOCK_DIALOG_INFO,
+ "dialog-information",
NOTIFY_URGENCY_NORMAL);
g_free (message);
}
@@ -1116,7 +1118,7 @@ gpm_manager_engine_low_capacity_cb (GpmEngine *engine, UpDevice *device, GpmMana
message = g_strdup_printf (_("Battery has a very low capacity (%1.1f%%), "
"which means that it may be old or broken."), capacity);
gpm_manager_notify (manager, &manager->priv->notification_general, title, message, GPM_MANAGER_NOTIFY_TIMEOUT_SHORT,
- GTK_STOCK_DIALOG_INFO, NOTIFY_URGENCY_LOW);
+ "dialog-information", NOTIFY_URGENCY_LOW);
out:
g_free (message);
}
@@ -1165,7 +1167,7 @@ gpm_manager_engine_fully_charged_cb (GpmEngine *engine, UpDevice *device, GpmMan
title = ngettext ("Battery Charged", "Batteries Charged", plural);
gpm_manager_notify (manager, &manager->priv->notification_fully_charged,
title, NULL, GPM_MANAGER_NOTIFY_TIMEOUT_SHORT,
- GTK_STOCK_DIALOG_INFO, NOTIFY_URGENCY_LOW);
+ "dialog-information", NOTIFY_URGENCY_LOW);
}
out:
g_free (native_path);
@@ -1204,7 +1206,7 @@ gpm_manager_engine_discharging_cb (GpmEngine *engine, UpDevice *device, GpmManag
/* only show text if there is a valid time */
if (time_to_empty > 0)
remaining_text = gpm_get_timestring (time_to_empty);
- kind_desc = gpm_device_kind_to_localised_text (kind, 1);
+ kind_desc = gpm_device_kind_to_localised_string (kind, 1);
if (kind == UP_DEVICE_KIND_BATTERY) {
/* TRANSLATORS: laptop battery is now discharging */
@@ -1560,6 +1562,7 @@ gpm_manager_engine_charge_action_cb (GpmEngine *engine, UpDevice *device, GpmMan
gchar *icon = NULL;
UpDeviceKind kind;
GpmActionPolicy policy;
+ guint timer_id;
/* get device properties */
g_object_get (device,
@@ -1608,7 +1611,8 @@ gpm_manager_engine_charge_action_cb (GpmEngine *engine, UpDevice *device, GpmMan
}
/* wait 20 seconds for user-panic */
- g_timeout_add_seconds (20, (GSourceFunc) manager_critical_action_do, manager);
+ timer_id = g_timeout_add_seconds (20, (GSourceFunc) manager_critical_action_do, manager);
+ g_source_set_name_by_id (timer_id, "[GpmManager] battery critical-action");
} else if (kind == UP_DEVICE_KIND_UPS) {
/* TRANSLATORS: UPS is really, really, low */
@@ -1636,7 +1640,8 @@ gpm_manager_engine_charge_action_cb (GpmEngine *engine, UpDevice *device, GpmMan
}
/* wait 20 seconds for user-panic */
- g_timeout_add_seconds (20, (GSourceFunc) manager_critical_action_do, manager);
+ timer_id = g_timeout_add_seconds (20, (GSourceFunc) manager_critical_action_do, manager);
+ g_source_set_name_by_id (timer_id, "[GpmManager] ups critical-action");
}
@@ -1708,8 +1713,10 @@ gpm_manager_reset_just_resumed_cb (gpointer user_data)
static void
gpm_manager_control_resume_cb (GpmControl *control, GpmControlAction action, GpmManager *manager)
{
+ guint timer_id;
manager->priv->just_resumed = TRUE;
- g_timeout_add_seconds (1, gpm_manager_reset_just_resumed_cb, manager);
+ timer_id = g_timeout_add_seconds (1, gpm_manager_reset_just_resumed_cb, manager);
+ g_source_set_name_by_id (timer_id, "[GpmManager] just-resumed");
}
/**
@@ -1790,7 +1797,6 @@ static void
gpm_manager_init (GpmManager *manager)
{
gboolean check_type_cpu;
- gint timeout;
DBusGConnection *connection;
GDBusConnection *g_connection;
GError *error = NULL;
@@ -1945,8 +1951,11 @@ gpm_manager_finalize (GObject *object)
gpm_manager_notify_close (manager, manager->priv->notification_discharging);
if (manager->priv->notification_fully_charged != NULL)
gpm_manager_notify_close (manager, manager->priv->notification_fully_charged);
- if (manager->priv->critical_alert_timeout_id != 0)
+
+ if (manager->priv->critical_alert_timeout_id != 0) {
g_source_remove (manager->priv->critical_alert_timeout_id);
+ manager->priv->critical_alert_timeout_id = 0;
+ }
g_object_unref (manager->priv->settings);
g_object_unref (manager->priv->dpms);