diff --git a/src/layout_store.cpp b/src/layout_store.cpp index 5f6a6b2..ac4e38f 100644 --- a/src/layout_store.cpp +++ b/src/layout_store.cpp @@ -496,6 +496,8 @@ bool load_layout(const std::string& path, LayoutState& out) { } } else if (key == "measure_stats") { st.measure_stats = value == "true"; + } else if (key == "side_tab") { + st.side_tab = strip_quote(value); } else if (key == "multicast") { st.multicast = strip_quote(value); } else if (key == "interface") { @@ -645,6 +647,7 @@ bool save_layout(const std::string& path, const LayoutState& state) { o << "]\n"; } o << "measure_stats = " << (state.measure_stats ? "true" : "false") << "\n"; + o << "side_tab = \"" << state.side_tab << "\"\n"; if (!state.comment.empty()) o << "comment = " << toml_escape(state.comment) << "\n"; if (state.buffer_mb > 0.0) o << "buffer_mb = " << state.buffer_mb << "\n"; o << "relative_time = " << (state.relative_time ? "true" : "false") << "\n"; diff --git a/src/layout_store.hpp b/src/layout_store.hpp index 7d11ccb..169ba58 100644 --- a/src/layout_store.hpp +++ b/src/layout_store.hpp @@ -66,6 +66,10 @@ struct LayoutState { /// stream and mean nothing restored against another one. bool measure_stats = false; + /// Which sidebar tab was showing: "measure" or "signals". The one thing the panel persists -- + /// no revealer states remain, and the 320 px width is the `.ui`'s. + std::string side_tab = "signals"; + /// The measurements pane, by signal *name* and with the type and options a row was built with. std::vector measures; diff --git a/src/ui_layout.cpp b/src/ui_layout.cpp index 96cd0a0..6e54e8b 100644 --- a/src/ui_layout.cpp +++ b/src/ui_layout.cpp @@ -58,6 +58,7 @@ LayoutState collect_layout(App& app) { st.math = app.math; st.measures = app.measures; st.measure_stats = app.measure_stats_on; + st.side_tab = app.side_tab; // The connection is the session's too: the file's name carries only host and port. st.multicast = app.source_multicast; st.interface_addr = app.source_interface; @@ -327,6 +328,7 @@ void apply_layout(App& app, const LayoutState& st) { app.measures = st.measures; app.measure_stats_on = st.measure_stats; app.updating_panels = true; + select_side_tab(app, st.side_tab.c_str()); if (app.measures_stats_check != nullptr) { gtk_check_button_set_active(GTK_CHECK_BUTTON(app.measures_stats_check), app.measure_stats_on);