After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 352287 - share weather locations with gweather panel applet
share weather locations with gweather panel applet
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Calendar
2.24.x (obsolete)
Other Linux
: Normal enhancement
: ---
Assigned To: Milan Crha
Evolution QA team
: 272056 303308 345021 461677 (view as bug list)
Depends on: 538787
Blocks: 272056
 
 
Reported: 2006-08-21 18:40 UTC by André Klapper
Modified: 2010-04-01 17:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
eds part (under construction) (22.69 KB, text/plain)
2008-06-12 12:59 UTC, Milan Crha
  Details
evo part (under construction) (14.09 KB, text/plain)
2008-06-12 12:59 UTC, Milan Crha
  Details
raw data (3.31 KB, text/plain)
2008-06-12 13:07 UTC, Milan Crha
  Details
proposed eds patch (26.17 KB, patch)
2008-11-21 17:48 UTC, Milan Crha
none Details | Review
proposed evo patch (15.27 KB, patch)
2008-11-21 17:58 UTC, Milan Crha
none Details | Review
Suggested patch to libgweather (4.87 KB, patch)
2008-11-24 08:57 UTC, Tor Lillqvist
committed Details | Review
Screen shot (16.95 KB, image/png)
2008-11-27 09:30 UTC, Akhil Laddha
  Details
proposed eds patch ][ (26.42 KB, patch)
2008-12-01 09:40 UTC, Milan Crha
committed Details | Review
proposed evo patch ][ (15.68 KB, patch)
2008-12-01 09:53 UTC, Milan Crha
committed Details | Review
Build weather cal backend optionally (4.31 KB, patch)
2008-12-08 06:04 UTC, Suman Manjunath
none Details | Review
Build weather cal plugin only if libgweather was found (2.13 KB, patch)
2008-12-08 11:21 UTC, Suman Manjunath
needs-work Details | Review
Build weather cal backend optionally (3.73 KB, patch)
2008-12-09 06:27 UTC, Suman Manjunath
committed Details | Review
Build weather cal plugin optionally (2.85 KB, patch)
2008-12-09 06:29 UTC, Suman Manjunath
committed Details | Review

Description André Klapper 2006-08-21 18:40:44 UTC
...which are in gnome-applets/gweather/Locations.xml.in

this would fix bug 351563 and would make the weather applet finally useful.
currently it isn't.
Comment 1 Chenthill P 2006-08-31 13:49:15 UTC
Yes, thats a good approach. Probably we can do it for 2.9.
Comment 2 Milan Crha 2008-01-08 16:55:44 UTC
What about to wait until the libgweather is done? (or "at least" usable for us)
Comment 3 André Klapper 2008-01-11 02:58:47 UTC
milan: this is the plan for libgweather:
http://mail.gnome.org/archives/desktop-devel-list/2008-January/msg00064.html

so you could start if you want to. or you could even become the guy to propose an API architecture for libgweather. remember, this is 2008. the fun is over. ;-)
Comment 4 Matthew Barnes 2008-03-11 00:29:20 UTC
Bumping version to a stable release.
Comment 5 André Klapper 2008-04-17 10:38:19 UTC
libgweather IS done now. go, go! ;-)
Comment 6 Matthew Barnes 2008-04-17 12:01:37 UTC
If someone takes this on, please update http://www.go-evolution.org/Evo2.24 by adding an item to the task list with your name.  It's already listed there as a proposal.
Comment 7 Milan Crha 2008-04-18 13:02:29 UTC
is it wise to do it in such early development stage? :)
#ifndef GWEATHER_I_KNOW_THIS_IS_UNSTABLE
#error "libgweather should only be used if you understand that it's subject to change, and is not supported as a fixed API/ABI or as part of the platform"
#endif
Comment 8 Matthew Barnes 2008-04-18 13:14:11 UTC
I think that just means we may have to occasionally adapt to ABI/API changes in libgweather during an unstable development cycle.  Stable releases should not be a problem.

D-BUS did something like that for a long time before finally reaching 1.0.
Comment 9 André Klapper 2008-05-10 00:12:48 UTC
so - anybody working on this?
Comment 10 Milan Crha 2008-06-12 12:59:28 UTC
Created attachment 112613 [details]
eds part (under construction)
Comment 11 Milan Crha 2008-06-12 12:59:55 UTC
Created attachment 112614 [details]
evo part (under construction)
Comment 12 Milan Crha 2008-06-12 13:07:24 UTC
Created attachment 112615 [details]
raw data

