Skip to content

Commit

Permalink
Merge pull request xbmc#6434 from AlwinEsch/add-changeable-setting-name
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins4kodi committed Feb 18, 2015
2 parents 6cb94aa + 9c3629f commit 2e5f353
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
7 changes: 6 additions & 1 deletion xbmc/settings/dialogs/GUIDialogSettingsBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,11 @@ std::set<std::string> CGUIDialogSettingsBase::CreateSettings()
return settingMap;
}

std::string CGUIDialogSettingsBase::GetSettingsLabel(CSetting *pSetting)
{
return GetLocalizedString(pSetting->GetLabel());
}

void CGUIDialogSettingsBase::UpdateSettings()
{
for (vector<BaseSettingControlPtr>::iterator it = m_settingControls.begin(); it != m_settingControls.end(); ++it)
Expand All @@ -562,7 +567,7 @@ CGUIControl* CGUIDialogSettingsBase::AddSetting(CSetting *pSetting, float width,
CGUIControl *pControl = NULL;

// determine the label and any possible indentation in case of sub settings
string label = GetLocalizedString(pSetting->GetLabel());
std::string label = GetSettingsLabel(pSetting);
int parentLevels = 0;
CSetting *parentSetting = GetSetting(pSetting->GetParent());
while (parentSetting != NULL)
Expand Down
14 changes: 13 additions & 1 deletion xbmc/settings/dialogs/GUIDialogSettingsBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,19 @@ class CGUIDialogSettingsBase
virtual void SetupView();
virtual std::set<std::string> CreateSettings();
virtual void UpdateSettings();


/*!
\brief Get the name for the setting entry
Used as virtual to allow related settings dialog to give a std::string name of the setting.
If not used on own dialog class it handle the string from int CSetting::GetLabel(),
This must also be used if on related dialog no special entry is wanted.
\param pSetting Base settings class which need the name
\return Name used on settings dialog
*/
virtual std::string GetSettingsLabel(CSetting *pSetting);

virtual CGUIControl* AddSetting(CSetting *pSetting, float width, int &iControlID);
virtual CGUIControl* AddSettingControl(CGUIControl *pControl, BaseSettingControlPtr pSettingControl, float width, int &iControlID);

Expand Down

0 comments on commit 2e5f353

Please sign in to comment.