aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormontellese <montellese@xbmc.org>2015-02-26 23:22:03 +0100
committermontellese <montellese@xbmc.org>2015-03-06 08:00:54 +0100
commitbd565464d605fbe7592147530334a61b23f39cac (patch)
tree9961be36e62fae489474ab67cd70c273a0fe6889
parentb6df19055b131940f184fbf6ae994fd776b89041 (diff)
settings: turn locale.language into an addon setting
-rw-r--r--system/settings/settings.xml8
-rw-r--r--xbmc/LangInfo.cpp27
-rw-r--r--xbmc/LangInfo.h1
-rw-r--r--xbmc/settings/Settings.cpp2
4 files changed, 5 insertions, 33 deletions
diff --git a/system/settings/settings.xml b/system/settings/settings.xml
index dc561763da..44bceba709 100644
--- a/system/settings/settings.xml
+++ b/system/settings/settings.xml
@@ -114,13 +114,15 @@
</category>
<category id="locale" label="14090" help="36113">
<group id="1">
- <setting id="locale.language" type="string" label="248" help="36114">
+ <setting id="locale.language" type="addon" label="248" help="36114">
<level>0</level>
<default>English</default>
<constraints>
- <options>languages</options>
+ <addontype>kodi.resource.language</addontype>
</constraints>
- <control type="list" format="string" />
+ <control type="button" format="addon">
+ <show more="false" details="false">all</show>
+ </control>
</setting>
<setting id="locale.country" type="string" label="20026" help="36115">
<level>0</level>
diff --git a/xbmc/LangInfo.cpp b/xbmc/LangInfo.cpp
index dfe4ec3bab..2b9e12eed7 100644
--- a/xbmc/LangInfo.cpp
+++ b/xbmc/LangInfo.cpp
@@ -626,33 +626,6 @@ const std::string& CLangInfo::GetSpeedUnitString() const
return g_localizeStrings.Get(SPEED_UNIT_STRINGS+m_currentRegion->m_speedUnit);
}
-void CLangInfo::SettingOptionsLanguagesFiller(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string &current, void *data)
-{
- //find languages...
- CFileItemList items;
- XFILE::CDirectory::GetDirectory("special://xbmc/language/", items);
-
- vector<string> vecLanguage;
- for (int i = 0; i < items.Size(); ++i)
- {
- CFileItemPtr pItem = items[i];
- if (pItem->m_bIsFolder)
- {
- if (StringUtils::EqualsNoCase(pItem->GetLabel(), ".svn") ||
- StringUtils::EqualsNoCase(pItem->GetLabel(), "fonts") ||
- StringUtils::EqualsNoCase(pItem->GetLabel(), "media"))
- continue;
-
- vecLanguage.push_back(pItem->GetLabel());
- }
- }
-
- sort(vecLanguage.begin(), vecLanguage.end(), sortstringbyname());
-
- for (unsigned int i = 0; i < vecLanguage.size(); ++i)
- list.push_back(make_pair(vecLanguage[i], vecLanguage[i]));
-}
-
void CLangInfo::SettingOptionsStreamLanguagesFiller(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string &current, void *data)
{
list.push_back(make_pair(g_localizeStrings.Get(308), "original"));
diff --git a/xbmc/LangInfo.h b/xbmc/LangInfo.h
index 0af6f8c86a..84c95639b4 100644
--- a/xbmc/LangInfo.h
+++ b/xbmc/LangInfo.h
@@ -142,7 +142,6 @@ public:
static void LoadTokens(const TiXmlNode* pTokens, std::vector<std::string>& vecTokens);
- static void SettingOptionsLanguagesFiller(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string &current, void *data);
static void SettingOptionsStreamLanguagesFiller(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string &current, void *data);
static void SettingOptionsRegionsFiller(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string &current, void *data);
diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp
index 5388ea3b47..c40b18f965 100644
--- a/xbmc/settings/Settings.cpp
+++ b/xbmc/settings/Settings.cpp
@@ -229,7 +229,6 @@ void CSettings::Uninitialize()
m_settingsManager->UnregisterSettingOptionsFiller("epgguideviews");
m_settingsManager->UnregisterSettingOptionsFiller("fontheights");
m_settingsManager->UnregisterSettingOptionsFiller("fonts");
- m_settingsManager->UnregisterSettingOptionsFiller("languages");
m_settingsManager->UnregisterSettingOptionsFiller("refreshchangedelays");
m_settingsManager->UnregisterSettingOptionsFiller("refreshrates");
m_settingsManager->UnregisterSettingOptionsFiller("regions");
@@ -572,7 +571,6 @@ void CSettings::InitializeOptionFillers()
m_settingsManager->RegisterSettingOptionsFiller("audiostreamsilence", CAEFactory::SettingOptionsAudioStreamsilenceFiller);
m_settingsManager->RegisterSettingOptionsFiller("charsets", CCharsetConverter::SettingOptionsCharsetsFiller);
m_settingsManager->RegisterSettingOptionsFiller("fonts", GUIFontManager::SettingOptionsFontsFiller);
- m_settingsManager->RegisterSettingOptionsFiller("languages", CLangInfo::SettingOptionsLanguagesFiller);
m_settingsManager->RegisterSettingOptionsFiller("refreshchangedelays", CDisplaySettings::SettingOptionsRefreshChangeDelaysFiller);
m_settingsManager->RegisterSettingOptionsFiller("refreshrates", CDisplaySettings::SettingOptionsRefreshRatesFiller);
m_settingsManager->RegisterSettingOptionsFiller("regions", CLangInfo::SettingOptionsRegionsFiller);