Added configuration dialog to weather plugin.
authorPiotr Sipika <Piotr.Sipika@gmail.com>
Thu, 3 Jan 2013 19:49:29 +0000 (14:49 -0500)
committerPiotr Sipika <Piotr.Sipika@gmail.com>
Thu, 3 Jan 2013 19:49:29 +0000 (14:49 -0500)
Added weather plugin messages to lxpanel.pot and updated ChangeLog.
Added PL translations to weather plugin messages.
Added weather plugin to debian build rules.

12 files changed:
debian/rules
po/ChangeLog
po/POTFILES.in
po/lxpanel.pot
po/pl.po
src/panel.c
src/plugins/weather/Makefile.am
src/plugins/weather/fileutil.c [deleted file]
src/plugins/weather/fileutil.h [deleted file]
src/plugins/weather/weather.c
src/plugins/weather/weatherwidget.c
src/plugins/weather/weatherwidget.h

index c767ab2..5cb0c7d 100755 (executable)
@@ -20,7 +20,7 @@ ifeq ($(DEB_HOST_ARCH_OS),linux)
        dh_auto_configure -- --enable-man --with-plugins=all
 else
        # omit netstat plugin on non-linux, requires wireless-tools
-       dh_auto_configure -- --enable-man --with-plugins=netstatus,volume,volumealsa,cpu,deskno,batt,kbled,xkb,thermal,cpufreq,monitors,wnckpager
+       dh_auto_configure -- --enable-man --with-plugins=netstatus,volume,volumealsa,cpu,deskno,batt,kbled,xkb,thermal,cpufreq,monitors,wnckpager,weather
 endif
 
 override_dh_auto_test:
index c11517e..a4c90a8 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-03 Piotr Sipika <Piotr.Sipika@gmail.com>
+
+       * lxpanel.pot: Added weather plugin-specific messages; updated copyright.
+       * pl.po: Added weather plugin-specific message translations; updated copyright.
+
 2009-07-18 Og Maciel <ogmaciel@gnome.org>
 
        * pt_BR.po: Updated Brazilian Portuguese translation by
index cc6751a..e9351c8 100644 (file)
@@ -52,3 +52,6 @@ src/plugins/indicator/indicator.c
 src/plugins/monitors/monitors.c
 
 src/plugins/wnckpager/wnckpager.c
+
+src/plugins/weather/weatherwidget.c
+src/plugins/weather/weather.c
index 8588293..c383957 100644 (file)
@@ -82,7 +82,7 @@ msgid "LXPanel"
 msgstr ""
 
 #: ../src/panel.c:716
-msgid "Copyright (C) 2008-2011"
+msgid "Copyright (C) 2008-2013"
 msgstr ""
 
 #: ../src/panel.c:717
@@ -1465,3 +1465,355 @@ msgstr ""
 #: ../src/plugins/wnckpager/wnckpager.c:722
 msgid "WNCKpager plugin"
 msgstr ""
+
+#: ../src/plugins/weather/weather.c:280
+msgid "Weather Plugin"
+msgstr ""
+
+#: ../src/plugins/weather/weather.c:282
+msgid "Show weather conditions for a location."
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:50
+msgid "[N/A]"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:744
+msgid "Enter New Location"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:758
+msgid "_New Location:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:769
+msgid "Enter the:\n- city, or\n- city and state/country, or\n- postal code\nfor which to retrieve the weather forecast."
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:806
+msgid "You must specify a location."
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:853
+msgid "Location '%s' not found!"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1002
+msgid "Preferences"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1008
+msgid "Refresh"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1014
+msgid "Quit"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1106
+msgid "Weather Preferences"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1120
+msgid "Current Location"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1124
+msgid "None configured"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1126
+msgid "_Set"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1147
+msgid "Display"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1151
+msgid "Name:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1155
+msgid "Units:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1159
+msgid "_Metric (\302\260C)"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1161
+msgid "_English (\302\260F)"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1196
+msgid "Forecast"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1200
+msgid "Updates:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1204
+msgid "Ma_nual"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1208
+msgid "_Automatic, every"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1224
+msgid "minutes"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1233
+msgid "Source:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1371
+msgid "C_hange"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1415
+msgid "_Set"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1451
+msgid "Location not set."
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1455
+msgid "Forecast for %s unavailable."
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1468
+msgid "Current Conditions for %s"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1491
+msgid "Location:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1514
+msgid "Last updated:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1541
+msgid "Feels like:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1566
+msgid "Humidity:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1593
+msgid "Pressure:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1620
+msgid "Visibility:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1648
+msgid "Wind:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1671
+msgid "Sunrise:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1694
+msgid "Sunset:"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1800
+msgid "Searching for '%s'..."
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1927
+msgid "Location matches for '%s'"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1947
+msgid "City"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1957
+msgid "State"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:1967
+msgid "Country"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2098
+msgid "Currently in "
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2100
+msgid "Today: "
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2101
+msgid "Tomorrow: "
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Tornado"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Tropical Storm"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Hurricane"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Sever Thunderstorms"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Mixed Rain and Snow"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Mixed Rain and Sleet"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Mixed Snow and Sleet"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Freezing Drizzle"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Drizzle"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Freezing Rain"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Showers"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Snow Flurries"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Light Snow Showers"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Blowing Snow"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Snow"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Hail"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Sleet"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Dust"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Foggy"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Haze"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Smoky"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Blustery"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Windy"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Cold"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Cloudy"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Mostly Cloudy"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Partly Cloudy"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Clear"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Sunny"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Fair"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Mixed Rain and Hail"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Hot"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Isolated Thunderstorms"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Scattered Thunderstorms"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Scattered Showers"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Heavy Snow"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Scattered Snow Showers"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Thundershowers"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Snow Showers"
+msgstr ""
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Isolated Thundershowers"
+msgstr ""
index 37789b8..5cbeca0 100644 (file)
--- a/po/pl.po
+++ b/po/pl.po
@@ -4,6 +4,7 @@
 # Grzegorz Gibas <amigib@gmail.com>, 2009.
 # Artur <mazdac@gmail.com>, 2006, 2010.
 # Piotr Sokół <psokol@jabster.pl>, 2010, 2011.
