diff --git a/src/gui/weather_locations.h b/src/gui/weather_locations.h deleted file mode 100644 index 5f4c3660e..000000000 --- a/src/gui/weather_locations.h +++ /dev/null @@ -1,320 +0,0 @@ -/* - Copyright (C) 2017, 2018, 2019 TangoCash - - License: GPLv2 - - 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; - - 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, see . -*/ - -#ifndef _WEATHER_LOCATIONS_ -#define _WEATHER_LOCATIONS_ - -struct weather_loc -{ - const char *key; - const std::string value; -}; - -// locations and coords taken from tuxwetter plugin -const weather_loc WEATHER_LOCATION_OPTIONS[] = -{ - { "Aachen", "50.77,6.13" }, - { "Ahaus", "52.07,7.00" }, - { "Ahrensburg", "53.06,10.25" }, - { "Allendorf", "51.28,7.95" }, - { "Alsenz", "49.72,7.82" }, - { "Altenbruch", "53.82,8.77" }, - { "Amberg", "49.44,11.86" }, - { "Ansbach", "49.30,10.58" }, - { "Aschaffenburg", "49.97,9.15" }, - { "Augsburg", "48.37,10.88" }, - { "Aurich", "53.47,7.48" }, - { "Bad Hersfeld", "50.870,9.702" }, - { "Bad Tölz", "47.77,11.57" }, - { "Bamberg", "50.87,9.70" }, - { "Barweiler", "50.35,6.98" }, - { "Bayreuth", "49.95,11.56" }, - { "Bedburg", "50.98,6.57" }, - { "Bergen auf Rügen", "54.42,13.44" }, - { "Bergisch-Gladbach", "49.94,11.57" }, - { "Berlin", "52.52,13.40" }, - { "Bielefeld", "52.03,8.53" }, - { "Bitburg", "49.96,6.52" }, - { "Blexen", "49.96,6.52" }, - { "Bonn", "50.73,7.09" }, - { "Bottrop", "51.52,6.94" }, - { "Brandenburg", "52.41,12.53" }, - { "Braunschweig", "52.26,10.52" }, - { "Bremen", "53.07,8.80" }, - { "Bremerhaven", "53.53,8.58" }, - { "Brüggen", "51.03,6.33" }, - { "Brunsbüttel", "53.89,9.13" }, - { "Bückeburg", "52.25,9.05" }, - { "Büttgen", "51.19,6.60" }, - { "Celle", "52.25,9.05" }, - { "Chemnitz", "50.82,12.92" }, - { "Cloppenburg", "50.82,12.92" }, - { "Coburg", "50.26,10.96" }, - { "Cottbus", "51.75,14.33" }, - { "Cuxhaven", "53.85,8.68" }, - { "Dachau", "48.26,11.43" }, - { "Darmstadt", "49.87,8.65" }, - { "Deggendorf", "48.84,12.95" }, - { "Delmenhorst", "53.05,8.63" }, - { "Dessau", "51.82,12.24" }, - { "Detmold", "51.93,8.86" }, - { "Döbeln", "51.12,13.11" }, - { "Donaueschingen", "47.95,8.49" }, - { "Dortmund", "51.51,7.46" }, - { "Dresden", "51.05,13.73" }, - { "Duhnen", "53.88,8.64" }, - { "Duisburg", "51.43,6.76" }, - { "Düsseldorf", "51.22,6.77" }, - { "Ebersberg", "48.07,11.96" }, - { "Eberswalde", "52.837,13.788" }, - { "Eckernförde", "54.469,9.838" }, - { "Eggenfelden", "48.40,12.75" }, - { "Eichstätt", "48.89,11.18" }, - { "Elmshorn", "53.75,9.66" }, - { "Emden", "53.35,7.20" }, - { "Erding", "48.31,11.91" }, - { "Erfurt", "50.98,11.02" }, - { "Erkrath", "51.22,6.91" }, - { "Erlangen", "49.58,11.01" }, - { "Eschlkam", "49.29,12.91" }, - { "Eschwege", "51.18,10.03" }, - { "Essen", "51.45,7.01" }, - { "Esslingen", "48.74,9.32" }, - { "Euskirchen", "50.65,6.78" }, - { "Eutin", "54.13,10.60" }, - { "Falkensee", "52.56,13.07" }, - { "Feucht", "49.37,11.21" }, - { "Flensburg", "54.79,9.44" }, - { "Frankfurt am Main", "50.11,8.68" }, - { "Frankfurt an der Oder", "52.350,14.550" }, - { "Freiburg", "47.99,7.84" }, - { "Freigericht", "50.142,9.166" }, - { "Freising", "48.40,11.74" }, - { "Freudenstadt", "48.46,8.41" }, - { "Freyung", "48.80,13.54" }, - { "Friedrichshafen", "47.66,9.48" }, - { "Friesoythe", "53.02,7.85" }, - { "Fritzlar", "51.13,9.27" }, - { "Fulda", "50.55,9.68" }, - { "Fürstenfeldbruck", "48.17,11.24" }, - { "Fürth", "49.47,10.98" }, - { "Garmisch-Partenkirchen", "47.49,11.10" }, - { "Geilenkirchen", "50.97,6.12" }, - { "Gelnhausen", "50.20,9.19" }, - { "Gelsenkirchen", "51.52,7.09" }, - { "Gera", "50.89,12.08" }, - { "Geretsried", "47.86,11.49" }, - { "Germersheim", "49.21,8.37" }, - { "Gettorf", "54.41,9.98" }, - { "Gießen", "50.58,8.68" }, - { "Glauchau", "50.82,12.55" }, - { "Göppingen", "48.71,9.65" }, - { "Görlitz", "51.15,14.97" }, - { "Göttingen", "51.54,9.92" }, - { "Grafenau", "48.86,13.39" }, - { "Grafenwöhr", "49.71,11.91" }, - { "Greifswald", "54.09,13.39" }, - { "Grünberg", "50.59,8.96" }, - { "Gütersloh", "51.90,8.39" }, - { "Hagen", "51.37,7.46" }, - { "Hahn", "49.96,7.27" }, - { "Halle (Saale)", "51.497,11.969" }, - { "Halle (Westfalen)", "52.06,8.36" }, - { "Hamburg", "53.55,9.99" }, - { "Hamm", "51.67,7.82" }, - { "Hanau", "50.13,8.93" }, - { "Hannover", "52.38,9.73" }, - { "Harrislee", "54.80,9.39" }, - { "Heidelberg", "49.40,8.67" }, - { "Heilbronn", "49.14,9.21" }, - { "Helgoland", "54.18,7.89" }, - { "Hennigsdorf", "52.63,13.20" }, - { "Herne", "51.54,7.20" }, - { "Hilden", "51.17,6.93" }, - { "Hildesheim", "52.15,9.96" }, - { "Hinte", "53.41,7.20" }, - { "Hochheim", "50.01,8.36" }, - { "Hockenheimring", "49.33,8.57" }, - { "Hof", "50.31,11.91" }, - { "Holzkirchen", "47.88,11.70" }, - { "Hosten", "49.89,6.62" }, - { "Hürth", "50.88,6.89" }, - { "Husby", "54.50,9.48" }, - { "Husum", "54.48,9.06" }, - { "Idar-Oberstein", "49.71,7.31" }, - { "Ingolstadt", "48.77,11.43" }, - { "Iserlohn", "51.38,7.70" }, - { "Itzehoe", "53.93,9.51" }, - { "Jever", "53.57,7.90" }, - { "Jülich", "50.92,6.36" }, - { "Kall", "50.54,6.56" }, - { "Karlsruhe", "49.01,8.40" }, - { "Kassel", "51.31,9.48" }, - { "Kaufbeuren", "47.88,10.63" }, - { "Kempten", "47.73,10.32" }, - { "Kiel", "54.32,10.12" }, - { "Kitzingen", "49.73,10.15" }, - { "Koblenz", "50.36,7.59" }, - { "Köln", "50.94,6.96" }, - { "Konstanz", "47.68,9.17" }, - { "Krefeld", "51.34,6.59" }, - { "Kronshagen", "54.34,10.09" }, - { "Krumbach", "48.25,10.37" }, - { "Laarbruch", "51.60,6.15" }, - { "Lahr", "48.33,7.87" }, - { "Landshut", "48.54,12.15" }, - { "Langenhagen", "52.45,9.74" }, - { "Lausitzring", "51.54,13.89" }, - { "Lechfeld", "48.19,10.86" }, - { "Leck", "54.77,8.98" }, - { "Leer", "53.24,7.47" }, - { "Leipzig", "51.34,12.37" }, - { "Leverkusen", "51.05,7.02" }, - { "Lindenberg", "47.60,9.89" }, - { "List", "55.02,8.43" }, - { "Lübeck", "53.87,10.69" }, - { "Lüchow", "52.97,11.15" }, - { "Luckenwalde", "52.09,13.16" }, - { "Ludwigsburg", "48.89,9.20" }, - { "Ludwigshafen", "49.48,8.45" }, - { "Lüneburg", "53.25,10.41" }, - { "Magdeburg", "52.12,11.63" }, - { "Mainz", "49.99,8.25" }, - { "Mannheim", "49.49,8.47" }, - { "Marburg", "50.80,8.77" }, - { "Marienfelde", "52.42,13.37" }, - { "Marktbreit", "49.67,10.15" }, - { "Meiningen", "50.57,10.42" }, - { "Memmingen", "47.98,10.18" }, - { "Meppen", "52.70,7.30" }, - { "Merzig", "49.45,6.64" }, - { "Minden", "52.30,8.89" }, - { "Mönchengladbach", "51.18,6.44" }, - { "Mühldorf", "48.25,12.52" }, - { "München", "48.14,11.58" }, - { "Münster", "51.96,7.63" }, - { "Murnau", "47.68,11.20" }, - { "Mylau", "50.62,12.26" }, - { "Naumburg (Saale)", "51.15,11.82" }, - { "Neuberg", "48.11,12.12" }, - { "Neubrandenburg", "53.57,13.28" }, - { "Neumarkt", "49.28,11.47" }, - { "Neumünster", "54.07,9.98" }, - { "Neunkirchen", "49.35,7.19" }, - { "Neuruppin", "52.92,12.80" }, - { "Neuss", "51.20,6.69" }, - { "Neuwied", "50.44,7.47" }, - { "Niendorf (Ostsee)", "53.99,10.83" }, - { "Norden", "53.60,7.20" }, - { "Nordenham", "53.50,8.49" }, - { "Norderney", "53.71,7.16" }, - { "Nordhausen", "51.50,10" }, - { "Nordhausen", "51.50,10" }, - { "Nordheide", "53.12,8.46" }, - { "Nordhorn", "52.43,7.07" }, - { "Nördlingen", "48.85,10.49" }, - { "Nürburgring", "50.34,6.95" }, - { "Oberhausen", "51.50,6.86" }, - { "Oberpfaffenhofen", "48.07,11.26" }, - { "Oberstdorf", "47.41,10.28" }, - { "Ochsenfurt", "49.66,10.07" }, - { "Oeversee", "54.70,9.43" }, - { "Offenbach", "50.10,8.78" }, - { "Oldenburg", "53.14,8.21" }, - { "Oldersum", "53.33,7.34" }, - { "Oranienburg", "52.75,13.24" }, - { "Osnabrück", "52.28,8.05" }, - { "Otterndorf", "53.81,8.90" }, - { "Paderborn", "51.72,8.76" }, - { "Passau", "48.57,13" }, - { "Peine", "52.32,10.24" }, - { "Pfaffenhofen", "48.52,11.50" }, - { "Pfarrkirchen", "48.42,12.94" }, - { "Pforzheim", "48.89,8.69" }, - { "Pinneberg", "53.65,9.79" }, - { "Pirmasens", "49.20,7.60" }, - { "Plauen", "50.50,12.14" }, - { "Pocking", "48.40,13.32" }, - { "Potsdam", "52.39,13.06" }, - { "Prenzlau", "53.32,13.86" }, - { "Quickborn", "53.73,9.91" }, - { "Rastede", "53.24,8.20" }, - { "Recklinghausen", "51.61,7.20" }, - { "Regensburg", "49.01,12.10" }, - { "Remscheid", "51.18,7.19" }, - { "Rendsburg", "54.31,9.66" }, - { "Rennerod", "50.61,8.07" }, - { "Rosenheim", "47.86,12.12" }, - { "Rostock", "54.09,12.10" }, - { "Rüsselsheim", "50.00,8.42" }, - { "Saarbrücken", "49.230,7.000" }, - { "Sahlenburg", "53.870,8.630" }, - { "Salzgitter", "52.080,10.330" }, - { "Salzwedel", "52.850,11.150" }, - { "Schiffdorf", "53.530,8.650" }, - { "Schleswig", "54.520,9.550" }, - { "Schrobenhausen", "48.550,11.270" }, - { "Schwabach", "49.330,11.030" }, - { "Schwäbisch Hall", "49.110,9.730" }, - { "Schweinfurt", "50.050,10.230" }, - { "Schwerin", "53.630,11.380" }, - { "Siegburg", "50.800,7.200" }, - { "Siegen", "50.870,8.030" }, - { "Solingen", "51.180,7.080" }, - { "Starnberg", "48.000,11.350" }, - { "Straubing", "48.880,12.570" }, - { "Stuttgart", "48.770,9.180" }, - { "Sulingen", "52.680,8.800" }, - { "Sylt", "54.880,8.350" }, - { "Tönning", "54.320,8.950" }, - { "Traunstein", "47.87,12.62" }, - { "Travemünde", "53.970,10.870" }, - { "Trier", "49.750,6.630" }, - { "Tübingen", "48.530,9.050" }, - { "Ulm", "48.400,10.000" }, - { "Varel", "53.18,9.49" }, - { "Veitsbronn", "49.520,10.880" }, - { "Villingen-Schwenningen", "48.070,8.450" }, - { "Vilsbiburg", "48.450,12.350" }, - { "Vilshofen", "49.23,12.04" }, - { "Waldkirchen/Bayr.-Wald", "48.730,13.600" }, - { "Wallsbüll", "54.580,9.000" }, - { "Warnemünde", "54.170,12.080" }, - { "Weiden", "49.680,12.160" }, - { "Weimar", "50.980,11.320" }, - { "Weißenburg/Bayern", "49.030,10.980" }, - { "Wernigerode", "51.830,10.780" }, - { "Westerland/Sylt", "54.900,8.300" }, - { "Westerstede", "53.250,7.930" }, - { "Wetzlar", "50.550,8.500" }, - { "Wiesbaden", "50.080,8.250" }, - { "Wilhelmshaven", "53.520,8.130" }, - { "Wittenberge", "53.000,11.750" }, - { "Wittingen", "52.730,10.720" }, - { "Wolfsburg", "52.430,10.800" }, - { "Worms", "49.61,8.31" }, - { "Wuppertal", "51.270,7.180" }, - { "Würzburg", "49.790,9.940" }, - { "Zeven", "53.300,9.280" }, - { "Zirndorf", "49.450,10.950" }, - { "Zwickau", "50.720,12.500" } -}; - -#define WEATHER_LOCATION_OPTION_COUNT (sizeof(WEATHER_LOCATION_OPTIONS)/sizeof(weather_loc)) - -#endif diff --git a/src/gui/weather_setup.cpp b/src/gui/weather_setup.cpp index a4957ae66..e5223bf10 100644 --- a/src/gui/weather_setup.cpp +++ b/src/gui/weather_setup.cpp @@ -72,7 +72,6 @@ int CWeatherSetup::showWeatherSetup() CMenuWidget *ms_oservices = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_ONLINESERVICES); ms_oservices->addIntroItems(LOCALE_MISCSETTINGS_ONLINESERVICES); - // weather weather_onoff = new CMenuOptionChooser(LOCALE_WEATHER_ENABLED, &g_settings.weather_enabled, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, CApiKey::check_weather_api_key()); weather_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_WEATHER_ENABLED); ms_oservices->addItem(weather_onoff); @@ -100,7 +99,7 @@ int CWeatherSetup::showSelectWeatherLocation() int select = 0; int res = 0; - if (locations.size() == 0) + if (locations.empty()) { ShowHint("Warning", "Failed to load weather_locations.xml\nPlease press any key or wait some seconds! ...", 700, 10, NULL, NEUTRINO_ICON_HINT_IMAGEINFO, CComponentsHeader::CC_BTN_EXIT); g_settings.weather_location = "52.52,13.40"; @@ -109,7 +108,7 @@ int CWeatherSetup::showSelectWeatherLocation() return menu_return::RETURN_REPAINT; } - if (locations.size() > 1) + if (locations.size() > 0) { CMenuWidget *m = new CMenuWidget(LOCALE_WEATHER_LOCATION, NEUTRINO_ICON_LANGUAGE); CMenuSelectorTarget *selector = new CMenuSelectorTarget(&select); @@ -140,7 +139,7 @@ int CWeatherSetup::showSelectWeatherLocation() return res; } -bool CWeatherSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*/) +bool CWeatherSetup::changeNotify(const neutrino_locale_t OptionName, void */*data*/) { int ret = menu_return::RETURN_NONE; @@ -158,7 +157,7 @@ bool CWeatherSetup::changeNotify(const neutrino_locale_t OptionName, void * /*da void CWeatherSetup::loadLocations() { - xmlDocPtr parser = parseXmlFile(CONFIGDIR"/weather_locations.xml"); + xmlDocPtr parser = parseXmlFile(CONFIGDIR "/weather_locations.xml"); if (parser == NULL) { @@ -166,7 +165,6 @@ void CWeatherSetup::loadLocations() return; } - xmlNodePtr l0 = xmlDocGetRootElement(parser); xmlNodePtr l1 = xmlChildrenNode(l0); @@ -174,7 +172,7 @@ void CWeatherSetup::loadLocations() { while ((xmlGetNextOccurence(l1, "location"))) { - const char *country = xmlGetAttribute(l1, "country"); + //const char *country = xmlGetAttribute(l1, "country"); const char *city = xmlGetAttribute(l1, "city"); const char *latitude = xmlGetAttribute(l1, "latitude"); const char *longitude = xmlGetAttribute(l1, "longitude"); @@ -188,4 +186,3 @@ void CWeatherSetup::loadLocations() xmlFreeDoc(parser); } -