: m_id(id),
m_settingsManager(settingsManager),
m_visible(true),
+ m_label(-1), m_help(-1),
m_meetsRequirements(true),
m_requirementCondition(settingsManager)
{ }
if (XMLUtils::GetBoolean(node, SETTING_XML_ELM_VISIBLE, value))
m_visible = value;
+ const TiXmlElement *element = node->ToElement();
+ if (element == NULL)
+ return false;
+
+ int iValue = -1;
+ if (element->QueryIntAttribute(SETTING_XML_ATTR_LABEL, &iValue) == TIXML_SUCCESS && iValue > 0)
+ m_label = iValue;
+ if (element->QueryIntAttribute(SETTING_XML_ATTR_HELP, &iValue) == TIXML_SUCCESS && iValue > 0)
+ m_help = iValue;
+
const TiXmlNode *requirementNode = node->FirstChild(SETTING_XML_ELM_REQUIREMENT);
if (requirementNode == NULL)
return true;
\param visible Whether the setting object shall be visible or not
*/
virtual void SetVisible(bool visible) { m_visible = visible; }
+ /*!
+ \brief Gets the localizeable label ID of the setting group.
+ \return Localizeable label ID of the setting group
+ */
+ const int GetLabel() const { return m_label; }
+ /*!
+ \brief Sets the localizeable label ID of the setting group.
+
+ \param label Localizeable label ID of the setting group
+ */
+ void SetLabel(int label) { m_label = label; }
+ /*!
+ \brief Gets the localizeable help ID of the setting group.
+
+ \return Localizeable help ID of the setting group
+ */
+ const int GetHelp() const { return m_help; }
+ /*!
+ \brief Sets the localizeable help ID of the setting group.
+
+ \param label Localizeable help ID of the setting group
+ */
+ void SetHelp(int help) { m_help = help; }
/*!
\brief Whether the setting object meets all necessary requirements.
private:
bool m_visible;
+ int m_label;
+ int m_help;
bool m_meetsRequirements;
CSettingRequirement m_requirementCondition;
};
CSettingCategory::CSettingCategory(const std::string &id, CSettingsManager *settingsManager /* = NULL */)
: ISetting(id, settingsManager),
- m_label(-1), m_help(-1),
m_accessCondition(settingsManager)
{ }
// handle <visible> conditions
if (!ISetting::Deserialize(node, update))
return false;
-
- const TiXmlElement *element = node->ToElement();
- if (element == NULL)
- return false;
-
- int tmp = -1;
- if (element->QueryIntAttribute(SETTING_XML_ATTR_LABEL, &tmp) == TIXML_SUCCESS && tmp > 0)
- m_label = tmp;
- if (element->QueryIntAttribute(SETTING_XML_ATTR_HELP, &tmp) == TIXML_SUCCESS && tmp > 0)
- m_help = tmp;
const TiXmlNode *accessNode = node->FirstChild(SETTING_XML_ELM_ACCESS);
if (accessNode != NULL && !m_accessCondition.Deserialize(accessNode))
}
CSettingSection::CSettingSection(const std::string &id, CSettingsManager *settingsManager /* = NULL */)
- : ISetting(id, settingsManager),
- m_label(-1), m_help(-1)
+ : ISetting(id, settingsManager)
{ }
CSettingSection::~CSettingSection()
if (!ISetting::Deserialize(node, update))
return false;
- const TiXmlElement *element = node->ToElement();
- if (element == NULL)
- return false;
-
- int tmp = -1;
- if (element->QueryIntAttribute(SETTING_XML_ATTR_LABEL, &tmp) == TIXML_SUCCESS && tmp > 0)
- m_label = tmp;
- if (element->QueryIntAttribute(SETTING_XML_ATTR_HELP, &tmp) == TIXML_SUCCESS && tmp > 0)
- m_help = tmp;
-
const TiXmlNode *categoryNode = node->FirstChild(SETTING_XML_ELM_CATEGORY);
while (categoryNode != NULL)
{
virtual bool Deserialize(const TiXmlNode *node, bool update = false);
/*!
- \brief Gets the localizeable label ID of the setting category.
-
- \return Localizeable label ID of the setting category
- */
- const int GetLabel() const { return m_label; }
- /*!
- \brief Sets the localizeable label ID of the setting category.
-
- \param label Localizeable label ID of the setting category
- */
- void SetLabel(int label) { m_label = label; }
- /*!
- \brief Gets the localizeable help ID of the setting category.
-
- \return Localizeable help ID of the setting category
- */
- const int GetHelp() const { return m_help; }
- /*!
- \brief Sets the localizeable help ID of the setting category.
-
- \param label Localizeable help ID of the setting category
- */
- void SetHelp(int help) { m_help = help; }
- /*!
\brief Gets the full list of setting groups belonging to the setting
category.
void AddGroups(const SettingGroupList &groups);
private:
- int m_label;
- int m_help;
SettingGroupList m_groups;
CSettingCategoryAccess m_accessCondition;
};
virtual bool Deserialize(const TiXmlNode *node, bool update = false);
/*!
- \brief Gets the localizeable label ID of the setting section.
-
- \return Localizeable label ID of the setting section
- */
- const int GetLabel() const { return m_label; }
- /*!
- \brief Sets the localizeable label ID of the setting section.
-
- \param label Localizeable label ID of the setting section
- */
- void SetLabel(int label) { m_label = label; }
- /*!
- \brief Gets the localizeable help ID of the setting section.
-
- \return Localizeable help ID of the setting section
- */
- const int GetHelp() const { return m_help; }
- /*!
- \brief Sets the localizeable help ID of the setting section.
-
- \param label Localizeable help ID of the setting section
- */
- void SetHelp(int help) { m_help = help; }
- /*!
\brief Gets the full list of setting categories belonging to the setting
section.
void AddCategories(const SettingCategoryList &categories);
private:
- int m_label;
- int m_help;
SettingCategoryList m_categories;
};