]> sigrok.org Git - pulseview.git/commitdiff
Added DevInst::config_changed signal
authorJoel Holdsworth <redacted>
Sun, 9 Feb 2014 19:30:23 +0000 (19:30 +0000)
committerJoel Holdsworth <redacted>
Sun, 9 Feb 2014 19:41:32 +0000 (19:41 +0000)
CMakeLists.txt
pv/devinst.cpp
pv/devinst.h

index 695da5b4c831f0525d82b6c6d519d2dcbb33ef54..edac86111c77c4f256096afd98a694a55ea64450 100644 (file)
@@ -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
index 8f57bbd2cf2a310778fade65a5b896098108f1dc..4cae04aee29a32e8f98a862c0550a98f68957535 100644 (file)
@@ -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)
index 4b61810933bf5c6a1ab2b571a8032093bc09b2ec..400f7c32893be45e7f275ce97eec05e9fb6cb0aa 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <boost/shared_ptr.hpp>
 
+#include <QObject>
+
 #include <glib.h>
 
 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;
 };