+# Piotr Sipika <Piotr.Sipika@gmail.com>, 2012, 2013.
 #
 msgid ""
 msgstr ""
@@ -91,8 +92,8 @@ msgstr "LXPanel"
 
 # a może "Chronione Prawami Autorskimi (C) 2009-2009"
 #: ../src/panel.c:716
-msgid "Copyright (C) 2008-2011"
-msgstr "Prawa autorskie (C) 2008-2011"
+msgid "Copyright (C) 2008-2013"
+msgstr "Prawa autorskie (C) 2008-2013"
 
 #: ../src/panel.c:717
 msgid "Desktop panel for LXDE project"
@@ -1529,6 +1530,350 @@ msgstr "WNCKPager"
 msgid "WNCKpager plugin"
 msgstr "Wyświetla zawartość obszarów roboczych"
 
+#: ../src/plugins/weather/weather.c:280
+msgid "Weather Plugin"
+msgstr "Wtyczka Pogody"
+
+#: ../src/plugins/weather/weather.c:282
+msgid "Show weather conditions for a location."
+msgstr "Przedstawia warunki pogodowe dla danej lokalizacji."
+
+#: ../src/plugins/weather/weatherwidget.c:50
+msgid "[N/A]"
+msgstr "--"
+
+#: ../src/plugins/weather/weatherwidget.c:744
+msgid "Enter New Location"
+msgstr "Wprowadź Nową Lokalizację"
+
+#: ../src/plugins/weather/weatherwidget.c:758
+msgid "_New Location:"
+msgstr "_Nowa Lokalizacja:"
+
+#: ../src/plugins/weather/weatherwidget.c:769
+msgid "Enter the:\n- city, or\n- city and state/country, or\n- postal code\nfor which to retrieve the weather forecast."
+msgstr "Wprowadź:\n- miasto, lub\n- miasto i województwo/kraj, lub\n- kod pocztowy\ndla którego pobrać prognozę pogody."
+
+#: ../src/plugins/weather/weatherwidget.c:806
+msgid "You must specify a location."
+msgstr "Musisz wprowadzić lokalizacje."
+
+#: ../src/plugins/weather/weatherwidget.c:853
+msgid "Location '%s' not found!"
+msgstr "Nie znaleziono lokalizacji '%s'!"
+
+#: ../src/plugins/weather/weatherwidget.c:1002
+msgid "Preferences"
+msgstr "Preferencje"
+
+#: ../src/plugins/weather/weatherwidget.c:1008
+msgid "Refresh"
+msgstr "Odśwież"
+
+#: ../src/plugins/weather/weatherwidget.c:1014
+msgid "Quit"
+msgstr "Zakończ"
+
+#: ../src/plugins/weather/weatherwidget.c:1106
+msgid "Weather Preferences"
+msgstr "Preferencje Prognozy Pogody"
+
+#: ../src/plugins/weather/weatherwidget.c:1120
+msgid "Current Location"
+msgstr "Bieżąca Lokalizacja"
+
+#: ../src/plugins/weather/weatherwidget.c:1124
+msgid "None configured"
+msgstr "Nie skonfigurowano"
+
+#: ../src/plugins/weather/weatherwidget.c:1147
+msgid "Display"
+msgstr "Wyświetl"
+
+#: ../src/plugins/weather/weatherwidget.c:1151
+msgid "Name:"
+msgstr "Nazwa:"
+
+#: ../src/plugins/weather/weatherwidget.c:1155
+msgid "Units:"
+msgstr "Jednostki:"
+
+#: ../src/plugins/weather/weatherwidget.c:1159
+msgid "_Metric (\302\260C)"
+msgstr "_Metryczne (\302\260C)"
+
+#: ../src/plugins/weather/weatherwidget.c:1161
+msgid "_English (\302\260F)"
+msgstr "Angi_elskie (\302\260F)"
+
+#: ../src/plugins/weather/weatherwidget.c:1196
+msgid "Forecast"
+msgstr "Prognoza"
+
+#: ../src/plugins/weather/weatherwidget.c:1200
+msgid "Updates:"
+msgstr "Aktualizacje"
+
+#: ../src/plugins/weather/weatherwidget.c:1204
+msgid "Ma_nual"
+msgstr "_Ręczne"
+
+#: ../src/plugins/weather/weatherwidget.c:1208
+msgid "_Automatic, every"
+msgstr "_Automatyczne, co"
+
+#: ../src/plugins/weather/weatherwidget.c:1224
+msgid "minutes"
+msgstr "minut"
+
+#: ../src/plugins/weather/weatherwidget.c:1233
+msgid "Source:"
+msgstr "Źródło:"
+
+#: ../src/plugins/weather/weatherwidget.c:1371
+msgid "C_hange"
+msgstr "_Zmień"
+
+#: ../src/plugins/weather/weatherwidget.c:1415
+msgid "_Set"
+msgstr "_Ustaw"
+
+#: ../src/plugins/weather/weatherwidget.c:1451
+msgid "Location not set."
+msgstr "Lokalizacji nie ustawiono."
+
+#: ../src/plugins/weather/weatherwidget.c:1455
+msgid "Forecast for %s unavailable."
+msgstr "Prognoza dla %s nie jest dostępna."
+
+#: ../src/plugins/weather/weatherwidget.c:1468
+msgid "Current Conditions for %s"
+msgstr "Warunki Aktualne dla %s"
+
+#: ../src/plugins/weather/weatherwidget.c:1491
+msgid "Location:"
+msgstr "Lokalizacja:"
+
+#: ../src/plugins/weather/weatherwidget.c:1514
+msgid "Last updated:"
+msgstr "Aktualizowano:"
+
+#: ../src/plugins/weather/weatherwidget.c:1541
+msgid "Feels like:"
+msgstr "Odczuwana temperatura:"
+
+#: ../src/plugins/weather/weatherwidget.c:1566
+msgid "Humidity:"
+msgstr "Wilgotność:"
+
+#: ../src/plugins/weather/weatherwidget.c:1593
+msgid "Pressure:"
+msgstr "Ciśnienie:"
+
+#: ../src/plugins/weather/weatherwidget.c:1620
+msgid "Visibility:"
+msgstr "Widoczność"
+
+#: ../src/plugins/weather/weatherwidget.c:1648
+msgid "Wind:"
+msgstr "Wiatr:"
+
+#: ../src/plugins/weather/weatherwidget.c:1671
+msgid "Sunrise:"
+msgstr "Wschód słońca:"
+
+#: ../src/plugins/weather/weatherwidget.c:1694
+msgid "Sunset:"
+msgstr "Zachód słońca:"
+
+#: ../src/plugins/weather/weatherwidget.c:1800
+msgid "Searching for '%s'..."
+msgstr "Szukam '%s'..."
+
+#: ../src/plugins/weather/weatherwidget.c:1927
+msgid "Location matches for '%s'"
+msgstr "Nazwy lokalizacji podobnych do '%s'"
+
+#: ../src/plugins/weather/weatherwidget.c:1947
+msgid "City"
+msgstr "Miasto"
+
+#: ../src/plugins/weather/weatherwidget.c:1967
+msgid "Country"
+msgstr "Kraj"
+
+#: ../src/plugins/weather/weatherwidget.c:2098
+msgid "Currently in "
+msgstr "Aktualnie w "
+
+#: ../src/plugins/weather/weatherwidget.c:2100
+msgid "Today: "
+msgstr "Dziś: "
+
+#: ../src/plugins/weather/weatherwidget.c:2101
+msgid "Tomorrow: "
+msgstr "Jutro: "
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Tornado"
+msgstr "Tornado"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Tropical Storm"
+msgstr "Burza Tropikalna"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Hurricane"
+msgstr "Huragan"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Severe Thunderstorms"
+msgstr "Mocne Burze"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Mixed Rain and Snow"
+msgstr "Deszcz ze Śniegiem"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Mixed Rain and Sleet"
+msgstr "Deszcz i Gołoledź"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Mixed Snow and Sleet"
+msgstr "Śnieg Gołoledź"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Freezing Drizzle"
+msgstr "Marznąca Mrzawka"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Drizzle"
+msgstr "Mrzawka"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Freezing Rain"
+msgstr "Marznący Deszcz"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Showers"
+msgstr "Opady"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Snow Flurries"
+msgstr "Opady Śniegu"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Light Snow Showers"
+msgstr "Lekkie Opady Śniegu"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Blowing Snow"
+msgstr "Silny Wiatr ze Śniegiem"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Snow"
+msgstr "Śnieg"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Hail"
+msgstr "Grad"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Sleet"
+msgstr "Gołoledź"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Dust"
+msgstr "Kurz"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Foggy"
+msgstr "Mglisto"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Haze"
+msgstr "Mgła"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Smoky"
+msgstr "Mglisto"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Blustery"
+msgstr "Zawierucha"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Windy"
+msgstr "Wietrznie"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Cold"
+msgstr "Zimno"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Cloudy"
+msgstr "Pochmurnie"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Mostly Cloudy"
+msgstr "Duże Zachmurzenie"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Partly Cloudy"
+msgstr "Zachmurzenie Umiarkowane"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Clear"
+msgstr "Pogodnie"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Sunny"
+msgstr "Slonecznie"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Fair"
+msgstr "Umiarkowanie"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Mixed Rain and Hail"
+msgstr "Deszcz z Gradem"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Hot"
+msgstr "Gorąco"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Isolated Thunderstorms"
+msgstr "Lokalne Burze"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Scattered Thunderstorms"
+msgstr "Rozproszone, przelotne Burze"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Scattered Showers"
+msgstr "Rozproszone, przelotne Opady Deszczu"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Heavy Snow"
+msgstr "Silne Opady Śniegu"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Scattered Snow Showers"
+msgstr "Rozproszone, przelotne Opady Śniegu"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Thundershowers"
+msgstr "Deszcz z grzmotami"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Snow Showers"
+msgstr "Opady Śniegu"
+
+#: ../src/plugins/weather/weatherwidget.c:2099
+msgid "Isolated Thundershowers"
+msgstr "Lokalne Opady deszczu z grzmotami"
+
 #~ msgid "<b>Icon</b>"
 #~ msgstr "<b>Ikony</b>"
 
