From cbb3a71adc5551f4c600cfc6f53fc112f3022a78 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 24 Jan 2009 04:45:19 +0000 Subject: Get automatic message selection working. Add a tooltip to the online button. svn path=/branches/kill-bonobo/; revision=37126 --- widgets/misc/e-online-button.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'widgets/misc/e-online-button.c') diff --git a/widgets/misc/e-online-button.c b/widgets/misc/e-online-button.c index dec24a6587..fbfb850272 100644 --- a/widgets/misc/e-online-button.c +++ b/widgets/misc/e-online-button.c @@ -23,6 +23,12 @@ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_ONLINE_BUTTON, EOnlineButtonPrivate)) +#define ONLINE_TOOLTIP \ + "Evolution is currently online. Click this button to work offline." + +#define OFFLINE_TOOLTIP \ + "Evolution is currently offline. Click this button to work online." + struct _EOnlineButtonPrivate { GtkWidget *image; gboolean online; @@ -175,6 +181,7 @@ e_online_button_set_online (EOnlineButton *button, GtkIconTheme *icon_theme; const gchar *filename; const gchar *icon_name; + const gchar *tooltip; g_return_if_fail (E_IS_ONLINE_BUTTON (button)); @@ -191,5 +198,8 @@ e_online_button_set_online (EOnlineButton *button, gtk_image_set_from_file (image, filename); gtk_icon_info_free (icon_info); + tooltip = _(online ? ONLINE_TOOLTIP : OFFLINE_TOOLTIP); + gtk_widget_set_tooltip_text (GTK_WIDGET (button), tooltip); + g_object_notify (G_OBJECT (button), "online"); } -- cgit v1.2.3