[gnome-bluetooth] Use a better tooltip than "Bluetooth Manager" for the applet



commit eea720e49eb2ba00ed0f9e535a8a2e24156d72af
Author: Bastien Nocera <hadess hadess net>
Date:   Tue May 26 17:53:21 2009 +0100

    Use a better tooltip than "Bluetooth Manager" for the applet
---
 applet/notify.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/applet/notify.c b/applet/notify.c
index 0e6e74a..4da9c2e 100644
--- a/applet/notify.c
+++ b/applet/notify.c
@@ -33,6 +33,7 @@
 
 static GtkStatusIcon *statusicon = NULL;
 static char *icon_name = NULL;
+static char *tooltip = NULL;
 static NotifyNotification *notify = NULL;
 
 static void notify_action(NotifyNotification *notify,
@@ -95,8 +96,7 @@ GtkStatusIcon *init_notification(void)
 	notify_init("bluetooth-manager");
 
 	statusicon = gtk_status_icon_new_from_icon_name(icon_name);
-
-	gtk_status_icon_set_tooltip_markup(statusicon, _("Bluetooth Manager"));
+	gtk_status_icon_set_tooltip_markup(statusicon, tooltip);
 
 	return statusicon;
 }
@@ -109,6 +109,8 @@ void cleanup_notification(void)
 
 	g_free (icon_name);
 	icon_name = NULL;
+	g_free (tooltip);
+	tooltip = NULL;
 
 	notify_uninit();
 }
@@ -128,12 +130,15 @@ void hide_icon(void)
 void set_icon(gboolean enabled)
 {
 	const char *name = (enabled ? "bluetooth" : "bluetooth-disabled");
+	const char *_tooltip = enabled ? _("Bluetooth: Enabled") : _("Bluetooth: Disabled");
 
 	if (statusicon == NULL) {
 		g_free (icon_name);
 		icon_name = g_strdup (name);
+		tooltip = g_strdup (_tooltip);
 	} else {
 		gtk_status_icon_set_from_icon_name (statusicon, name);
+		gtk_status_icon_set_tooltip_markup(statusicon, _tooltip);
 	}
 }
 



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