=== modified file 'src/gpm-manager.c' --- old/src/gpm-manager.c 2009-04-02 21:45:16 +0000 +++ new/src/gpm-manager.c 2009-04-02 21:47:38 +0000 @@ -1386,6 +1386,9 @@ gchar *remaining_text; gchar *icon; + /* get correct icon */ + icon = (kind == GPM_CELL_UNIT_KIND_PRIMARY ? "notification-battery-low" : gpm_cell_unit_get_icon (unit)); + if (kind == GPM_CELL_UNIT_KIND_PRIMARY) { title = _("Laptop battery low"); remaining_text = gpm_get_timestring (unit->time_discharge); @@ -1410,13 +1413,13 @@ message = g_strdup_printf (_("The cell phone attached to this computer is low in power (%.1f%%)"), unit->percentage); } - /* get correct icon */ - icon = gpm_cell_unit_get_icon (unit); gpm_notify_display (manager->priv->notify, title, message, GPM_NOTIFY_TIMEOUT_LONG, icon, GPM_NOTIFY_URGENCY_NORMAL); gpm_sound_event (manager->priv->sound, GPM_SOUND_POWER_LOW); - g_free (icon); + + if (kind != GPM_CELL_UNIT_KIND_PRIMARY) + g_free (icon); g_free (message); } @@ -1456,11 +1459,16 @@ gchar *icon; gchar *time_text; + /* get correct icon */ + icon = (kind == GPM_CELL_UNIT_KIND_PRIMARY ? "notification-battery-low" : gpm_cell_unit_get_icon (unit)); + if (kind == GPM_CELL_UNIT_KIND_PRIMARY) { title = _("Laptop battery critically low"); remaining_text = gpm_get_timestring (unit->time_discharge); time_text = gpm_manager_get_time_until_action_text (manager); + icon = "notification-battery-low"; + /* we have to do different warnings depending on the policy */ gpm_conf_get_string (manager->priv->conf, GPM_CONF_ACTIONS_CRITICAL_BATT, &action); if (action == NULL) { @@ -1518,13 +1526,13 @@ unit->percentage); } - /* get correct icon */ - icon = gpm_cell_unit_get_icon (unit); gpm_notify_display (manager->priv->notify, title, message, GPM_NOTIFY_TIMEOUT_LONG, icon, GPM_NOTIFY_URGENCY_CRITICAL); gpm_sound_event (manager->priv->sound, GPM_SOUND_POWER_LOW); - g_free (icon); + + if (kind != GPM_CELL_UNIT_KIND_PRIMARY) + g_free (icon); g_free (message); }