mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 22:40:05 +00:00
Commit line settings changes on apply
This commit is contained in:
parent
8212d24d34
commit
6b0aaea773
5 changed files with 53 additions and 0 deletions
|
|
@ -68,6 +68,34 @@ void SettingsCategory::SetDefaults()
|
|||
}
|
||||
}
|
||||
|
||||
bool SettingsCategory::Commit()
|
||||
{
|
||||
bool committed = false;
|
||||
|
||||
// Commit subcategory arrays
|
||||
for (auto& subcategoryArray : p->subcategoryArrays_)
|
||||
{
|
||||
for (auto& subcategory : subcategoryArray.second)
|
||||
{
|
||||
committed |= subcategory->Commit();
|
||||
}
|
||||
}
|
||||
|
||||
// Commit subcategories
|
||||
for (auto& subcategory : p->subcategories_)
|
||||
{
|
||||
committed |= subcategory->Commit();
|
||||
}
|
||||
|
||||
// Commit variables
|
||||
for (auto& variable : p->variables_)
|
||||
{
|
||||
committed |= variable->Commit();
|
||||
}
|
||||
|
||||
return committed;
|
||||
}
|
||||
|
||||
bool SettingsCategory::ReadJson(const boost::json::object& json)
|
||||
{
|
||||
bool validated = true;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,15 @@ public:
|
|||
*/
|
||||
void SetDefaults();
|
||||
|
||||
/**
|
||||
* Sets the current value of all variables to the staged
|
||||
* value.
|
||||
*
|
||||
* @return true if any staged value was committed, false if no staged values
|
||||
* are present.
|
||||
*/
|
||||
bool Commit();
|
||||
|
||||
/**
|
||||
* Reads the variables from the JSON object.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue