feat: the session file remembers which sidebar tab was showing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
d2ec89d866
commit
132041f79e
3 files changed
+9
No files matched your search
@@ -496,6 +496,8 @@ bool load_layout(const std::string& path, LayoutState& out) {
|
|||||||
}
|
}
|
||||||
} else if (key == "measure_stats") {
|
} else if (key == "measure_stats") {
|
||||||
st.measure_stats = value == "true";
|
st.measure_stats = value == "true";
|
||||||
|
} else if (key == "side_tab") {
|
||||||
|
st.side_tab = strip_quote(value);
|
||||||
} else if (key == "multicast") {
|
} else if (key == "multicast") {
|
||||||
st.multicast = strip_quote(value);
|
st.multicast = strip_quote(value);
|
||||||
} else if (key == "interface") {
|
} else if (key == "interface") {
|
||||||
@@ -645,6 +647,7 @@ bool save_layout(const std::string& path, const LayoutState& state) {
|
|||||||
o << "]\n";
|
o << "]\n";
|
||||||
}
|
}
|
||||||
o << "measure_stats = " << (state.measure_stats ? "true" : "false") << "\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.comment.empty()) o << "comment = " << toml_escape(state.comment) << "\n";
|
||||||
if (state.buffer_mb > 0.0) o << "buffer_mb = " << state.buffer_mb << "\n";
|
if (state.buffer_mb > 0.0) o << "buffer_mb = " << state.buffer_mb << "\n";
|
||||||
o << "relative_time = " << (state.relative_time ? "true" : "false") << "\n";
|
o << "relative_time = " << (state.relative_time ? "true" : "false") << "\n";
|
||||||
|
|||||||
@@ -66,6 +66,10 @@ struct LayoutState {
|
|||||||
/// stream and mean nothing restored against another one.
|
/// stream and mean nothing restored against another one.
|
||||||
bool measure_stats = false;
|
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.
|
/// The measurements pane, by signal *name* and with the type and options a row was built with.
|
||||||
std::vector<Measure> measures;
|
std::vector<Measure> measures;
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ LayoutState collect_layout(App& app) {
|
|||||||
st.math = app.math;
|
st.math = app.math;
|
||||||
st.measures = app.measures;
|
st.measures = app.measures;
|
||||||
st.measure_stats = app.measure_stats_on;
|
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.
|
// The connection is the session's too: the file's name carries only host and port.
|
||||||
st.multicast = app.source_multicast;
|
st.multicast = app.source_multicast;
|
||||||
st.interface_addr = app.source_interface;
|
st.interface_addr = app.source_interface;
|
||||||
@@ -327,6 +328,7 @@ void apply_layout(App& app, const LayoutState& st) {
|
|||||||
app.measures = st.measures;
|
app.measures = st.measures;
|
||||||
app.measure_stats_on = st.measure_stats;
|
app.measure_stats_on = st.measure_stats;
|
||||||
app.updating_panels = true;
|
app.updating_panels = true;
|
||||||
|
select_side_tab(app, st.side_tab.c_str());
|
||||||
if (app.measures_stats_check != nullptr) {
|
if (app.measures_stats_check != nullptr) {
|
||||||
gtk_check_button_set_active(GTK_CHECK_BUTTON(app.measures_stats_check),
|
gtk_check_button_set_active(GTK_CHECK_BUTTON(app.measures_stats_check),
|
||||||
app.measure_stats_on);
|
app.measure_stats_on);
|
||||||
|
|||||||
Reference in new issue
Block a user