aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution/metar.c
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2001-07-10 04:08:30 +0800
committerIain Holmes <iain@src.gnome.org>2001-07-10 04:08:30 +0800
commit4138abc3ebb024c3f3b5c3063cca669a60147f6b (patch)
treea51992a3918155a6a3a57d83756a5e50bdc58e9c /my-evolution/metar.c
parent7c4e516f1c74de3ce8c975b8965b086b447f39ef (diff)
downloadgsoc2013-evolution-4138abc3ebb024c3f3b5c3063cca669a60147f6b.tar
gsoc2013-evolution-4138abc3ebb024c3f3b5c3063cca669a60147f6b.tar.gz
gsoc2013-evolution-4138abc3ebb024c3f3b5c3063cca669a60147f6b.tar.bz2
gsoc2013-evolution-4138abc3ebb024c3f3b5c3063cca669a60147f6b.tar.lz
gsoc2013-evolution-4138abc3ebb024c3f3b5c3063cca669a60147f6b.tar.xz
gsoc2013-evolution-4138abc3ebb024c3f3b5c3063cca669a60147f6b.tar.zst
gsoc2013-evolution-4138abc3ebb024c3f3b5c3063cca669a60147f6b.zip
Get a lovely icon from jimmac for the type of weather
svn path=/trunk/; revision=10929
Diffstat (limited to 'my-evolution/metar.c')
-rw-r--r--my-evolution/metar.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/my-evolution/metar.c b/my-evolution/metar.c
index ee99816e00..34ed397a19 100644
--- a/my-evolution/metar.c
+++ b/my-evolution/metar.c
@@ -611,3 +611,57 @@ metar_tok_cond (gchar *tokp,
return TRUE;
}
+
+const char *
+icon_from_weather (Weather *w)
+{
+ ESummaryWeatherConditions cond = w->cond;
+ ESummaryWeatherSky sky = w->sky;
+
+ switch (cond.phenomenon) {
+ case PHENOMENON_DRIZZLE:
+ case PHENOMENON_RAIN:
+ case PHENOMENON_UNKNOWN_PRECIPITATION:
+ case PHENOMENON_HAIL:
+ case PHENOMENON_SMALL_HAIL:
+ return "myweather-rain.png";
+ case PHENOMENON_SNOW:
+ case PHENOMENON_SNOW_GRAINS:
+ case PHENOMENON_ICE_PELLETS:
+ case PHENOMENON_ICE_CRYSTALS:
+ return "myweather-snow.png";
+ case PHENOMENON_TORNADO:
+ case PHENOMENON_SQUALL:
+ return "myweather-storm.png";
+ case PHENOMENON_MIST:
+ case PHENOMENON_FOG:
+ case PHENOMENON_SMOKE:
+ case PHENOMENON_VOLCANIC_ASH:
+ case PHENOMENON_SAND:
+ case PHENOMENON_HAZE:
+ case PHENOMENON_SPRAY:
+ case PHENOMENON_DUST:
+ case PHENOMENON_SANDSTORM:
+ case PHENOMENON_DUSTSTORM:
+ case PHENOMENON_FUNNEL_CLOUD:
+ case PHENOMENON_DUST_WHIRLS:
+ return "myweather-fog.png";
+ default:
+ break;
+ }
+
+ switch (sky) {
+ case SKY_CLEAR:
+ return "myweather-sun.png";
+ case SKY_BROKEN:
+ case SKY_SCATTERED:
+ case SKY_FEW:
+ return "myweather-suncloud.png";
+ case SKY_OVERCAST:
+ return "myweather-clouds.png";
+ default:
+ break;
+ }
+
+ return "es-weather.png";
+}