[PATCH] notification hints for weather applet
- From: Rodrigo Moya <rodrigo gnome-db org>
- To: Davyd Madeley <davyd madeley id au>
- Cc: desktop-devel-list gnome org
- Subject: [PATCH] notification hints for weather applet
- Date: Wed, 24 Aug 2005 18:18:10 +0200
Hi
Since I saw this was added to the battery applet, I added it also to the
weather applet.
Ok to commit?
--
Rodrigo Moya <rodrigo gnome-db org>
? docs/gweather-C.omf
? docs/gweather-es.omf
? docs/es/.xml2po.mo
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/ChangeLog,v
retrieving revision 1.397
diff -u -p -r1.397 ChangeLog
--- ChangeLog 7 Aug 2005 16:19:37 -0000 1.397
+++ ChangeLog 24 Aug 2005 16:07:05 -0000
@@ -1,3 +1,7 @@
+2005-08-24 Rodrigo Moya <rodrigo novell com>
+
+ * gweather-applet.c (update_finish): use hints for the notification.
+
2005-08-08 Davyd Madeley <davyd madeley id au>
* weather.c: Use escaped characters for degree symbol and give
Index: gweather-applet.c
===================================================================
RCS file: /cvs/gnome/gnome-applets/gweather/gweather-applet.c,v
retrieving revision 1.96
diff -u -p -r1.96 gweather-applet.c
--- gweather-applet.c 10 Jul 2005 04:40:34 -0000 1.96
+++ gweather-applet.c 24 Aug 2005 16:07:06 -0000
@@ -426,9 +426,12 @@ void update_finish (WeatherInfo *info)
static int gw_fault_counter = 0;
#ifdef HAVE_LIBNOTIFY
static NotifyIcon *icon = NULL;
+ NotifyHints *hints;
char *notification_message, *notification_detail;
GdkPixbuf *pixbuf = NULL;
GConfClient *conf;
+ int x, y;
+ GtkRequisition size;
#endif
char *s;
GWeatherApplet *gw_applet = info->applet;
@@ -506,6 +509,15 @@ void update_finish (WeatherInfo *info)
g_free (tmp);
}
+ gdk_window_get_origin (GTK_WIDGET (gw_applet->applet)->window, &x, &y);
+ gtk_widget_size_request (GTK_WIDGET (gw_applet->applet), &size);
+ x += size.width / 2;
+ y += size.height;
+
+ hints = notify_hints_new ();
+ notify_hints_set_int (hints, "x", x);
+ notify_hints_set_int (hints, "y", y);
+
/* Show notification */
notification_message = g_strdup_printf ("%s: %s",
weather_info_get_location (info),
@@ -521,7 +533,7 @@ void update_finish (WeatherInfo *info)
notification_detail, /* body text */
icon, /* icon */
TRUE, 0, /* expiry, server default */
- NULL, /* hints */
+ hints, /* hints */
NULL, /* no user_data */
0)) /* no actions */
g_warning ("Could not send notification to daemon\n");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]