Unfortunately, the thing libgweather returns is suitable only for gweather applet, even everything is stored in data structures, then return values are strings, which is kinda unusable for parsing. Also the forecast information, if available is in natural language, which is also kinda unusable for forecast events in Evolution. The changes above just demonstrates the possibility how to do this, but the concept of the change in eds can be different (like dropping ccf sources and adapt the parent class to our needs). The change in evo/calendar is only to show nice system weather icons, without that "test" change, the icons looks horrible.

Nevertheless, there are required some changes in libgweather to let it work for us with minimal effort.
Comment 13 Milan Crha 2008-11-21 17:48:16 UTC
Created attachment 123186 [details] [review]
proposed eds patch

for evolution-data-server;

The patch for libgweather from bug #538787 is required to have this running. One question came on my mind: is libgweather portable on Win32? I know Noell guys did quite much effort to have Evo running on Win32, and even I do not know if this backaend is included or not, then I made the libgweather as a requirement for eds and evo, thus if it's not portable, then quite bad luck and other approach should be chosen (like conditional compiling with old code if libgweather not available).
Comment 14 Milan Crha 2008-11-21 17:58:34 UTC
Created attachment 123187 [details] [review]
proposed evo patch

for evolution;

Necessary changes in Evolution; notice other icon drawings in top item in calendar's day view. Without that those full color bitmaps are drawn in a very ugly way. Also, I didn't add any requirement to configure.in here, not sure if required or not, when using right eds.
Comment 15 André Klapper 2008-11-21 18:00:59 UTC
<andre> vuntz, is libgweather portable on Win32?
<andre> (cf bug 352287)
<vuntz> andre: absolutely no idea
<andre> k
<vuntz> andre: I guess it could work
<vuntz> with some work, though
Comment 16 Vincent Untz 2008-11-21 18:03:42 UTC
(In reply to comment #13)
> One question came on my mind: is libgweather portable on Win32?

No idea. I guess it can work there -- probably just a few changes. We simply need someone who knows this kind of stuff :-)
Comment 17 Milan Crha 2008-11-21 18:08:30 UTC
(In reply to comment #16)
> No idea. I guess it can work there -- probably just a few changes. We simply
> need someone who knows this kind of stuff :-)

Sure, no problem, I got similar response from Dan, but I wanted to write the question somewhere. Let's see whether Bharath will be able to do that or not :)
Comment 18 Tor Lillqvist 2008-11-24 08:24:09 UTC
libgweather seems to be portable as such, I guess the only change needed to make it behave sensibly is to replace the hardcoded configure-time ZONEINFO_DIR with a run-time determination of it based on the location of the libgweather DLL, in the same way as done all over the place in the stack as ported to Windows already. (Ditto for GNOMELOCALEDIR.)

I don't know if using zoneinfo data is really nice on Windows, though. Would it make more sense to instead just use the data as provided by the native Win32 timezone information?
Comment 19 Tor Lillqvist 2008-11-24 08:57:26 UTC
Created attachment 123310 [details] [review]
Suggested patch to libgweather

This patch adds Win32 love to libgweather. Seems to work, at least test_locations worked and used the correct l10n for my locale.

Presumably it would be a good idea to use the regex API in GLib instead of relying on a regex API in the C library or a separate libregex (as currently necessary on Win32).
Comment 20 Tor Lillqvist 2008-11-24 10:22:46 UTC
Hmm, so this bug are about making evolution use libgweather for the *weather* stuff, right? Is there some other bug already open for issues related to what timezone API evolution could/should use on Windows?

It's a bit silly to distribute 379 files of zoneinfo (from libical in e-d-s) or 77 MB of localised verbose XML (from libgweather) with Evolution when the Win32 API contains functions to get most of that information already. Unfortunately I am not entirely sure it is trivial to get all the required information from the Win32 API, though. The Win32 timezone API doesn't tell the geographic coordinates of some representative city that uses the timezone, for instance. And the GEO_TIMEZONES enumeration of the GetGeoInfo() API is "not implemented", says MSDN. But maybe I just need to browse more of the documentation to find out a way to connect GEOIDs with timezones.
Comment 21 Tor Lillqvist 2008-11-24 10:44:09 UTC
Hmm, I was too optimistic about the Win32 API. Apparently there isn't any way to enumerate the time zones known by the system and get information for an arbitrary time zone. (Although the system surely has that information somewhere.)
Comment 22 Vincent Untz 2008-11-24 12:09:21 UTC
Comment on attachment 123310 [details] [review]
Suggested patch to libgweather

Maybe it makes sense to move most of the stuff that is inside "#idef G_OS_WIN32" in a gweather-win32.h file and then include this file where it makes sense?
Comment 23 Tor Lillqvist 2008-11-24 12:14:31 UTC
you mean the localtime_r definition? that's the only repeated stuff afaics.
Comment 24 Srinivasa Ragavan 2008-11-27 04:41:18 UTC
This is awesome. We should get this in for 2.25.2

