settings: add <hidevalue> to list setting controls
authormontellese <montellese@xbmc.org>
Tue, 13 May 2014 19:01:34 +0000 (21:01 +0200)
committermontellese <montellese@xbmc.org>
Tue, 13 May 2014 19:01:45 +0000 (21:01 +0200)
xbmc/settings/SettingControl.cpp
xbmc/settings/SettingControl.h
xbmc/settings/windows/GUIControlSettings.cpp

index de2b247..f7230e4 100644 (file)
@@ -163,6 +163,7 @@ bool CSettingControlList::Deserialize(const TiXmlNode *node, bool update /* = fa
   
   XMLUtils::GetInt(node, SETTING_XML_ELM_CONTROL_HEADING, m_heading);
   XMLUtils::GetBoolean(node, SETTING_XML_ELM_CONTROL_MULTISELECT, m_multiselect);
+  XMLUtils::GetBoolean(node, SETTING_XML_ELM_CONTROL_HIDEVALUE, m_hideValue);
 
   return true;
 }
index f9d4302..e6e1618 100644 (file)
@@ -144,7 +144,8 @@ class CSettingControlList : public ISettingControl
 public:
   CSettingControlList()
     : m_heading(-1),
-      m_multiselect(false)
+      m_multiselect(false),
+      m_hideValue(false)
   { }
   virtual ~CSettingControlList() { }
 
@@ -157,10 +158,13 @@ public:
   void SetHeading(int heading) { m_heading = heading; }
   bool CanMultiSelect() const { return m_multiselect; }
   void SetMultiSelect(bool multiselect) { m_multiselect = multiselect; }
+  bool HideValue() const { return m_hideValue; }
+  void SetHideValue(bool hideValue) { m_hideValue = hideValue; }
 
 protected:  
   int m_heading;
   bool m_multiselect;
+  bool m_hideValue;
 };
 
 class CSettingControlSlider;
index 0bc74b8..2380fd9 100644 (file)
@@ -343,7 +343,8 @@ void CGUIControlListSetting::Update(bool updateDisplayOnly /* = false */)
   CGUIControlBaseSetting::Update();
   
   CFileItemList options;
-  if (GetItems(m_pSetting, options))
+  bool optionsValid = GetItems(m_pSetting, options);
+  if (optionsValid && !static_cast<const CSettingControlList*>(m_pSetting->GetControl())->HideValue())
   {
     std::vector<std::string> labels;
     for (int index = 0; index < options.Size(); index++)
@@ -355,6 +356,8 @@ void CGUIControlListSetting::Update(bool updateDisplayOnly /* = false */)
 
     m_pButton->SetLabel2(StringUtils::Join(labels, ", "));
   }
+  else
+    m_pButton->SetLabel2(StringUtils::Empty);
 
   // disable the control if it has less than two items
   if (!m_pButton->IsDisabled() && options.Size() <= 1)