[evolution-patches] weather calendars



Here's my shot at this. Some things to cogitate:

* Events only show up in the list view. I'm trying to debug this, and
Rodrigo has suggested that it might be a buglet left over from the
recurrences branch merge. I've verified that the backend is sending
events properly for all the SExp queries made to it.

* Changing parameters (refresh, units preferences, etc) on the source
doesn't take immediate effect. It appears as though these changes aren't
communicated back to e-d-s.

I hope to solve these two soon.

* The bounty specifies that the e-d-s backend should supply the category
icons, but this seems overly complicated. I've added them to gal's
master category list for now, but in my ideal vision of this, a
rewritten calendar view system could allow the EPlugin to take care of
drawing the event, in which case the category system could be completely
uninvolved. However, such a fantastic plugin hook isn't necessary for
this to be useful now.

* Currently, the category is set to the closest-matching icon (from
those supplied with the gweather applet) and the summary contains
high/low temperatures. More detailed conditions, probability of
precipitation and snowfall amount forecasts are contained in the body of
the event. This hypothetical more-flexible calendar drawing code would
ideally allow the events to be drawn more like the mockup on the bounty.

* The backend is designed to be flexible wrt to sources - I've
implemented CCF (coded-cities-forecast), which provides data for the
USA. If people can find forecast sources for their countries, adding
support for additional formats should be simple. If weather.gnome.org
ever becomes a reality, it probably makes sense to switch to it)

* I'm pretty confident that Locations.xml is correct for all the CCF
products supplied by the NWS, but this was pretty tedious work, so it's
possible I made a mistake. It's also untranslated at the moment, which
is a big argument for switching weather.gnome.org once that becomes
real ;-)


Thanks,
-David