I'll try to give it some test before that.
Comment 25 Akhil Laddha 2008-11-27 09:30:40 UTC
Created attachment 123529 [details]
Screen shot 

Cool, Milan, I applied the patches and it worked nicely. Before that i had built libgweather. 

Minor issues
=============

-> Changes come into effect only after evolution restart. Like if i change Celsius to Fahrenheit, it will reflect only after restart.

-> Africa continent has its bullets expanded. Every time i need to collapse them.

-> I don't know what is the icon with New Delhi.  In other places it is Day, cloud etc

Enhancement
============

-> Looking for a particular place is not easy as we have in clock applet. 

General
=======

I have attached the screen shot of calendar. I feel weather details should follow place name. Currently we have place name after weather info.
And if we can make place name bold, it will be good. 

My thoughts, you can disagree :-)
Comment 26 Akhil Laddha 2008-11-27 09:33:16 UTC
We should be able to close bug 303308 , bug 345021 , bug 461677 after these patches will get committed. 
Comment 27 Milan Crha 2008-12-01 09:35:09 UTC
(In reply to comment #25)
> Minor issues
> =============
> 
> -> Changes come into effect only after evolution restart. Like if i change
> Celsius to Fahrenheit, it will reflect only after restart.

I'm sorry, I cannot do anything here, see comment in source_changed in the
http://svn.gnome.org/viewvc/evolution-data-server/trunk/calendar/backends/weather/e-cal-backend-weather.c?view=markup

> -> Africa continent has its bullets expanded. Every time i need to collapse
> them.

I changed autoexpand in Evolution, but this one is inside libgweather/GtkTree, I can reproduce it even in weather applet.

> -> I don't know what is the icon with New Delhi.  In other places it is Day,
> cloud etc

I guess it's a fog, isn't it? You can see the detailed info when opening the whole day event. Order of the text in the summary changed. I also changed the way how it shows temperatures, before it showed "temp/dew" in the day and "temp_min/temp_max" in a forecast, which was a bit misleading. Thus changing the day to "temp_min/temp_max" if available, otherwise just "temp" is shown.

> Enhancement
> ============
> 
> -> Looking for a particular place is not easy as we have in clock applet. 

Yup, could be an enhancement bug, for the "find" feature which has the gweather applet. (it crashes to me, but no big deal).

> General
> =======
> 
> I have attached the screen shot of calendar. I feel weather details should
> follow place name. Currently we have place name after weather info.
> And if we can make place name bold, it will be good. 

I'm sorry, we cannot change bolding in the summary text, unfortunately, but changing order would work, I hope.

> My thoughts, you can disagree :-)  

No no, I agree, thanks for them.
Comment 28 Milan Crha 2008-12-01 09:40:32 UTC
Created attachment 123729 [details] [review]
proposed eds patch ][

for evolution-data-server;

Applied changes mentioned by Akhil.
Comment 29 Milan Crha 2008-12-01 09:53:38 UTC
Created attachment 123730 [details] [review]
proposed evo patch ][

for evolution;

no autoexpand on evo's side when selecting the node.
I added bug #562839 for the issue with expanding the first node.
Comment 30 André Klapper 2008-12-01 19:48:10 UTC
(In reply to comment #25)
> Created an attachment (id=123529) [edit]
> Screen shot 

Is there a reason why these icons are different from those we have in the gnome 2.22 clock-applet that combines clock and weather?
Comment 31 Milan Crha 2008-12-02 09:00:40 UTC
(In reply to comment #30)
> Is there a reason why these icons are different from those we have in the gnome
> 2.22 clock-applet that combines clock and weather?

evo has its own icons for the categories. Not so big deal to improve it, in other bug :)

Comment 32 Vincent Untz 2008-12-02 18:12:24 UTC
I've committed something based on Tor's work to make libgweather work on windows. Of course, I'm pretty sure I broke stuff, so testing would be welcome ;-)
Comment 33 Srinivasa Ragavan 2008-12-03 04:41:34 UTC
Milan, commit to trunk. Any other issues, we can take through bugs.
Comment 34 Milan Crha 2008-12-03 12:29:56 UTC
eds part committed to trunk. Committed revision 9793.
evo part committed to trunk. Committed revision 36827.

I changed libgweather version requirement to 2.25.3 in the eds part, it's otherwise same. Let's solve new/other issue(s) in new bug(s).
Comment 35 Matthew Barnes 2008-12-04 05:43:25 UTC
I'm reopening the bug in order to make the libgweather dependency optional.  We should have a configure option for both e-d-s and evo (--with-libgweather) that defaults to 'yes' but if disabled will skip building the weather libedata-cal backend and Evolution plugin.
Comment 36 Sankar P 2008-12-08 02:58:34 UTC
Have we not decided that we will be depending on the stable branch APIs for our gnome dependencies ? 
Comment 37 Suman Manjunath 2008-12-08 06:04:54 UTC
Created attachment 124147 [details] [review]
Build weather cal backend optionally

Here's a patch to build the weather calendar backend optionally. Enabled by default, use --disable-weather to disable it - as always ;-)

Something similar is needed for evolution too.
Comment 38 Suman Manjunath 2008-12-08 11:21:47 UTC
Created attachment 124153 [details] [review]
Build weather cal plugin only if libgweather was found

autotools are fun! I didn't expect it to be this simple ;-)
Comment 39 Gilles Dartiguelongue 2008-12-08 12:52:31 UTC
please don't make your autofoo autodetect stuff only and allow stuff to either be disabled, enabled or autodetected.

Please see http://www.gentoo.org/proj/en/qa/automagic.xml for why this is important for downstream.
Comment 40 Matthew Barnes 2008-12-08 15:22:12 UTC
Agreed.  The Evolution side should be explicit as well.

Couple other things:

  - Please list the mimimum required gweather version at the top of the file
    alongside the others, so they're all in one place.

  - If the weather calendar is enabled on the Evolution side, consider testing
    for libebackendweather.so if not found, abort with a helpful message.

I still need to test the e-d-s patch, but the approach looks correct.
Comment 41 Matthew Barnes 2008-12-08 15:29:09 UTC
(In reply to comment #36)
> Have we not decided that we will be depending on the stable branch APIs for our
> gnome dependencies ? 

We have.  I guess this is a special case, though, since gweather is only a desktop library (not a platform library like GTK+) and they modified their API explicitly for us.  But that's why I want the dependency optional, so I can
still build Evolution 2.25 on GNOME 2.24.
Comment 42 Suman Manjunath 2008-12-08 16:52:52 UTC
(In reply to comment #40)
> Agreed.  The Evolution side should be explicit as well.

I did try that route. More below.

>   - If the weather calendar is enabled on the Evolution side, consider testing
>     for libebackendweather.so if not found, abort with a helpful message.

This is installed not in the usual prefix. libebackendweather.so is stashed away in {_libdir}/evolution-data-server-1.2/extensions/ . As such, AC_CHECK_LIB() can't be used (please correct me if I'm wrong here). A manual 'test' for the 'existence' of the .so needs to be carried out. Such a 'test' would have little meaning. 

I still agree that we should remove the automagic in evolution and make the dependency explicit. Only scenario where we need to worry about: 

e-d-s built with --disable-weather 
&&
evolution built with --enable-weather

^^ This I think would not be as catastrophic as it might appear. Evolution would compile with the plugin enabled. Only, no weather cal factories would be available when a user tries to create a weather calendar. Wouldn't crash, but wouldn't do anything else either :-)
Comment 43 Matthew Barnes 2008-12-08 19:29:04 UTC
Yeah, getting AC_CHECK_LIB() to work for that case might require some crazy LD_LIBRARY_PATH hack before calling the macro.  Not sure.

I think your proposal sounds fine as is.
Comment 44 Suman Manjunath 2008-12-09 06:27:24 UTC
Created attachment 124240 [details] [review]
Build weather cal backend optionally

better patch, since we are using an optional library, using --with seemed better than --enable
Comment 45 Suman Manjunath 2008-12-09 06:29:09 UTC
Created attachment 124241 [details] [review]
Build weather cal plugin optionally

okay.. specify explicit dependency on gweather and provide an option to skip building the plugin
Comment 46 Matthew Barnes 2008-12-09 15:20:54 UTC
Minor nitpick about the help strings.  Write them in positive form:

   (EDS)  --with-weather      Build the weather calendar backend
   (Evo)  --with-weather      Build the weather calendar setup plugin

Also a good idea to indicate the default:

   [Build the weather calendar backend [default=yes]]

Apart from that, looks great!  Approved.
Comment 47 Suman Manjunath 2008-12-10 03:44:50 UTC
(In reply to comment #46)
> Minor nitpick about the help strings.  Write them in positive form:
> 
>    (EDS)  --with-weather      Build the weather calendar backend
>    (Evo)  --with-weather      Build the weather calendar setup plugin

I tried to follow the template at http://www.gentoo.org/proj/en/qa/automagic.xml#doc_chap2 :-) 

Anyway, I've changed it. 

> Also a good idea to indicate the default:
> 
>    [Build the weather calendar backend [default=yes]]

Sure.. done that!

> Apart from that, looks great!  Approved.

e-d-s patch committed to SVN trunk in r9821
http://svn.gnome.org/viewvc/evolution-data-server?view=revision&revision=9821

evolution patch committed to SVN trunk in r36860
http://svn.gnome.org/viewvc/evolution?view=revision&revision=36860
Comment 48 Akhil Laddha 2008-12-29 08:53:37 UTC
*** Bug 303308 has been marked as a duplicate of this bug. ***
Comment 49 Akhil Laddha 2008-12-29 08:53:55 UTC
*** Bug 345021 has been marked as a duplicate of this bug. ***
Comment 50 Akhil Laddha 2008-12-29 08:54:15 UTC
*** Bug 461677 has been marked as a duplicate of this bug. ***
Comment 51 Gil Forcada 2009-01-14 01:04:04 UTC
The weather locations are still in the po files with the given advice at top:
#. * These are the timezone names from the Olson timezone data.
#. * We only place them here so gettext picks them up for translation.
#. * Don't include in any C files.

It's the proper way to leave the translations there?

If I'm correct translators will have to translate the strings twice as always. So which is the benefit of the patches applied here?

I just don't get it.
Comment 52 André Klapper 2009-03-09 19:37:16 UTC
Milan, can you answer the last comment?
Comment 53 Milan Crha 2009-03-09 20:30:41 UTC
Oops, I'm sorry, I overlooked/forgot this.

That Locations.xml.in is obsolete now, it seems, I forgot to get rid of it.

Somehow, I cannot find the mentioned text above in sources, where does it come from? (That with preceding "#. *")
Comment 54 Gil Forcada 2009-03-10 08:31:17 UTC
In addressbook/gui/contact-editor/e-contact-editor-address.c there are country names

In calendar/zones.h there are the timezones.

Cheers,
Comment 55 Milan Crha 2009-03-10 12:20:23 UTC
(In reply to comment #54)
> In addressbook/gui/contact-editor/e-contact-editor-address.c there are country
> names
> 
> In calendar/zones.h there are the timezones.

Thanks for the pointers. These have nothing to do with weather, though, but more interestingly, I didn't find a place where is used e-contact-editor-address.c, it's obsolete from my point of view, but maybe I searched incorrectly.

I've no idea about that zones.h, it would take quite much time to find where exactly are these used in calendar.
Comment 56 André Klapper 2009-03-10 13:19:59 UTC
(In reply to comment #55)
> addressbook/gui/contact-editor/e-contact-editor-address.c 

what about removing and compiling? :)

> I've no idea about that zones.h, it would take quite much time to find where
> exactly are these used in calendar.


evolution's calendar/zones.h and libical-0.43's zoneinfo/zones.h look completely the same to me.
Comment 57 André Klapper 2009-03-10 13:50:32 UTC
(In reply to comment #55)
> addressbook/gui/contact-editor/e-contact-editor-address.c 
> I didn't find a place where is used e-contact-editor-address.c, it's 
> obsolete from my point of view, but maybe I searched incorrectly.

$:andre\> grep -r e-contact-editor-address.h .
./addressbook/gui/contact-editor/e-contact-editor.c:
  #include "e-contact-editor-address.h"

> I've no idea about that zones.h, it would take quite much time to find where
> exactly are these used in calendar.

evolution's calendar/zones.h and libical-0.43's zoneinfo/zones.h look completely the same to me.
Comment 58 Milan Crha 2009-03-10 14:26:27 UTC
(In reply to comment #57)
> $:andre\> grep -r e-contact-editor-address.h .
> ./addressbook/gui/contact-editor/e-contact-editor.c:
>   #include "e-contact-editor-address.h"

I know, it's included, but I didn't find usage from the header there, nor in the UI. Though it doesn't necessary mean it isn't used.

(In reply to comment #56)
> what about removing and compiling? :)

Yes, that's one option. But it depends, whether it'll be used any time later or not, even I believe we both know the answer :)
Comment 59 André Klapper 2009-05-14 14:12:49 UTC
Gil, can you file a separate ticket about comment 54 please?
Comment 60 Gil Forcada 2009-05-17 08:44:56 UTC
(In reply to comment #59)
> Gil, can you file a separate ticket about comment 54 please?
> 

Done: #582922

Seems the country names are gone, so only the timezones are left.
Comment 61 Milan Crha 2010-04-01 17:07:16 UTC
*** Bug 272056 has been marked as a duplicate of this bug. ***