Index: scripts/.modules/script.module.weather/lib/xbmcweather/search.py =================================================================== --- scripts/.modules/script.module.weather/lib/xbmcweather/search.py (revision 30788) +++ scripts/.modules/script.module.weather/lib/xbmcweather/search.py (working copy) @@ -83,7 +83,7 @@ if ( self.index == "_geo" ): return town # open settings for non ip based geo location search - self.Addon.openSettings() + ##self.Addon.openSettings() def _get_search_text( self, default="", heading="", hidden=False ): """ shows a keyboard and returns a value """ Index: scripts/.modules/script.module.weather/lib/xbmcweather/weather.py =================================================================== --- scripts/.modules/script.module.weather/lib/xbmcweather/weather.py (revision 30788) +++ scripts/.modules/script.module.weather/lib/xbmcweather/weather.py (working copy) @@ -186,7 +186,9 @@ self.WINDOW.setProperty( "Day%s.Date" % ( day[ 0 ], ), self.localize_unit( day[ 2 ], "monthdate", long=True ) )# Days date (eg. October 1) self.WINDOW.setProperty( "Day%s.DateShort" % ( day[ 0 ], ), self.localize_unit( day[ 2 ], "monthdate" ) )# Days abbreviated date (eg. Oct 1) self.WINDOW.setProperty( "Day%s.LowTemperature" % ( day[ 0 ], ), self.localize_unit( day[ 4 ] ) )# Days low temperature (eg. 50) + self.WINDOW.setProperty( "Day%s.LowTemp" % ( day[ 0 ], ), self.localize_unit( day[ 4 ] ) )# Days low temperature (eg. 50) self.WINDOW.setProperty( "Day%s.HighTemperature" % ( day[ 0 ], ), self.localize_unit( day[ 3 ] ) )# Days high temperature (eg. 70) + self.WINDOW.setProperty( "Day%s.HighTemp" % ( day[ 0 ], ), self.localize_unit( day[ 3 ] ) )# Days high temperature (eg. 70) self.WINDOW.setProperty( "Day%s.Sunrise" % ( day[ 0 ], ), self.localize_unit( day[ 5 ], "time" ) )# Days sunrise (eg. 7:39 AM) self.WINDOW.setProperty( "Day%s.Sunset" % ( day[ 0 ], ), self.localize_unit( day[ 6 ], "time" ) )# Days sunset (eg. 7:02 PM) # daytime forecast Index: skin/Confluence/720p/DialogPluginSettings.xml =================================================================== --- skin/Confluence/720p/DialogPluginSettings.xml (revision 30788) +++ skin/Confluence/720p/DialogPluginSettings.xml (working copy) @@ -1,5 +1,5 @@ - 2 + 9 1 160 @@ -50,7 +50,7 @@ header label 300 - 30 + 20 640 30 font16caps @@ -241,5 +241,3 @@ - - Index: xbmc/GUIDialogPluginSettings.cpp =================================================================== --- xbmc/GUIDialogPluginSettings.cpp (revision 30788) +++ xbmc/GUIDialogPluginSettings.cpp (working copy) @@ -70,10 +70,14 @@ CGUIDialogPluginSettings::CGUIDialogPluginSettings() : CGUIDialogBoxBase(WINDOW_DIALOG_PLUGIN_SETTINGS, "DialogPluginSettings.xml") -{} +{ + m_currentSection = 0; + m_totalSections = 1; +} CGUIDialogPluginSettings::~CGUIDialogPluginSettings(void) -{} +{ +} bool CGUIDialogPluginSettings::OnMessage(CGUIMessage& message) { @@ -168,7 +172,11 @@ } return pDialog->m_bConfirmed; } - return false; + else + { // addon does not support settings, inform user + CGUIDialogOK::ShowAndGetInput(24000,0,24030,0); + return false; + } } // \brief Show CGUIDialogOK dialog, then wait for user to dismiss it. @@ -236,7 +244,11 @@ } return pDialog->m_bConfirmed; } - return false; + else + { // addon does not support settings, inform user + CGUIDialogOK::ShowAndGetInput(24000,0,24030,0); + return false; + } } bool CGUIDialogPluginSettings::ShowVirtualKeyboard(int iControl) @@ -356,8 +368,12 @@ if (!source || strcmpi(source, "local") != 0) g_mediaManager.GetNetworkLocations(networkShares); localShares.insert(localShares.end(), networkShares.begin(), networkShares.end()); - shares = &localShares; } + else // always append local drives + { + localShares = *shares; + g_mediaManager.GetLocalDrives(localShares); + } if (strcmpi(type, "folder") == 0) { @@ -366,12 +382,12 @@ if (option) bWriteOnly = (strcmpi(option, "writeable") == 0); - if (CGUIDialogFileBrowser::ShowAndGetDirectory(*shares, label, value, bWriteOnly)) + if (CGUIDialogFileBrowser::ShowAndGetDirectory(localShares, label, value, bWriteOnly)) ((CGUIButtonControl*) control)->SetLabel2(value); } else if (strcmpi(type, "image") == 0) { - if (CGUIDialogFileBrowser::ShowAndGetImage(*shares, label, value)) + if (CGUIDialogFileBrowser::ShowAndGetImage(localShares, label, value)) ((CGUIButtonControl*) control)->SetLabel2(value); } else @@ -416,7 +432,7 @@ bUseFileDirectories = find(options.begin(), options.end(), "treatasfolder") != options.end(); } - if (CGUIDialogFileBrowser::ShowAndGetFile(*shares, strMask, label, value)) + if (CGUIDialogFileBrowser::ShowAndGetFile(localShares, strMask, label, value)) ((CGUIButtonControl*) control)->SetLabel2(value); } } @@ -623,6 +639,9 @@ CStdString entries; if (setting->Attribute("entries")) entries = setting->Attribute("entries"); + CStdString defaultValue; + if (setting->Attribute("default")) + defaultValue = setting->Attribute("default"); const char *subsetting = setting->Attribute("subsetting"); CStdString label = GetString(setting->Attribute("label"), subsetting && 0 == strcmpi(subsetting, "true")); @@ -665,7 +684,7 @@ ((CGUIButtonControl *)pControl)->SetLabel2(value); } else if (setting->Attribute("default")) - ((CGUIButtonControl *)pControl)->SetLabel2(GetString(setting->Attribute("default"))); + ((CGUIButtonControl *)pControl)->SetLabel2(defaultValue); } else if (strcmpi(type, "bool") == 0) { Index: xbmc/GUIWindowWeather.cpp =================================================================== --- xbmc/GUIWindowWeather.cpp (revision 30788) +++ xbmc/GUIWindowWeather.cpp (working copy) @@ -244,4 +244,5 @@ CLog::Log(LOGDEBUG, "%s - Weather plugin called: %s (%s)", __FUNCTION__, argv[0], argv[1]); forceRefresh = false; + delete [] argv; } Index: xbmc/Util.cpp =================================================================== --- xbmc/Util.cpp (revision 30788) +++ xbmc/Util.cpp (working copy) @@ -3733,10 +3733,7 @@ unsigned int argc = params.size(); char ** argv = new char*[argc]; - vector path; - //split the path up to find the filename - StringUtils::SplitString(params[0],"\\",path); - argv[0] = path.size() > 0 ? (char*)path[path.size() - 1].c_str() : (char*)params[0].c_str(); + argv[0] = (char*)params[0].c_str(); for(unsigned int i = 1; i < argc; i++) argv[i] = (char*)params[i].c_str(); Index: xbmc/utils/Weather.cpp =================================================================== --- xbmc/utils/Weather.cpp (revision 30788) +++ xbmc/utils/Weather.cpp (working copy) @@ -41,24 +41,21 @@ { } -CStdString CWeather::TranslateInfo(int info) const +const char *CWeather::TranslateInfo(int info) { - CGUIWindow *window = g_windowManager.GetWindow(WINDOW_WEATHER); - if (window) - { - if (info == WEATHER_LABEL_CURRENT_COND) - return window->GetProperty("Current.Condition"); - else if (info == WEATHER_IMAGE_CURRENT_ICON) - return window->GetProperty("Current.ConditionIcon"); - else if (info == WEATHER_LABEL_CURRENT_TEMP) - return window->GetProperty("Current.Temperature"); - else if (info == WEATHER_LABEL_LOCATION) - return window->GetProperty("Location"); - else if (info == WEATHER_ISFETCHED) - return window->GetProperty("Weather.IsFetched"); - else if (info == WEATHER_LABEL_FANART_CODE) - return window->GetProperty("Current.FanartCode"); - } + SetInfo(); + if (info == WEATHER_LABEL_CURRENT_COND) + return m_CurrentCondition; + else if (info == WEATHER_IMAGE_CURRENT_ICON) + return m_CurrentConditionIcon; + else if (info == WEATHER_LABEL_CURRENT_TEMP) + return m_CurrentTemperature; + else if (info == WEATHER_LABEL_LOCATION) + return m_CurrentLocation; + else if (info == WEATHER_LABEL_FANART_CODE) + return m_CurrentFanartCode; + else if (info == WEATHER_ISFETCHED) + return m_IsFetched; return ""; } @@ -97,6 +94,13 @@ void CWeather::Reset() { + strcpy(m_CurrentCondition, ""); + strcpy(m_CurrentConditionIcon, ""); + strcpy(m_CurrentTemperature, ""); + strcpy(m_CurrentLocation, ""); + strcpy(m_CurrentFanartCode, ""); + strcpy(m_IsFetched, "false"); + for (int i = 0; i < MAX_LOCATION; i++) { m_szLocation[i] = ""; @@ -107,6 +111,31 @@ bool CWeather::IsFetched() { // call GetInfo() to make sure that we actually start up - GetInfo(0); - return TranslateInfo(WEATHER_ISFETCHED).Equals("true"); + return (strcmp(GetInfo(WEATHER_ISFETCHED), "true") == 0); } + +void CWeather::SetInfo() +{ + /* + if (strcmp(m_CurrentCondition, "") == 0 || strcmp(m_CurrentConditionIcon, "") == 0 || + strcmp(m_CurrentTemperature, "") == 0 || strcmp(m_CurrentLocation, "") == 0 || + strcmp(m_CurrentFanartCode, "") == 0 || strcmp(m_IsFetched, "false") == 0) + */ + if (0 == *m_CurrentCondition || 0 == *m_CurrentConditionIcon || + 0 == *m_CurrentTemperature || 0 == *m_CurrentLocation || + 0 == *m_CurrentFanartCode || strcmp(m_IsFetched, "false") == 0) + { + CLog::Log(LOGNOTICE, "SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS"); + CGUIWindow *window = g_windowManager.GetWindow(WINDOW_WEATHER); + if (window) + { + // set these so existing weather infolabels don't break + strcpy(m_CurrentCondition, ((CGUIMediaWindow*)window)->GetProperty("Current.Condition").c_str()); + strcpy(m_CurrentConditionIcon, ((CGUIMediaWindow*)window)->GetProperty("Current.ConditionIcon").c_str()); + strcpy(m_CurrentTemperature, ((CGUIMediaWindow*)window)->GetProperty("Current.Temperature").c_str()); + strcpy(m_CurrentLocation, ((CGUIMediaWindow*)window)->GetProperty("Location").c_str()); + strcpy(m_CurrentFanartCode, ((CGUIMediaWindow*)window)->GetProperty("Current.FanartCode").c_str()); + strcpy(m_IsFetched, ((CGUIMediaWindow*)window)->GetProperty("Weather.IsFetched").c_str()); + } + } +} \ No newline at end of file Index: xbmc/utils/Weather.h =================================================================== --- xbmc/utils/Weather.h (revision 30788) +++ xbmc/utils/Weather.h (working copy) @@ -52,14 +52,22 @@ unsigned int GetMaxLocations(); protected: - virtual CStdString TranslateInfo(int info) const; + virtual const char *TranslateInfo(int info); virtual DWORD TimeToNextRefreshInMs(); + void SetInfo(); CStdString m_szLocation[10]; unsigned int m_iCurWeather; int m_MaxLocations; + char m_szCurrentIcon[256]; + char m_CurrentCondition[256]; + char m_CurrentConditionIcon[256]; + char m_CurrentTemperature[10]; + char m_CurrentLocation[256]; + char m_CurrentFanartCode[10]; + char m_IsFetched[10]; }; extern CWeather g_weatherManager;