ConfigControl fix: Add invalid index check to ConfigComplexChoice. Resolve with a default index that can be set.

If more control is needed,  it could be changed to allow multiple states to point to the same index.
This commit is contained in:
TryTwo
2025-03-26 13:15:57 -07:00
parent 896b4bb1fa
commit e5608c6ca5
3 changed files with 15 additions and 4 deletions

View File

@ -62,6 +62,7 @@ public:
void Add(const QString& name, const OptionVariant option1, const OptionVariant option2);
void Refresh();
void Reset();
void SetDefault(int index);
const std::pair<Config::Location, Config::Location> GetLocation() const;
private:
@ -73,4 +74,5 @@ private:
const InfoVariant m_setting1;
const InfoVariant m_setting2;
std::vector<std::pair<OptionVariant, OptionVariant>> m_options;
int m_default_index = -1;
};