From: Soeren Apel Date: Wed, 8 Jan 2020 21:26:25 +0000 (+0100) Subject: DecodeSignal: Save/restore row and column visibilities X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=e4cb8bcfa9e725f15a48f2a305aa1370a604e838;p=pulseview.git DecodeSignal: Save/restore row and column visibilities --- diff --git a/pv/data/decodesignal.cpp b/pv/data/decodesignal.cpp index ce38fbe3..fdf55b73 100644 --- a/pv/data/decodesignal.cpp +++ b/pv/data/decodesignal.cpp @@ -689,6 +689,24 @@ void DecodeSignal::save_settings(QSettings &settings) const i++; } + // Save row properties + i = 0; + for (const Row* row : decoder->get_rows()) { + settings.beginGroup("row" + QString::number(i)); + settings.setValue("visible", row->visible()); + settings.endGroup(); + i++; + } + + // Save class properties + i = 0; + for (const AnnotationClass* ann_class : decoder->ann_classes()) { + settings.beginGroup("ann_class" + QString::number(i)); + settings.setValue("visible", ann_class->visible); + settings.endGroup(); + i++; + } + settings.endGroup(); } @@ -754,6 +772,25 @@ void DecodeSignal::restore_settings(QSettings &settings) // Include the newly created decode channels in the channel lists update_channel_list(); + + // Restore row properties + int i = 0; + for (Row* row : decoder->get_rows()) { + settings.beginGroup("row" + QString::number(i)); + row->set_visible(settings.value("visible", true).toBool()); + settings.endGroup(); + i++; + } + + // Restore class properties + i = 0; + for (AnnotationClass* ann_class : decoder->ann_classes()) { + settings.beginGroup("ann_class" + QString::number(i)); + ann_class->visible = settings.value("visible", true).toBool(); + settings.endGroup(); + i++; + } + break; } }