}
#endif
+void SignalBase::save_settings(QSettings &settings) const
+{
+ settings.setValue("name", name());
+ settings.setValue("enabled", enabled());
+ settings.setValue("colour", colour());
+}
+
+void SignalBase::restore_settings(QSettings &settings)
+{
+ set_name(settings.value("name").toString());
+ set_enabled(settings.value("enabled").toBool());
+ set_colour(settings.value("colour").value<QColor>());
+}
+
+
} // namespace data
} // namespace pv
#include <QColor>
#include <QObject>
+#include <QSettings>
#include <QString>
#include <libsigrokcxx/libsigrokcxx.hpp>
decoder_stack);
#endif
+ void save_settings(QSettings &settings) const;
+
+ void restore_settings(QSettings &settings);
+
Q_SIGNALS:
void enabled_changed(const bool &value);
#endif
{
settings.beginGroup(base->internal_name());
- settings.setValue("name", base->name());
- settings.setValue("enabled", base->enabled());
- settings.setValue("colour", base->colour());
+ base->save_settings(settings);
settings.endGroup();
}
}
// Restore channels
for (shared_ptr<data::SignalBase> base : signalbases_) {
settings.beginGroup(base->internal_name());
- base->set_name(settings.value("name").toString());
- base->set_enabled(settings.value("enabled").toBool());
- base->set_colour(settings.value("colour").value<QColor>());
+ base->restore_settings(settings);
settings.endGroup();
}