]> sigrok.org Git - pulseview.git/commitdiff
TimeMarker: Replaced time_changed signal with View::time_item_apparance_changed
authorJoel Holdsworth <redacted>
Sat, 13 Dec 2014 15:52:54 +0000 (15:52 +0000)
committerJoel Holdsworth <redacted>
Sun, 28 Dec 2014 18:52:53 +0000 (18:52 +0000)
pv/view/timemarker.cpp
pv/view/timemarker.hpp
pv/view/view.cpp
pv/view/view.hpp

index 8eed6e7e2b6240c91c9cef368e3873df100b392b..ed9df36064f74407b1a1ee81f80d11378adbc81c 100644 (file)
@@ -67,7 +67,7 @@ void TimeMarker::set_time(double time)
                updating_value_widget_ = false;
        }
 
-       time_changed();
+       view_.time_item_appearance_changed(true, true);
 }
 
 float TimeMarker::get_x() const
@@ -186,10 +186,8 @@ pv::widgets::Popup* TimeMarker::create_popup(QWidget *parent)
 
 void TimeMarker::on_value_changed(double value)
 {
-       if (!updating_value_widget_) {
-               time_ = value;
-               time_changed();
-       }
+       if (!updating_value_widget_)
+               set_time(value);
 }
 
 } // namespace view
index 7534dbd7c2708c615b9d36179806ec521facac9b..864a4e3865dc007c722cedbee04179f5c437e49e 100644 (file)
@@ -103,9 +103,6 @@ public:
 private Q_SLOTS:
        void on_value_changed(double value);
 
-Q_SIGNALS:
-       void time_changed();
-
 protected:
        const QColor &colour_;
 
index c53c02e3abd44f8242dc7bd1ceaf3d43a38cf02b..d58e074a3ef72ec77bc3e75c3487dac627cbb15d 100644 (file)
@@ -121,11 +121,6 @@ View::View(Session &session, QWidget *parent) :
        connect(&session_, SIGNAL(frame_ended()),
                this, SLOT(data_updated()));
 
-       connect(cursors_->first().get(), SIGNAL(time_changed()),
-               this, SLOT(marker_time_changed()));
-       connect(cursors_->second().get(), SIGNAL(time_changed()),
-               this, SLOT(marker_time_changed()));
-
        connect(header_, SIGNAL(signals_moved()),
                this, SLOT(on_signals_moved()));
 
@@ -615,6 +610,14 @@ void View::row_item_appearance_changed(bool label, bool content)
                viewport_->update();
 }
 
+void View::time_item_appearance_changed(bool label, bool content)
+{
+       if (label)
+               cursorheader_->update();
+       if (content)
+               viewport_->update();
+}
+
 void View::extents_changed(bool horz, bool vert)
 {
        sticky_events_ |=
@@ -728,12 +731,6 @@ void View::data_updated()
        viewport_->update();
 }
 
-void View::marker_time_changed()
-{
-       cursorheader_->update();
-       viewport_->update();
-}
-
 void View::on_signals_moved()
 {
        update_scroll();
index 9ba86b7260b1d72935e857b50c88ea28d499ed86..6a249c22db4af0742861d5b07aa6315f36e4c017 100644 (file)
@@ -232,6 +232,7 @@ private:
 
 public:
        void row_item_appearance_changed(bool label, bool content);
+       void time_item_appearance_changed(bool label, bool content);
 
        void extents_changed(bool horz, bool vert);
 
@@ -243,8 +244,6 @@ private Q_SLOTS:
        void signals_changed();
        void data_updated();
 
-       void marker_time_changed();
-
        void on_signals_moved();
 
        void process_sticky_events();