From a6519abcc8818b113f6b217050a4e27f575fb8ab Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 22 Feb 2008 18:10:39 +0000 Subject: Fix reporting of sunrise/sunset times --- gnome-panel.spec | 8 +++++- sunrise.patch | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 sunrise.patch diff --git a/gnome-panel.spec b/gnome-panel.spec index 6eda963..6b23584 100644 --- a/gnome-panel.spec +++ b/gnome-panel.spec @@ -22,7 +22,7 @@ Summary: GNOME panel Name: gnome-panel Version: 2.21.91 -Release: 8%{?dist} +Release: 9%{?dist} URL: http://www.gnome.org Source0: http://download.gnome.org/sources/gnome-panel/2.21/%{name}-%{version}.tar.bz2 @@ -132,6 +132,8 @@ Patch21: less-resizing.patch # http://bugzilla.gnome.org/show_bug.cgi?id=517191 Patch22: open-drawer.patch +Patch23: sunrise.patch + Conflicts: gnome-power-manager < 2.15.3 %description @@ -185,6 +187,7 @@ Panel Applets using the libpanel-applet library. %patch20 -p1 -b .dst-offset %patch21 -p1 -b .less-resizing %patch22 -p1 -b .open-drawer +%patch23 -p1 -b .sunrise . %{SOURCE6} @@ -369,6 +372,9 @@ fi %{_datadir}/gtk-doc/html/* %changelog +* Fri Feb 22 2008 Matthias Clasen - 2.21.91-9 +- Report sunrise/sunset times in local time + * Thu Feb 21 2008 Matthias Clasen - 2.21.91-8 - Make drawers open again diff --git a/sunrise.patch b/sunrise.patch new file mode 100644 index 0000000..4a27c96 --- /dev/null +++ b/sunrise.patch @@ -0,0 +1,81 @@ +diff -up gnome-panel-2.21.91/applets/clock/clock-location-tile.c.sunrise gnome-panel-2.21.91/applets/clock/clock-location-tile.c +--- gnome-panel-2.21.91/applets/clock/clock-location-tile.c.sunrise 2008-02-22 12:56:42.000000000 -0500 ++++ gnome-panel-2.21.91/applets/clock/clock-location-tile.c 2008-02-22 13:08:01.000000000 -0500 +@@ -534,13 +534,14 @@ clock_location_tile_refresh (ClockLocati + } + + void +-weather_info_setup_tooltip (WeatherInfo *info, GtkTooltip *tooltip) ++weather_info_setup_tooltip (WeatherInfo *info, ClockLocation *location, GtkTooltip *tooltip) + { + GdkPixbuf *pixbuf = NULL; + GtkIconTheme *theme = NULL; + const gchar *conditions, *temp, *apparent, *wind; + gchar *line1, *line2, *line3, *line4, *tip; + const gchar *icon_name; ++ const gchar *sys_timezone; + + icon_name = weather_info_get_icon_name (info); + theme = gtk_icon_theme_get_default (); +@@ -571,9 +572,20 @@ weather_info_setup_tooltip (WeatherInfo + else + line3 = g_strdup (""); + ++ /* FIXME: we need libgweather to give us the time, ++ * not just a formatted string ++ */ ++ sys_timezone = getenv ("TZ"); ++ setenv ("TZ", clock_location_get_timezone (location), 1); ++ tzset (); + line4 = g_strdup_printf (_("Sunrise: %s / Sunset: %s"), + weather_info_get_sunrise (info), + weather_info_get_sunset (info)); ++ if (sys_timezone) ++ setenv ("TZ", sys_timezone, 1); ++ else ++ unsetenv ("TZ"); ++ tzset (); + + tip = g_strdup_printf ("%s\n%s\n%s%s", line1, line2, line3, line4); + gtk_tooltip_set_markup (tooltip, tip); +@@ -601,7 +613,7 @@ weather_tooltip (GtkWidget *widget, + if (!info || !weather_info_is_valid (info)) + return FALSE; + +- weather_info_setup_tooltip (info, tooltip); ++ weather_info_setup_tooltip (info, priv->location, tooltip); + + return TRUE; + } +diff -up gnome-panel-2.21.91/applets/clock/clock.c.sunrise gnome-panel-2.21.91/applets/clock/clock.c +--- gnome-panel-2.21.91/applets/clock/clock.c.sunrise 2008-02-22 12:56:42.000000000 -0500 ++++ gnome-panel-2.21.91/applets/clock/clock.c 2008-02-22 12:56:42.000000000 -0500 +@@ -1341,12 +1341,13 @@ weather_tooltip (GtkWidget *widget, + locations = cd->locations; + + for (l = locations; l; l = l->next) { +- if (clock_location_is_current (l->data)) { +- info = clock_location_get_weather_info (l->data); ++ ClockLocation *location = l->data; ++ if (clock_location_is_current (location)) { ++ info = clock_location_get_weather_info (location); + if (!info || !weather_info_is_valid (info)) + continue; + +- weather_info_setup_tooltip (info, tooltip); ++ weather_info_setup_tooltip (info, location, tooltip); + + return TRUE; + } +diff -up gnome-panel-2.21.91/applets/clock/clock-location-tile.h.sunrise gnome-panel-2.21.91/applets/clock/clock-location-tile.h +--- gnome-panel-2.21.91/applets/clock/clock-location-tile.h.sunrise 2008-02-22 12:56:42.000000000 -0500 ++++ gnome-panel-2.21.91/applets/clock/clock-location-tile.h 2008-02-22 12:56:42.000000000 -0500 +@@ -37,7 +37,7 @@ ClockLocationTile *clock_location_tile_n + + ClockLocation *clock_location_tile_get_location (ClockLocationTile *this); + +-void weather_info_setup_tooltip (WeatherInfo *info, GtkTooltip *tip); ++void weather_info_setup_tooltip (WeatherInfo *info, ClockLocation *location, GtkTooltip *tip); + + void clock_location_tile_refresh (ClockLocationTile *this, + gboolean force_refresh); -- cgit