From 42e634cff774d802c0fb1047f93f874aafe89277 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sun, 9 Feb 2014 19:30:23 +0000 Subject: [PATCH] Added DevInst::config_changed signal --- CMakeLists.txt | 1 + pv/devinst.cpp | 6 +++++- pv/devinst.h | 9 ++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 695da5b4..edac8611 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,6 +159,7 @@ set(pulseview_SOURCES # This list includes only QObject derived class headers. set(pulseview_HEADERS + pv/devinst.h pv/mainwindow.h pv/sigsession.h pv/storesession.h diff --git a/pv/devinst.cpp b/pv/devinst.cpp index 8f57bbd2..4cae04ae 100644 --- a/pv/devinst.cpp +++ b/pv/devinst.cpp @@ -78,7 +78,11 @@ GVariant* DevInst::get_config(const sr_probe_group *group, int key) bool DevInst::set_config(const sr_probe_group *group, int key, GVariant *data) { - return sr_config_set(_sdi, group, key, data) == SR_OK; + if(sr_config_set(_sdi, group, key, data) == SR_OK) { + config_changed(); + return true; + } + return false; } GVariant* DevInst::list_config(const sr_probe_group *group, int key) diff --git a/pv/devinst.h b/pv/devinst.h index 4b618109..400f7c32 100644 --- a/pv/devinst.h +++ b/pv/devinst.h @@ -25,6 +25,8 @@ #include +#include + #include struct sr_dev_inst; @@ -32,8 +34,10 @@ struct sr_probe_group; namespace pv { -class DevInst +class DevInst : public QObject { + Q_OBJECT + public: DevInst(sr_dev_inst *sdi); @@ -47,6 +51,9 @@ public: GVariant* list_config(const sr_probe_group *group, int key); +signals: + void config_changed(); + private: sr_dev_inst *const _sdi; }; -- 2.30.2