Attachment: e-d-s-new-files.tar.gz
Description: application/compressed-tar

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/ChangeLog,v
retrieving revision 1.205
diff -u -r1.205 ChangeLog
--- ChangeLog	27 Dec 2004 14:30:28 -0000	1.205
+++ ChangeLog	30 Dec 2004 05:23:05 -0000
@@ -1,3 +1,8 @@
+2004-12-29  David Trowbridge <trowbrds cs colorado edu>
+
+	* libedataserver/e-source.c: Add logic for emitting a "changed" signal
+	if any of the properties change
+
 2004-12-27  Rodrigo Moya <rodrigo novell com>
 
 	* src/server.c (gnome_segv_handler): use the correct binary name (ie,
Index: configure.in
===================================================================
RCS file: /cvs/gnome/evolution-data-server/configure.in,v
retrieving revision 1.82
diff -u -r1.82 configure.in
--- configure.in	21 Dec 2004 06:52:15 -0000	1.82
+++ configure.in	30 Dec 2004 05:23:05 -0000
@@ -1134,6 +1134,9 @@
 gladedir="$privdatadir/glade"
 AC_SUBST(gladedir)
 
+weatherdatadir="$privdatadir/weather"
+AC_SUBST(weatherdatadir)
+
 dnl separate camel from e-d-s?  or should it be under the same spot?  same for now.
 camel_providerdir="${privlibdir}/camel-providers"
 AC_SUBST(camel_providerdir)
@@ -1200,6 +1203,7 @@
 calendar/backends/groupwise/Makefile
 calendar/backends/http/Makefile
 calendar/backends/contacts/Makefile
+calendar/backends/weather/Makefile
 calendar/tests/Makefile
 calendar/tests/ecal/Makefile
 camel/Makefile
Index: evolution-data-server.pc.in
===================================================================
RCS file: /cvs/gnome/evolution-data-server/evolution-data-server.pc.in,v
retrieving revision 1.2
diff -u -r1.2 evolution-data-server.pc.in
--- evolution-data-server.pc.in	30 Sep 2004 16:53:54 -0000	1.2
+++ evolution-data-server.pc.in	30 Dec 2004 05:23:05 -0000
@@ -4,6 +4,8 @@
 includedir= includedir@
 privlibdir= privlibdir@
 extensiondir= extensiondir@
+datadir= datadir@
+privdatadir= privdatadir@
 
 idldir= idldir@
 IDL_INCLUDES=-I ${idldir} @IDL_INCLUDES@
Index: calendar/backends/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/Makefile.am,v
retrieving revision 1.3
diff -u -r1.3 Makefile.am
--- calendar/backends/Makefile.am	9 Jan 2004 20:05:27 -0000	1.3
+++ calendar/backends/Makefile.am	30 Dec 2004 05:23:06 -0000
@@ -1 +1 @@
-SUBDIRS = file groupwise http contacts
+SUBDIRS = file groupwise http contacts weather

Attachment: evolution-new-files.tar.gz
Description: application/compressed-tar

Index: configure.in
===================================================================
RCS file: /cvs/gnome/evolution/configure.in,v
retrieving revision 1.755
diff -u -r1.755 configure.in
--- configure.in	23 Dec 2004 07:00:30 -0000	1.755
+++ configure.in	30 Dec 2004 05:23:01 -0000
@@ -1232,6 +1232,11 @@
 	AC_MSG_ERROR(no)
 fi
 
+dnl -- e-d-s weather datadir
+dataserver_datadir=`pkg-config --variable=privdatadir evolution-data-server-1.2`
+weatherdatadir="$dataserver_datadir/weather"
+AC_SUBST(weatherdatadir)
+
 dnl --- evolution-test flags
 
 EVO_SET_COMPILE_FLAGS(EVOLUTION_TEST, libgnome-2.0 libgnomeui-2.0 libbonobo-2.0 libbonoboui-2.0 >= $BONOBOUI_REQUIRED)
@@ -1333,7 +1338,7 @@
 AC_ARG_ENABLE(plugins, [  --enable-plugins=[no/all/list]      Enable plugins.],enable_plugins="$enableval",enable_plugins=base)
 
 dnl Add any new plugins here
-plugins_base="calendar-http groupwise-account-setup plugin-manager" 
+plugins_base="calendar-http calendar-weather groupwise-account-setup plugin-manager" 
 plugins_all="bbdb subject-thread save-attachments prefer-plain save-calendar select-one-source copy-tool mail-to-meeting mail-to-task folder-unsubscribe mark-calendar-offline audio-inline mailing-list-actions groupwise-account-setup"
 
 case x"$enable_plugins" in
@@ -1535,6 +1540,7 @@
 mail/importers/Makefile
 plugins/Makefile
 plugins/calendar-http/Makefile
+plugins/calendar-weather/Makefile
 plugins/plugin-manager/Makefile
 plugins/bbdb/Makefile
 plugins/audio-inline/Makefile
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2598
diff -u -r1.2598 ChangeLog
--- calendar/ChangeLog	27 Dec 2004 13:36:04 -0000	1.2598
+++ calendar/ChangeLog	30 Dec 2004 05:23:02 -0000
@@ -1,3 +1,7 @@
+2004-12-29  David Trowbridge <trowbrds cs colorado edu>
+
+	* gui/migration.c: Added creation of weather source group
+
 2004-12-26  Rodrigo Moya <rodrigo novell com>
 
 	* gui/e-cal-model.c (search_by_uid_and_client): removed superfluous if
Index: calendar/gui/migration.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/migration.c,v
retrieving revision 1.32
diff -u -r1.32 migration.c
--- calendar/gui/migration.c	7 Oct 2004 21:03:36 -0000	1.32
+++ calendar/gui/migration.c	30 Dec 2004 05:23:03 -0000
@@ -362,6 +362,7 @@
 }
 
 
+#define WEATHER_BASE_URI "weather://"
 #define WEBCAL_BASE_URI "webcal://"
 #define CONTACTS_BASE_URI "contacts://"
 #define BAD_CONTACTS_BASE_URI "contact://"
@@ -393,7 +394,8 @@
 			 ESourceGroup **on_this_computer,
 			 ESource **personal_source,
 			 ESourceGroup **on_the_web,
-			 ESourceGroup **contacts)
+			 ESourceGroup **contacts,
+			 ESourceGroup **weather)
 {
 	GSList *groups;
 	ESourceGroup *group;
@@ -402,6 +404,7 @@
 	*on_this_computer = NULL;
 	*on_the_web = NULL;
 	*contacts = NULL;
+	*weather = NULL;
 	*personal_source = NULL;
 
 	base_uri = g_build_filename (calendar_component_peek_base_directory (component),
@@ -486,7 +489,15 @@
 
 		*contacts = group;
 	}
-	
+
+	if (!*weather) {
+		/* Create the Weather source group */
+		group = e_source_group_new (_("Weather"), WEATHER_BASE_URI);
+		e_source_list_add_group (source_list, group, -1);
+
+		*weather = group;
+	}
+
 	g_free (base_uri_proto);
 	g_free (base_uri);
 }
