]> sigrok.org Git - pulseview.git/commitdiff
Added clear_selection to Ruler and Header
authorJoel Holdsworth <redacted>
Mon, 13 May 2013 21:42:09 +0000 (22:42 +0100)
committerJoel Holdsworth <redacted>
Sun, 19 May 2013 08:46:00 +0000 (09:46 +0100)
pv/view/header.cpp
pv/view/header.h
pv/view/marginwidget.h
pv/view/ruler.cpp
pv/view/ruler.h

index 8fb5b4bd3c126a104b2f37d133ceb65405ddb380..cb161a6961ad0cd3aa164f9bbb0523e0fbfbd651 100644 (file)
@@ -78,6 +78,18 @@ boost::shared_ptr<pv::view::Signal> Header::get_mouse_over_signal(
        return shared_ptr<Signal>();
 }
 
+void Header::clear_selection()
+{
+       const vector< shared_ptr<Signal> > sigs(
+               _view.session().get_signals());
+       BOOST_FOREACH(const shared_ptr<Signal> s, sigs) {
+               assert(s);
+               s->select(false);
+       }
+
+       update();
+}
+
 void Header::paintEvent(QPaintEvent*)
 {
        const int w = width();
index 504011b6a63a348763be0495c9f5b305b4339c66..cb1d36246c3d76abb40b21ef89c7905f3f7062cf 100644 (file)
@@ -46,6 +46,8 @@ private:
        boost::shared_ptr<pv::view::Signal> get_mouse_over_signal(
                const QPoint &pt);
 
+       void clear_selection();
+
 private:
        void paintEvent(QPaintEvent *event);
 
index 239692ca26b81bbc9880f891846ebad9305c0a0f..6f2effcffbb462333d1fce5d1989fa80daefdf50 100644 (file)
@@ -35,6 +35,9 @@ class MarginWidget : public QWidget
 public:
        MarginWidget(pv::view::View &parent);
 
+public slots:
+       virtual void clear_selection() = 0;
+
 protected:
        pv::view::View &_view;
 };
index 654e6f45caea7652ae3ff5246492606833d42e82..049cc4af196a8c2203d0ef3ee285e9fa33f17a84 100644 (file)
@@ -58,6 +58,14 @@ Ruler::Ruler(View &parent) :
                this, SLOT(hover_point_changed()));
 }
 
+void Ruler::clear_selection()
+{
+       CursorPair &cursors = _view.cursors();
+       cursors.first().select(false);
+       cursors.second().select(false);
+       update();
+}
+
 QString Ruler::format_time(double t, unsigned int prefix,
        unsigned int precision)
 {
index 461ec05cfbd0e7ef97bb44de2ca0f579543b0424..ba03f312103fce4c42dfcb518c63ab82c35cade6 100644 (file)
@@ -45,6 +45,8 @@ private:
 public:
        Ruler(View &parent);
 
+       void clear_selection();
+
        static QString format_time(double t, unsigned int prefix,
                unsigned precision = 0);