[PATCH] tooltip in clock applet



Hi

When displaying the date in the clock applet, the tooltip displays also
the date, which seems redundant. This patch makes it display informative
messages when it's already displaying the date.

Is it ok?
-- 
Rodrigo Moya <rodrigo gnome-db org>
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/clock/ChangeLog,v
retrieving revision 1.591
diff -u -p -r1.591 ChangeLog
--- ChangeLog	13 Jul 2005 09:24:20 -0000	1.591
+++ ChangeLog	15 Jul 2005 12:22:59 -0000
@@ -1,3 +1,9 @@
+2005-07-15  Rodrigo Moya <rodrigo novell com>
+
+	* clock.c (update_clock): only show the date in the tooltip if the applet
+	is set up to not display the date. If set to display it, use informative
+	messages.
+
 ==================== 2.11.5 ====================
 
 ==================== 2.11.4 ====================
Index: clock.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/clock/clock.c,v
retrieving revision 1.166
diff -u -p -r1.166 clock.c
--- clock.c	7 Jun 2005 15:30:47 -0000	1.166
+++ clock.c	15 Jul 2005 12:23:00 -0000
@@ -372,17 +372,25 @@ update_clock (ClockData * cd)
 
         gtk_widget_queue_resize (cd->toggle);
 
-	/* Show date in tooltip */
-	loc = g_locale_from_utf8 (_("%A %B %d"), -1, NULL, NULL, NULL);
-	if (!loc)
-		strcpy (date, "???");
-	else if (strftime (date, sizeof (date), loc, tm) <= 0)
-		strcpy (date, "???");
-	g_free (loc);
+        if (!cd->showdate) {
+                /* Show date in tooltip */
+                loc = g_locale_from_utf8 (_("%A %B %d"), -1, NULL, NULL, NULL);
+                if (!loc)
+                        strcpy (date, "???");
+                else if (strftime (date, sizeof (date), loc, tm) <= 0)
+                        strcpy (date, "???");
+                g_free (loc);
 
-	utf8 = g_locale_to_utf8 (date, -1, NULL, NULL, NULL);
-	set_tooltip (cd->applet, cd->toggle, utf8);
-	g_free (utf8);
+                utf8 = g_locale_to_utf8 (date, -1, NULL, NULL, NULL);
+                set_tooltip (cd->applet, cd->toggle, utf8);
+                g_free (utf8);
+        } else {
+#ifdef HAVE_LIBECAL
+                set_tooltip (cd->applet, cd->toggle, _("Click to view your appointments and tasks"));
+#else
+                set_tooltip (cd->applet, cd->toggle, _("Click to view month calendar"));
+#endif
+        }
 }
 
 static void


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