]> sigrok.org Git - pulseview.git/commitdiff
Fix signal connection for view::Signal and SignalBase enabled state
authorSoeren Apel <redacted>
Tue, 16 Aug 2016 19:34:30 +0000 (21:34 +0200)
committerUwe Hermann <redacted>
Thu, 18 Aug 2016 22:36:03 +0000 (00:36 +0200)
pv/view/signal.cpp
pv/view/signal.hpp

index a8de4d504aaa36b0fdb9960fb4f5b72c5b2391ae..ffe4f67dc9c4cf14cff9e8573b6cce69d6fe669a 100644 (file)
@@ -68,6 +68,9 @@ Signal::Signal(pv::Session &session,
        name_widget_(nullptr)
 {
        assert(base_);
+
+       connect(base_.get(), SIGNAL(enabled_changed(bool)),
+               this, SLOT(on_enabled_changed(bool)));
 }
 
 void Signal::set_name(QString name)
@@ -83,14 +86,6 @@ bool Signal::enabled() const
        return base_->enabled();
 }
 
-void Signal::enable(bool enable)
-{
-       base_->set_enabled(enable);
-
-       if (owner_)
-               owner_->extents_changed(true, true);
-}
-
 shared_ptr<data::SignalBase> Signal::base() const
 {
        return base_;
@@ -162,7 +157,15 @@ void Signal::on_name_changed(const QString &text)
 
 void Signal::on_disable()
 {
-       enable(false);
+       base_->set_enabled(false);
+}
+
+void Signal::on_enabled_changed(bool enabled)
+{
+       (void)enabled;
+
+       if (owner_)
+               owner_->extents_changed(true, true);
 }
 
 } // namespace view
index 72c97e1d00c6f1720cc5cebabfbb38ee05b7f0a9..a449382faf080d31e21ff33a383fd20ff3c38a34 100644 (file)
@@ -64,8 +64,6 @@ public:
         */
        bool enabled() const;
 
-       void enable(bool enable = true);
-
        std::shared_ptr<data::SignalBase> base() const;
 
        /**
@@ -102,6 +100,8 @@ protected Q_SLOTS:
 
        void on_disable();
 
+       void on_enabled_changed(bool enabled);
+
 protected:
        pv::Session &session_;