@@ -698,14 +709,14 @@
 gboolean
 migrate_calendars (CalendarComponent *component, int major, int minor, int revision, GError **err)
 {
-	ESourceGroup *on_this_computer = NULL, *on_the_web = NULL, *contacts = NULL;
+	ESourceGroup *on_this_computer = NULL, *on_the_web = NULL, *contacts = NULL, *weather = NULL;
 	ESource *personal_source = NULL;
 	gboolean retval = FALSE;
 
 	/* we call this unconditionally now - create_groups either
 	   creates the groups/sources or it finds the necessary
 	   groups/sources. */
-	create_calendar_sources (component, calendar_component_peek_source_list (component), &on_this_computer, &personal_source, &on_the_web, &contacts);
+	create_calendar_sources (component, calendar_component_peek_source_list (component), &on_this_computer, &personal_source, &on_the_web, &contacts, &weather);
 
 	if (major == 1) {
 		xmlDocPtr config_doc = NULL;
@@ -841,6 +852,8 @@
 		g_object_unref (on_the_web);
 	if (contacts)
 		g_object_unref (contacts);
+	if (weather)
+		g_object_unref (weather);
 	if (personal_source)
 		g_object_unref (personal_source);
 

Attachment: gal-new-files.tar.gz
Description: application/compressed-tar

? art/category_weather_cloudy_16.png
? art/category_weather_fog_16.png
? art/category_weather_partly_cloudy_16.png
? art/category_weather_rain_16.png
? art/category_weather_snow_16.png
? art/category_weather_sun_16.png
? art/category_weather_tstorm_16.png
Index: art/Makefile.am
===================================================================
RCS file: /cvs/gnome/gal/art/Makefile.am,v
retrieving revision 1.4
diff -u -r1.4 Makefile.am
--- art/Makefile.am	8 Jan 2003 19:16:12 -0000	1.4
+++ art/Makefile.am	30 Dec 2004 03:08:28 -0000
@@ -5,8 +5,8 @@
 	category_favorites_16.png		\
 	category_gifts_16.png			\
 	category_goals_16.png			\
-	category_holiday_16.png			\
 	category_holiday-cards_16.png		\
+	category_holiday_16.png			\
 	category_hot-contacts_16.png		\
 	category_ideas_16.png			\
 	category_international_16.png		\
@@ -17,7 +17,14 @@
 	category_status_16.png			\
 	category_strategies_16.png		\
 	category_suppliers_16.png		\
-	category_time-and-expenses_16.png
+	category_time-and-expenses_16.png	\
+	category_weather_cloudy_16.png		\
+	category_weather_fog_16.png		\
+	category_weather_partly_cloudy_16.png	\
+	category_weather_rain_16.png		\
+	category_weather_snow_16.png		\
+	category_weather_sun_16.png		\
+	category_weather_tstorm_16.png
 
 EXTRA_DIST = \
 	$(images_DATA)
Index: gal/widgets/e-categories-master-list-array.c
===================================================================
RCS file: /cvs/gnome/gal/gal/widgets/e-categories-master-list-array.c,v
retrieving revision 1.14
diff -u -r1.14 e-categories-master-list-array.c
--- gal/widgets/e-categories-master-list-array.c	16 Nov 2002 23:42:17 -0000	1.14
+++ gal/widgets/e-categories-master-list-array.c	30 Dec 2004 03:08:29 -0000
@@ -64,27 +64,34 @@
 	gchar *category;
 	gchar *icon;
 } builtin_categories[] = {
-	{ N_("Birthday"),         GAL_IMAGESDIR "/category_birthday_16.png" },
-	{ N_("Business"),         GAL_IMAGESDIR "/category_business_16.png" },
-	{ N_("Competition"),      NULL },
-	{ N_("Favorites"),        GAL_IMAGESDIR "/category_favorites_16.png" },
-	{ N_("Gifts"),            GAL_IMAGESDIR "/category_gifts_16.png" },
-	{ N_("Goals/Objectives"), GAL_IMAGESDIR "/category_goals_16.png" },
-	{ N_("Holiday"),          GAL_IMAGESDIR "/category_holiday_16.png" },
-	{ N_("Holiday Cards"),    GAL_IMAGESDIR "/category_holiday-cards_16.png" },
-	{ N_("Hot Contacts"),     GAL_IMAGESDIR "/category_hot-contacts_16.png" },
-	{ N_("Ideas"),            GAL_IMAGESDIR "/category_ideas_16.png" },
-	{ N_("International"),    GAL_IMAGESDIR "/category_international_16.png" },
-	{ N_("Key Customer"),     GAL_IMAGESDIR "/category_key-customer_16.png" },
-	{ N_("Miscellaneous"),    GAL_IMAGESDIR "/category_miscellaneous_16.png" },
-	{ N_("Personal"),         GAL_IMAGESDIR "/category_personal_16.png" },
-	{ N_("Phone Calls"),      GAL_IMAGESDIR "/category_phonecalls_16.png" },
-	{ N_("Status"),           GAL_IMAGESDIR "/category_status_16.png" },
-	{ N_("Strategies"),       GAL_IMAGESDIR "/category_strategies_16.png" },
-	{ N_("Suppliers"),        GAL_IMAGESDIR "/category_suppliers_16.png" },
-	{ N_("Time & Expenses"),  GAL_IMAGESDIR "/category_time-and-expenses_16.png" },
-	{ N_("VIP"),              NULL },
-	{ N_("Waiting"),          NULL },
+	{ N_("Birthday"),               GAL_IMAGESDIR "/category_birthday_16.png" },
+	{ N_("Business"),               GAL_IMAGESDIR "/category_business_16.png" },
+	{ N_("Competition"),            NULL },
+	{ N_("Favorites"),              GAL_IMAGESDIR "/category_favorites_16.png" },
+	{ N_("Gifts"),                  GAL_IMAGESDIR "/category_gifts_16.png" },
+	{ N_("Goals/Objectives"),       GAL_IMAGESDIR "/category_goals_16.png" },
+	{ N_("Holiday"),                GAL_IMAGESDIR "/category_holiday_16.png" },
+	{ N_("Holiday Cards"),          GAL_IMAGESDIR "/category_holiday-cards_16.png" },
+	{ N_("Hot Contacts"),           GAL_IMAGESDIR "/category_hot-contacts_16.png" },
+	{ N_("Ideas"),                  GAL_IMAGESDIR "/category_ideas_16.png" },
+	{ N_("International"),          GAL_IMAGESDIR "/category_international_16.png" },
+	{ N_("Key Customer"),           GAL_IMAGESDIR "/category_key-customer_16.png" },
+	{ N_("Miscellaneous"),          GAL_IMAGESDIR "/category_miscellaneous_16.png" },
+	{ N_("Personal"),               GAL_IMAGESDIR "/category_personal_16.png" },
+	{ N_("Phone Calls"),            GAL_IMAGESDIR "/category_phonecalls_16.png" },
+	{ N_("Status"),                 GAL_IMAGESDIR "/category_status_16.png" },
+	{ N_("Strategies"),             GAL_IMAGESDIR "/category_strategies_16.png" },
+	{ N_("Suppliers"),              GAL_IMAGESDIR "/category_suppliers_16.png" },
+	{ N_("Time & Expenses"),        GAL_IMAGESDIR "/category_time-and-expenses_16.png" },
+	{ N_("VIP"),                    NULL },
+	{ N_("Waiting"),                NULL },
+	{ N_("Weather: Cloudy"),        GAL_IMAGESDIR "/category_weather_cloudy_16.png" },
+	{ N_("Weather: Fog"),           GAL_IMAGESDIR "/category_weather_fog_16.png" },
+	{ N_("Weather: Partly Cloudy"), GAL_IMAGESDIR "/category_weather_partly_cloudy_16.png" },
+	{ N_("Weather: Rain"),          GAL_IMAGESDIR "/category_weather_rain_16.png" },
+	{ N_("Weather: Snow"),          GAL_IMAGESDIR "/category_weather_snow_16.png" },
+	{ N_("Weather: Sunny"),         GAL_IMAGESDIR "/category_weather_sun_16.png" },
+	{ N_("Weather: Thunderstorms"), GAL_IMAGESDIR "/category_weather_tstorm_16.png" },
 };
 
 #define BUILTIN_CATEGORY_COUNT (sizeof(builtin_categories) / sizeof(builtin_categories[0]))


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