index b17198a..2055801 100644 (file)
@@ -713,7 +713,7 @@ static void panel_popupmenu_about( GtkMenuItem* item, Panel* panel )
                                     gdk_pixbuf_new_from_file(PACKAGE_DATA_DIR "/lxpanel/images/my-computer.png", NULL));
     }
 
-    gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about), _("Copyright (C) 2008-2011"));
+    gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about), _("Copyright (C) 2008-2013"));
     gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about), _( "Desktop panel for LXDE project"));
     gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about), "This program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.");
     gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about), "http://lxde.org/");
index 1618b33..abf329d 100644 (file)
@@ -8,6 +8,7 @@ weather_la_SOURCES= \
  yahooutil.c        \
  location.c         \
  forecast.c         \
+ weatherwidget.c    \
  weather.c
 
 weather_la_CFLAGS= \
diff --git a/src/plugins/weather/fileutil.c b/src/plugins/weather/fileutil.c
deleted file mode 100644 (file)
index b51e288..0000000
+++ /dev/null
@@ -1,420 +0,0 @@
-/**
- * Copyright (c) 2012-2013 Piotr Sipika; see the AUTHORS file for more.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- * 
- * See the COPYRIGHT file for more information.
- */
-
-/* Defines the helper functions for configuration file handling 
-  (reading and writing) */
-
-#include "fileutil.h"
-#include "location.h"
-#include "logutil.h"
-
-#include <gio/gio.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-#include <stdarg.h>
-
-static void     fillLocationList             (GList ** ppList, GKeyFile * pKeyFile);
-static gboolean createConfigurationDirectory (const gchar * pczPath);
-static gboolean fillKeyFile                  (GKeyFile ** ppKeyFile, GList * pList);
-
-/**
- * Reads configuration from the specified path and returns a list of 
- * LocationInfo pointers.
- *
- * @param pczPath Path to configuration file with key=value pairs.
- *
- * @return a list of LocationInfo pointers, or NULL on error
- *
- * @note The caller must free the returned list.
- */
-GList *
-getLocationsFromConfiguration(const gchar * pczPath)
-{
-  LXW_LOG(LXW_DEBUG, "fileUtil::getLocationsFromConfiguration(%s)", pczPath);
-
-  GList *    pList = NULL;
-  GError *   pError = NULL;
-
-  GKeyFile * pKeyFile = g_key_file_new();
-
-  if (g_key_file_load_from_file(pKeyFile, pczPath, G_KEY_FILE_NONE, &pError))
-    {
-      fillLocationList(&pList, pKeyFile);
-    }
-  else
-    {
-      /* An error occurred... */
-      if (pError)
-        {
-          LXW_LOG(LXW_ERROR, "Failed to read configuration at %s: %s",
-                  pczPath, pError->message);
-
-          g_error_free(pError);
-        }
-
-    }
-
-  g_key_file_free(pKeyFile);
-
-  /* Reverse list, if filled */
-  pList = g_list_reverse(pList);
-
-  return pList;
-}
-
-/**
- * Creates and fills 'Location' sections based on passed-in LocationInfo
- * objects.
- *
- * @param pList Pointer to the list with LocationInfo objects.
- * @param pczPath Path to the file where to save the locations.
- */
-void
-saveLocationsToConfiguration(GList * pList, const gchar * pczPath)
-{
-  LXW_LOG(LXW_DEBUG, "fileUtil::saveLocationsToConfiguration(%s)", pczPath);
-
-  GKeyFile * pKeyFile = g_key_file_new();
-
-  /* populate key file object */
-  if (!fillKeyFile(&pKeyFile, pList))
-    {
-      /* No valid entries */
-      return;
-    }
-
-  /* Check if directory exists, create if it doesn't */
-  if (!createConfigurationDirectory(pczPath))
-    {
-      return;
-    }
-
-  GFile * pFile = g_file_new_for_path(pczPath);
-
-  /* Get an output stream and write to it */
-  GError * pError = NULL;
-
-  GFileOutputStream * pOutputStream = g_file_replace(pFile,
-                                                     NULL,
-                                                     TRUE,
-                                                     G_FILE_CREATE_PRIVATE,
-                                                     NULL,
-                                                     &pError);
-
-  if (pOutputStream)
-    {
-      /* Everything is OK */
-      gsize szDataLen = 0;
-
-      gchar * pcData = g_key_file_to_data(pKeyFile, &szDataLen, &pError);
-
-      if (pError)
-        {
-          LXW_LOG(LXW_ERROR, "Failed to convert key file to data: %s", pError->message);
-
-          g_error_free(pError);
-        }
-      else
-        {
-          gsize szBytesWritten = 0;
-
-          if (!g_output_stream_write_all((GOutputStream *)pOutputStream,
-                                         pcData,
-                                         szDataLen,
-                                         &szBytesWritten,
-                                         NULL,
-                                         &pError))
-            {
-              /* Failed */
-              LXW_LOG(LXW_ERROR, "Failed to write to output stream: %s", pError->message);
-
-              g_error_free(pError);
-            }
-
-        }
-
-      g_free(pcData);
-      
-      g_object_unref(pOutputStream);
-    }
-  else
-    {
-      LXW_LOG(LXW_ERROR, "Failed to create %s: %s", pczPath, pError->message);
-
-      g_error_free(pError);
-    }
-
-  g_object_unref(pFile);
-
-  g_key_file_free(pKeyFile);
-}
-
-/**
- * Creates the configuration directory specified at startup.
- *
- * @param pczPath Path to the configuration file to use.
- *
- * @return TRUE on success, FALSE on any error or failure.
- */
-static gboolean
-createConfigurationDirectory(const gchar * pczPath)
-{
-  LXW_LOG(LXW_DEBUG, "fileUtil::createConfigurationDirectory(%s)", pczPath);
-
-
-  gboolean bRetVal = FALSE;
-
-  gchar * pcPathDir = g_path_get_dirname(pczPath);
-
-  struct stat pathStat;
-
-  if (stat(pcPathDir, &pathStat) == -1)
-    {
-      /* Non-existence is not an error */
-      if (errno == ENOENT)
-        {
-          if (mkdir(pcPathDir, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0)
-            {
-              bRetVal = TRUE;
-            }
-          else
-            {
-              /* Check error number, if the directory exists, we're OK */
-              if (errno == EEXIST)
-                {
-                  bRetVal = TRUE;
-                }
-              else
-                {
-                  LXW_LOG(LXW_ERROR, "Failed to retrieve file information on %s: %s",
-                          pcPathDir, strerror(errno));
-                }
-
-            }
-
-        }
-      else
-        {
-          LXW_LOG(LXW_ERROR, "Failed to retrieve file information on %s: %s",
-                  pcPathDir, strerror(errno));
-        }
-
-    }
-  else if (S_ISDIR(pathStat.st_mode))
-    {
-      bRetVal = TRUE;
-    }
-
-  g_free(pcPathDir);
-
-  return bRetVal;
-}
-
-/**
- * Goes through all 'Location' sections and creates LocationInfo objects
- * based on key=value pairs
- *
- * @param ppList Pointer to the LocationInfo list pointer.
- * @param pKeyFile Pointer to the configuration file.
- */
-static void
-fillLocationList(GList ** ppList, GKeyFile * pKeyFile)
-{
-  LXW_LOG(LXW_DEBUG, "fileUtil::fillLocationList()");
-
-  gsize szGroupCount = 0;
-
-  gchar ** pGroupNameList = g_key_file_get_groups(pKeyFile, &szGroupCount);
-
-  gsize szGroupIndex = 0;
-
-  for (; szGroupIndex < szGroupCount; ++szGroupIndex)
-    {
-      /* See if this group is 'Location N' */
-      
-      gchar ** pGroupNameTokens = g_strsplit(pGroupNameList[szGroupIndex], " ", 2);
-                                             
-      if (g_ascii_strncasecmp(pGroupNameTokens[0],
-                              LOCATIONINFO_GROUP_NAME,
-                              LOCATIONINFO_GROUP_NAME_LENGTH))
-        {
-          /* A match would produce a FALSE return value, 
-           * so this group is not 'Location N' */
-          LXW_LOG(LXW_ERROR, "Group: '%s' not handled", pGroupNameList[szGroupIndex]);
-        }
-      else
-        {          
-          gchar * pcWOEID = g_key_file_get_string(pKeyFile,
-                                                  pGroupNameList[szGroupIndex],
-                                                  LocationInfoFieldNames[WOEID],
-                                                  NULL);
-              
-          gchar * pcAlias = g_key_file_get_string(pKeyFile,
-                                                  pGroupNameList[szGroupIndex],
-                                                  LocationInfoFieldNames[ALIAS],
-                                                  NULL);
-
-          LXW_LOG(LXW_DEBUG, "Group name: %s, Alias: %s, WOEID: %s",
-                  pGroupNameList[szGroupIndex], pcAlias, pcWOEID);
-
-          /* We MUST have WOEID and Alias */
-          if (!pcWOEID || !strlen(pcWOEID) || !pcAlias || !strlen(pcAlias))
-            {
-              /* just in case they're emtpy strings */
-              g_free(pcWOEID);
-              g_free(pcAlias);
-
-              continue;
-            }
-
-          gchar * pcCity = g_key_file_get_string(pKeyFile,
-                                                 pGroupNameList[szGroupIndex],
-                                                 LocationInfoFieldNames[CITY],
-                                                 NULL);
-
-          gchar * pcState = g_key_file_get_string(pKeyFile,
-                                                  pGroupNameList[szGroupIndex],
-                                                  LocationInfoFieldNames[STATE],
-                                                  NULL);
-
-          gchar * pcCountry = g_key_file_get_string(pKeyFile,
-                                                    pGroupNameList[szGroupIndex],
-                                                    LocationInfoFieldNames[COUNTRY],
-                                                    NULL);
-
-          gchar * pcUnits = g_key_file_get_string(pKeyFile,
-                                                  pGroupNameList[szGroupIndex],
-                                                  LocationInfoFieldNames[UNITS],
-                                                  NULL);
-
-          gint iInterval = g_key_file_get_integer(pKeyFile,
-                                                  pGroupNameList[szGroupIndex],
-                                                  LocationInfoFieldNames[INTERVAL],
-                                                  NULL);
-
-          gboolean bEnabled = g_key_file_get_boolean(pKeyFile,
-                                                     pGroupNameList[szGroupIndex],
-                                                     LocationInfoFieldNames[ENABLED],
-                                                     NULL);
-
-          LocationInfo * pLocation = g_try_new0(LocationInfo, 1);
-
-          if (pLocation)
-            {
-              pLocation->pcAlias_ = g_strndup(pcAlias, strlen(pcAlias));
-              pLocation->pcCity_ = (pcCity)?g_strndup(pcCity, strlen(pcCity)):NULL;
-              pLocation->pcState_ = (pcState)?g_strndup(pcState, strlen(pcState)):NULL;
-              pLocation->pcCountry_ = (pcCountry)?g_strndup(pcCountry, strlen(pcCountry)):NULL;
-              pLocation->pcWOEID_ = g_strndup(pcWOEID, strlen(pcWOEID));
-              pLocation->cUnits_ = pcUnits ? pcUnits[0] : 'f';
-              pLocation->uiInterval_ = (iInterval > 0) ? iInterval : 1;
-              pLocation->bEnabled_ = bEnabled;
-
-              *ppList = g_list_prepend(*ppList, pLocation);
-            }
-
-          g_free(pcAlias);
-          g_free(pcCity);
-          g_free(pcState);
-          g_free(pcCountry);
-          g_free(pcWOEID);
-          g_free(pcUnits);
-        }
-
-      /* Free the token list */
-      g_strfreev(pGroupNameTokens);
-    }
-
-  g_strfreev(pGroupNameList);
-}
-
-/**
- * Fills the supplied key file with data from the list.
- *
- * @param ppKeyFile Pointer to the key file to fill in
- * @param pList     Pointer to the list to use data from
- *
- * @return TRUE if there was at least one location to save, FALSE otherwise.
- */
-static gboolean
-fillKeyFile(GKeyFile ** ppKeyFile, GList * pList)
-{
-  LXW_LOG(LXW_DEBUG, "fileUtil::fillKeyFile()");
-
-  gboolean bRetVal = FALSE;
-
-  gint iSize = g_list_length(pList);
-
-  int i = 0;
-
-  for (; i < iSize; ++i)
-    {
-      LocationInfo * pLocation = (LocationInfo *)g_list_nth_data(pList, i);
-
-      if (pLocation)
-        {
-          gchar * pcGroupName = g_strdup_printf("Location %d", i + 1);
-
-          g_key_file_set_string(*ppKeyFile, pcGroupName, 
-                                LocationInfoFieldNames[ALIAS], pLocation->pcAlias_);
-          
-          if (pLocation->pcCity_)
-            {
-              g_key_file_set_string(*ppKeyFile, pcGroupName, 
-                                    LocationInfoFieldNames[CITY], pLocation->pcCity_);
-            }
-
-          if (pLocation->pcState_)
-            {
-              g_key_file_set_string(*ppKeyFile, pcGroupName, 
-                                    LocationInfoFieldNames[STATE], pLocation->pcState_);
-            }
-
-          if (pLocation->pcCountry_)
-            {
-              g_key_file_set_string(*ppKeyFile, pcGroupName, 
-                                    LocationInfoFieldNames[COUNTRY], pLocation->pcCountry_);
-            }
-
-          g_key_file_set_string(*ppKeyFile, pcGroupName, 
-                                LocationInfoFieldNames[WOEID], pLocation->pcWOEID_);
-          g_key_file_set_string(*ppKeyFile, pcGroupName, 
-                                LocationInfoFieldNames[UNITS], &pLocation->cUnits_);
-          g_key_file_set_integer(*ppKeyFile, pcGroupName, 
-                                 LocationInfoFieldNames[INTERVAL], (gint)pLocation->uiInterval_);
-          g_key_file_set_boolean(*ppKeyFile, pcGroupName, 
-                                 LocationInfoFieldNames[ENABLED], pLocation->bEnabled_);
-
-          g_free(pcGroupName);
-
-          bRetVal = TRUE;
-        }
-
-    }
-
-  return bRetVal;
-}
diff --git a/src/plugins/weather/fileutil.h b/src/plugins/weather/fileutil.h
deleted file mode 100644 (file)
index a025e2f..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Copyright (c) 2012-2013 Piotr Sipika; see the AUTHORS file for more.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- * 
- * See the COPYRIGHT file for more information.
- */
-
-/* Defines the helpers for configuration file handling */
-
-#ifndef LXWEATHER_FILEUTIL_HEADER
-#define LXWEATHER_FILEUTIL_HEADER
-
-#include <glib.h>
-
-/**
- * Reads configuration from the specified path and returns a list of 
- * LocationInfo pointers.
- *
- * @param pczPath Path to configuration file with key=value pairs.
- *
- * @return a list of LocationInfo pointers, or NULL on error
- *
- * @note The caller must free the returned list.
- */
-GList *
-getLocationsFromConfiguration(const gchar * pczPath);
-
-/**
- * Creates and fills 'Location' sections based on passed-in LocationInfo
- * objects.
- *
- * @param pList Pointer to the list with LocationInfo objects.
- * @param pczPath Path to the file where to save the locations.
- */
-void
-saveLocationsToConfiguration(GList * pList, const gchar * pczPath);
-
-
-#endif
index f7462d6..36cea54 100644 (file)
@@ -30,6 +30,9 @@
 #include <gtk/gtk.h>
 #include <stdlib.h>
 
+/* External button-press handler from plugin.c */
+extern gboolean plugin_button_press_event(GtkWidget *widget, GdkEventButton *event, Plugin *plugin);
+
 /* Need to maintain count for bookkeeping */
 static gint g_iCount = 0;
 
@@ -68,18 +71,20 @@ weather_constructor(Plugin * pPlugin, char ** pFP)
 
   LXW_LOG(LXW_DEBUG, "weather_constructor()");
   
-  GtkWidget * pWidg = gtk_weather_new();
+  GtkWidget * pWidg = gtk_weather_new(FALSE);
 
   pPriv->pWeather_ = pWidg;
 
   GtkWidget * pEventBox = gtk_event_box_new();
 
-  /* need to pass those through... */
-  gtk_widget_add_events(pEventBox, 
-                        GDK_BUTTON_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
+  /* Connect signals. */
+  g_signal_connect(pEventBox, 
+                   "button-press-event", 
+                   G_CALLBACK(plugin_button_press_event),
+                   pPlugin);
 
   gtk_container_add(GTK_CONTAINER(pEventBox), pWidg);
+
   pPlugin->priv = pPriv;
   pPlugin->pwid = pEventBox;
 
index 4c169f0..a4dcb8d 100644 (file)
@@ -99,6 +99,9 @@ struct _ForecastThreadData
 
 struct _GtkWeatherPrivate
 {
+  /* Whether or not this widget is being used by itself */
+  gboolean standalone;
+
   /* Main Widget Box layout */
   GtkWidget * hbox;
   GtkWidget * image;
@@ -223,12 +226,22 @@ gtk_weather_get_type(void)
 /**
  * Returns a new instance of this widget.
  *
+ * @param standalone Whether or not this widget is being created from an 
+ *                   application/plugin (FALSE) or if this widget IS the
+ *                   application (TRUE). 
+ *
  * @return A new instance of this widget type.
  */
 GtkWidget *
-gtk_weather_new()
+gtk_weather_new(gboolean standalone)
 {
-  return GTK_WIDGET(g_object_new(gtk_weather_get_type(), NULL));
+  GObject * object = g_object_new(gtk_weather_get_type(), NULL);
+
+  GtkWeatherPrivate * priv = GTK_WEATHER_GET_PRIVATE(GTK_WEATHER(object));
+
+  priv->standalone = standalone;
+
+  return GTK_WIDGET(object);
 }
 
 /**
@@ -456,14 +469,22 @@ gtk_weather_render(GtkWeather * weather)
       /*LocationInfo * location = (LocationInfo *)priv->location;*/
       ForecastInfo * forecast = (ForecastInfo *)priv->forecast;
 
-      GtkRequisition req;
+      gint height = GTK_WIDGET(weather)->allocation.height;
 
-      gtk_widget_size_request(GTK_WIDGET(weather), &req);
+      /* Initially, the height is 1, after that, it's all good */
+      if (height == 1)
+        {
+          GtkRequisition req;
+
+          gtk_widget_size_request(GTK_WIDGET(weather), &req);
+
+          height = req.height;
+        }
 
       /* set this image to the one in the forecast at correct scale */
       GdkPixbuf * forecast_pixbuf = gdk_pixbuf_scale_simple(forecast->pImage_,
-                                                            req.height,
-                                                            req.height,
+                                                            height,
+                                                            height-1, /* border... */
                                                             GDK_INTERP_BILINEAR);
 
       gtk_image_set_from_pixbuf(GTK_IMAGE(priv->image), forecast_pixbuf);
@@ -681,10 +702,21 @@ gtk_weather_button_pressed(GtkWidget * widget, GdkEventButton * event)
   LXW_LOG(LXW_DEBUG, "GtkWeather::button_pressed(): Button: %d, type: %d", 
           event->button, event->type);
 
+  GtkWeatherPrivate * priv = GTK_WEATHER_GET_PRIVATE(GTK_WEATHER(widget));
+
   /* If right-clicked, show popup */
   if (event->button == 3 && (event->type == GDK_BUTTON_PRESS))
     {
-      gtk_weather_run_popup_menu(widget, TRUE);
+      if (priv->standalone)
+        {
+          gtk_weather_run_popup_menu(widget);
+
+          return TRUE;
+        }
+      else
+        {
+          return FALSE;
+        }
     }
   else if (event->button == 1 && (event->type == GDK_BUTTON_PRESS))
     {
@@ -789,7 +821,7 @@ gtk_weather_change_location(GtkWidget * widget, GdkEventButton * event)
 
   gtk_widget_show_all(dialog);
 
-  gint response = GTK_RESPONSE_REJECT;
+  gint response = GTK_RESPONSE_NONE;
 
   do 
     {
@@ -972,17 +1004,26 @@ gtk_weather_run_error_dialog(GtkWindow * parent, gchar * error_msg)
 {
   LXW_LOG(LXW_DEBUG, "GtkWeather::run_error_dialog(%s)", error_msg);
 
-  GtkWidget * error_dialog = gtk_message_dialog_new(parent,
-                                                    GTK_DIALOG_MODAL,
-                                                    GTK_MESSAGE_ERROR,
-                                                    GTK_BUTTONS_OK,
-                                                    error_msg);
+  static gboolean shown = FALSE;
+
+  if (!shown)
+    {
+      GtkWidget * error_dialog = gtk_message_dialog_new(parent,
+                                                        GTK_DIALOG_MODAL,
+                                                        GTK_MESSAGE_ERROR,
+                                                        GTK_BUTTONS_OK,
+                                                        error_msg);
+      
+      gtk_weather_set_window_icon(GTK_WINDOW(error_dialog), "gtk-dialog-error");
+      
+      shown = TRUE;
 
-  gtk_weather_set_window_icon(GTK_WINDOW(error_dialog), "gtk-dialog-error");
+      gtk_dialog_run(GTK_DIALOG(error_dialog));
 
-  gtk_dialog_run(GTK_DIALOG(error_dialog));
+      gtk_widget_destroy(error_dialog);
 
-  gtk_widget_destroy(error_dialog);
+      shown = FALSE;
+    }
 }
 
 /**
@@ -1052,17 +1093,15 @@ gtk_weather_create_popup_menu(GtkWeather * weather)
  * Shows the popup menu used for configuration.
  *
  * @param widget Pointer to the current instance of the weather widget.
- * @param standalone Whether or not this menu is being ran from an 
- *                   application (FALSE) or directly from this widget (TRUE).
  */
 void
-gtk_weather_run_popup_menu(GtkWidget * widget, gboolean standalone)
+gtk_weather_run_popup_menu(GtkWidget * widget)
 {
-  LXW_LOG(LXW_DEBUG, "GtkWeather::popup_menu(%d)", standalone);
-
   GtkWeatherPrivate * priv = GTK_WEATHER_GET_PRIVATE(GTK_WEATHER(widget));
 
-  if (!standalone)
+  LXW_LOG(LXW_DEBUG, "GtkWeather::popup_menu(%d)", priv->standalone);
+
+  if (priv->standalone)
     {
       gtk_widget_show(GTK_WIDGET(priv->menu_data.quit_item));
     }
@@ -1098,12 +1137,19 @@ gtk_weather_run_preferences_dialog(GtkWidget * widget)
 {
   GtkWeather * weather = GTK_WEATHER(widget);
 
+  static gboolean shown = FALSE;
+
   /* @NOTE: watch for parent window when dealing with the plugin */
   LXW_LOG(LXW_DEBUG, "GtkWeather::create_preferences_dialog()");
 
   GtkWeatherPrivate * priv = GTK_WEATHER_GET_PRIVATE(weather);
 
-  priv->preferences_data.dialog = gtk_dialog_new_with_buttons(_("LXWeather Preferences"),
+  if (shown)
+    {
+      return;
+    }
+
+  priv->preferences_data.dialog = gtk_dialog_new_with_buttons(_("Weather Preferences"),
                                                               NULL,
                                                               GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
                                                               GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
@@ -1156,9 +1202,9 @@ gtk_weather_run_preferences_dialog(GtkWidget * widget)
 
   GtkWidget * button_hbox = gtk_hbox_new(TRUE, 10);
 
-  priv->preferences_data.c_button = gtk_radio_button_new_with_mnemonic(NULL, _("_Metric (°C)"));
+  priv->preferences_data.c_button = gtk_radio_button_new_with_mnemonic(NULL, _("_Metric (\302\260C)"));
 
-  priv->preferences_data.f_button = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(priv->preferences_data.c_button), _("_English (°F)"));
+  priv->preferences_data.f_button = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(priv->preferences_data.c_button), _("_English (\302\260F)"));
 
   gtk_box_pack_end(GTK_BOX(button_hbox), priv->preferences_data.c_button, FALSE, FALSE, 1);
   gtk_box_pack_end(GTK_BOX(button_hbox), priv->preferences_data.f_button, FALSE, FALSE, 1);
@@ -1279,6 +1325,8 @@ gtk_weather_run_preferences_dialog(GtkWidget * widget)
   /* Dialog is shown inside */
   gtk_weather_update_preferences_dialog(weather);
 
+  shown = TRUE;
+
   gint response = gtk_dialog_run(GTK_DIALOG(priv->preferences_data.dialog));
 
   switch(response)
@@ -1333,6 +1381,7 @@ gtk_weather_run_preferences_dialog(GtkWidget * widget)
 
   priv->preferences_data.dialog = NULL;
   
+  shown = FALSE;
 }
 
 /**
@@ -1442,7 +1491,9 @@ gtk_weather_run_conditions_dialog(GtkWidget * widget)
 {
   GtkWeather * weather = GTK_WEATHER(widget);
 
-  LXW_LOG(LXW_DEBUG, "GtkWeather::run_conditions_preferences_dialog()");
+  static gboolean shown = FALSE;
+
+  LXW_LOG(LXW_DEBUG, "GtkWeather::run_conditions_dialog()");
 
   GtkWeatherPrivate * priv = GTK_WEATHER_GET_PRIVATE(weather);
 
@@ -1461,6 +1512,11 @@ gtk_weather_run_conditions_dialog(GtkWidget * widget)
     }
   else
     {
+      if (shown)
+        {
+          return;
+        }
+
       /* Both are available */
       LocationInfo * location = (LocationInfo *)priv->location;
       ForecastInfo * forecast = (ForecastInfo *)priv->forecast;
@@ -1471,6 +1527,7 @@ gtk_weather_run_conditions_dialog(GtkWidget * widget)
       GtkWidget * dialog = gtk_dialog_new_with_buttons(dialog_title,
                                                        NULL,
                                                        GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                                       GTK_STOCK_REFRESH, GTK_RESPONSE_APPLY,
                                                        GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
                                                        NULL);
 
@@ -1755,6 +1812,8 @@ gtk_weather_run_conditions_dialog(GtkWidget * widget)
 
       gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
 
+      shown = TRUE;
+
       gtk_widget_show_all(dialog);
 
       /* Get dimensions to create proper icon... */
@@ -1773,7 +1832,18 @@ gtk_weather_run_conditions_dialog(GtkWidget * widget)
 
       g_object_unref(icon_buf);
 
-      gtk_dialog_run(GTK_DIALOG(dialog));
+      gint response = GTK_RESPONSE_NONE;
+
+      do
+        {
+          response = gtk_dialog_run(GTK_DIALOG(dialog));
+
+          if (response == GTK_RESPONSE_APPLY)
+            {
+              gtk_weather_get_forecast(widget);
+            }
+
+        }  while (response != GTK_RESPONSE_ACCEPT);
 
       if (GTK_IS_WIDGET(dialog))
         {
@@ -1781,6 +1851,8 @@ gtk_weather_run_conditions_dialog(GtkWidget * widget)
         }
 
       dialog = NULL;
+
+      shown = FALSE;
     }
   
 }
index 5314ab4..b6c66dd 100644 (file)
@@ -55,9 +55,9 @@ struct _GtkWeatherClass
 };
 
 GType       gtk_weather_get_type(void) G_GNUC_CONST;
-GtkWidget * gtk_weather_new(void);
+GtkWidget * gtk_weather_new(gboolean);
 void        gtk_weather_run_preferences_dialog(GtkWidget * widget);
-void        gtk_weather_run_popup_menu(GtkWidget * widget, gboolean standalone);
+void        gtk_weather_run_popup_menu(GtkWidget * widget);
 void        gtk_weather_run_conditions_dialog(GtkWidget * widget);
 gchar *     gtk_weather_get_tooltip_text(GtkWidget * widget);