From: <ar...@us...> - 2011-01-16 21:31:45
|
Revision: 30784 http://xbmc4xbox.svn.sourceforge.net/xbmc4xbox/?rev=30784&view=rev Author: arnova Date: 2011-01-16 21:31:39 +0000 (Sun, 16 Jan 2011) Log Message: ----------- fixed: Only call the Weather plugin when network is available + cosmetics Modified Paths: -------------- trunk/xbmc/GUIWindowWeather.cpp Modified: trunk/xbmc/GUIWindowWeather.cpp =================================================================== --- trunk/xbmc/GUIWindowWeather.cpp 2011-01-16 19:59:16 UTC (rev 30783) +++ trunk/xbmc/GUIWindowWeather.cpp 2011-01-16 21:31:39 UTC (rev 30784) @@ -28,6 +28,7 @@ #include "Util.h" #include "lib/libPython/XBPython.h" #include "GUIDialogOK.h" +#include "xbox/network.h" #define CONTROL_BTNREFRESH 2 #define CONTROL_SELECTLOCATION 3 @@ -205,10 +206,9 @@ void CGUIWindowWeather::UpdateButtons() { - CONTROL_ENABLE(CONTROL_BTNREFRESH); + CONTROL_ENABLE(CONTROL_BTNREFRESH); SET_CONTROL_LABEL(CONTROL_BTNREFRESH, 184); //Refresh - } void CGUIWindowWeather::FrameMove() @@ -245,7 +245,10 @@ SetProperty("Weather.IsFetched", "false"); if (g_guiSettings.GetString("weather.plugin").IsEmpty()) return; - + + // No point in trying to fetch weather if we don't have a working network + if (!g_network.IsAvailable()) return; + // create the full path to the plugin CStdString plugin = "special://home/plugins/weather/" + g_guiSettings.GetString("weather.plugin") + "/default.py"; @@ -271,7 +274,6 @@ argv[1] = (char*)strSetting.c_str(); argv[2] = (char*)(forceRefresh ? "1" : "0"); - // call our plugin, passing the areacode g_pythonParser.evalFile(argv[0], argc, (const char**)argv); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |