From: Joel Holdsworth Date: Sun, 12 May 2013 20:34:30 +0000 (+0100) Subject: Added get_context_bar_actions X-Git-Tag: pulseview-0.2.0~346 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a55c544b0fefead0786633d6d7c2356002b192ae;p=pulseview.git Added get_context_bar_actions --- diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp index f4a665c2..fff11f12 100644 --- a/pv/view/analogsignal.cpp +++ b/pv/view/analogsignal.cpp @@ -54,6 +54,12 @@ AnalogSignal::~AnalogSignal() { } +const list AnalogSignal::get_context_bar_actions() +{ + list actions; + return actions; +} + void AnalogSignal::set_scale(float scale) { _scale = scale; diff --git a/pv/view/analogsignal.h b/pv/view/analogsignal.h index 666aec98..42c15bb0 100644 --- a/pv/view/analogsignal.h +++ b/pv/view/analogsignal.h @@ -47,6 +47,8 @@ public: virtual ~AnalogSignal(); + const std::list get_context_bar_actions(); + void set_scale(float scale); /** diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index e1f0377e..e071e720 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -64,6 +64,12 @@ LogicSignal::~LogicSignal() { } +const list LogicSignal::get_context_bar_actions() +{ + list actions; + return actions; +} + void LogicSignal::paint(QPainter &p, int y, int left, int right, double scale, double offset) { diff --git a/pv/view/logicsignal.h b/pv/view/logicsignal.h index 927e96ab..ed561e6f 100644 --- a/pv/view/logicsignal.h +++ b/pv/view/logicsignal.h @@ -50,6 +50,8 @@ public: virtual ~LogicSignal(); + const std::list get_context_bar_actions(); + /** * Paints the signal with a QPainter * @param p the QPainter to paint into. diff --git a/pv/view/selectableitem.h b/pv/view/selectableitem.h index d8545ce6..d38aca2e 100644 --- a/pv/view/selectableitem.h +++ b/pv/view/selectableitem.h @@ -51,6 +51,9 @@ public: */ void select(bool select = true); +public: + virtual const std::list get_context_bar_actions() = 0; + protected: static QPen highlight_pen(); diff --git a/pv/view/timemarker.cpp b/pv/view/timemarker.cpp index 75ef4ea6..9d4c43c2 100644 --- a/pv/view/timemarker.cpp +++ b/pv/view/timemarker.cpp @@ -24,6 +24,8 @@ #include +using namespace std; + namespace pv { namespace view { @@ -53,5 +55,11 @@ void TimeMarker::paint(QPainter &p, const QRect &rect) p.drawLine(QPointF(x, rect.top()), QPointF(x, rect.bottom())); } +const list TimeMarker::get_context_bar_actions() +{ + list actions; + return actions; +} + } // namespace view } // namespace pv diff --git a/pv/view/timemarker.h b/pv/view/timemarker.h index 2536db75..8d8ae162 100644 --- a/pv/view/timemarker.h +++ b/pv/view/timemarker.h @@ -82,6 +82,12 @@ public: virtual void paint_label(QPainter &p, const QRect &rect, unsigned int prefix) = 0; + /** + * Returns a list of context menu items to show in the context + * bar. + */ + const std::list get_context_bar_actions(); + signals: void time_changed();