From b4ab88f7086d87736848fc026bc87db651f8732e Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Thu, 21 Apr 2022 14:41:45 -0400 Subject: add opened tabs to state --- src/state.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/state.cpp') diff --git a/src/state.cpp b/src/state.cpp index 043d181..bf4ab0f 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -24,9 +24,18 @@ void from_json(const nlohmann::json &j, ExpansionState &m) { j.at("c").get_to(m.Children); } +void to_json(nlohmann::json &j, const TabsState &m) { + j = m.Channels; +} + +void from_json(const nlohmann::json &j, TabsState &m) { + j.get_to(m.Channels); +} + void to_json(nlohmann::json &j, const AbaddonApplicationState &m) { j["active_channel"] = m.ActiveChannel; j["expansion"] = m.Expansion; + j["tabs"] = m.Tabs; } void from_json(const nlohmann::json &j, AbaddonApplicationState &m) { @@ -34,4 +43,6 @@ void from_json(const nlohmann::json &j, AbaddonApplicationState &m) { j.at("active_channel").get_to(m.ActiveChannel); if (j.contains("expansion")) j.at("expansion").get_to(m.Expansion); + if (j.contains("tabs")) + j.at("tabs").get_to(m.Tabs); } -- cgit v1.2.3