[goobox] show the total time in the status icon tooltip



commit 9361effe5f4171e80b543a8c1e7a27a99a307504
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Nov 15 12:40:29 2009 +0100

    show the total time in the status icon tooltip

 src/goo-player-info.c |    1 +
 src/goo-window.c      |    8 +++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/goo-player-info.c b/src/goo-player-info.c
index f16a269..292e66b 100644
--- a/src/goo-player-info.c
+++ b/src/goo-player-info.c
@@ -217,6 +217,7 @@ time_scale_value_changed_cb (GtkRange      *range,
 	current_time = info->priv->track_length * (new_value / 100.0);
 	g_free (info->priv->current_time);
 	info->priv->current_time = _g_format_duration_for_display (current_time * 1000);
+	/* translators: this is the current_time / total_time label */
 	sprintf (info->priv->time, _("%s / %s"), info->priv->total_time, info->priv->current_time);
 	set_time (info, info->priv->time);
 
diff --git a/src/goo-window.c b/src/goo-window.c
index 26780d2..1b16730 100644
--- a/src/goo-window.c
+++ b/src/goo-window.c
@@ -2017,13 +2017,19 @@ status_icon_query_tooltip_cb (GtkStatusIcon *status_icon,
 
 	if (track != NULL) {
 		char *current_time;
+		char *total_time;
+		char *time;
 		char *markup;
 
 		current_time = _g_format_duration_for_display (track->length * 1000 * goo_player_info_get_progress (GOO_PLAYER_INFO (window->priv->info)));
-		markup = g_markup_printf_escaped ("<b>%s</b>\n<i>%s</i>\n%s", track->title, track->artist, current_time);
+		total_time = _g_format_duration_for_display (track->length * 1000);
+		time = g_strdup_printf (_("%s / %s"), current_time, total_time);
+		markup = g_markup_printf_escaped ("<b>%s</b>\n<i>%s</i>\n%s", track->title, track->artist, time);
 		gtk_tooltip_set_markup (tooltip, markup);
 
 		g_free (markup);
+		g_free (time);
+		g_free (total_time);
 		g_free (current_time);
 	}
 	else if ((album != NULL) && (album->title != NULL)) {



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