]> sigrok.org Git - pulseview.git/commitdiff
Added SigSession::signals_changed signals to indicate when signals are created
authorJoel Holdsworth <redacted>
Sun, 2 Dec 2012 15:07:12 +0000 (15:07 +0000)
committerJoel Holdsworth <redacted>
Tue, 11 Dec 2012 20:05:19 +0000 (20:05 +0000)
pv/sigsession.cpp
pv/sigsession.h
pv/view/view.cpp
pv/view/view.h

index 137998bdb57760a336ab558c7c9b9591c65a1503..e8585c5f84db1465a8a482cbe6266eabc60e270f 100644 (file)
@@ -167,6 +167,7 @@ void SigSession::data_feed_in(const struct sr_dev_inst *sdi,
                        }
                }
 
+               signals_changed();
                break;
        }
 
index 744d8340357117e44069fae550aad39064b20540..763fc16903cc17372e07f5c08cb63d897b41b91f 100644 (file)
@@ -81,6 +81,8 @@ private:
        std::auto_ptr<boost::thread> _sampling_thread;
 
 signals:
+       void signals_changed();
+
        void data_updated();
 
 private:
index c5465ff3c6ba19eef1cd68ba2082ba40d7f413c4..7a444f7c47f68b1032e6a0b359366afb4272e50f 100644 (file)
@@ -79,6 +79,9 @@ View::View(SigSession &session, QWidget *parent) :
                this, SLOT(h_scroll_value_changed(int)));
        connect(verticalScrollBar(), SIGNAL(valueChanged(int)),
                this, SLOT(v_scroll_value_changed(int)));
+
+       connect(&_session, SIGNAL(signals_changed()),
+               this, SLOT(signals_changed()));
        connect(&_session, SIGNAL(data_updated()),
                this, SLOT(data_updated()));
 
@@ -307,6 +310,11 @@ void View::v_scroll_value_changed(int value)
        _viewport->update();
 }
 
+void View::signals_changed()
+{
+       reset_signal_layout();
+}
+
 void View::data_updated()
 {
        // Get the new data length
@@ -326,9 +334,6 @@ void View::data_updated()
 
        // Repaint the view
        _viewport->update();
-
-       /// @todo: Call this only once when the signals are first created.
-       reset_signal_layout();
 }
 
 void View::marker_time_changed()
index 3cd2646e91e8016cbe8543cc3d86717488b5e6f6..5a10ee9ecea7be2b9dacd69c6bb964d0a215de23 100644 (file)
@@ -131,6 +131,7 @@ private slots:
        void h_scroll_value_changed(int value);
        void v_scroll_value_changed(int value);
 
+       void signals_changed();
        void data_updated();
 
        void marker_time_changed();