]> sigrok.org Git - pulseview.git/blobdiff - pv/view/decodesignal.h
Added decode error display
[pulseview.git] / pv / view / decodesignal.h
index 673d65499509a409ca1266c5fbcd693ed4d97cd4..efa3449575942e1a4b69170276c3094b770c8256 100644 (file)
@@ -18,8 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef PULSEVIEW_PV_DECODESIGNAL_H
-#define PULSEVIEW_PV_DECODESIGNAL_H
+#ifndef PULSEVIEW_PV_VIEW_DECODESIGNAL_H
+#define PULSEVIEW_PV_VIEW_DECODESIGNAL_H
 
 #include "trace.h"
 
@@ -39,15 +39,16 @@ class DecodeSignal : public Trace
 
 private:
        static const QColor DecodeColours[4];
+       static const QColor ErrorBgColour;
 
 public:
        DecodeSignal(pv::SigSession &session,
                boost::shared_ptr<pv::data::Decoder> decoder, int index);
 
-       void init_context_bar_actions(QWidget *parent);
-
        bool enabled() const;
 
+       const boost::shared_ptr<pv::data::Decoder>& decoder() const;
+
        void set_view(pv::view::View *view);
 
        /**
@@ -66,19 +67,19 @@ public:
         **/
        void paint_mid(QPainter &p, int left, int right);
 
-       const std::list<QAction*> get_context_bar_actions();
+       QMenu* create_context_menu(QWidget *parent);
 
-private:
+       void delete_pressed();
 
-       /**
-        * When painting into the rectangle, calculate the y
-        * offset of the zero point.
-        **/
-       int get_nominal_offset(const QRect &rect) const;
+private:
+       void draw_error(QPainter &p, const QString &message,
+               int left, int right);
 
 private slots:
        void on_new_decode_data();
 
+       void on_delete();
+
 private:
        boost::shared_ptr<pv::data::Decoder> _decoder;
 
@@ -88,4 +89,4 @@ private:
 } // namespace view
 } // namespace pv
 
-#endif // PULSEVIEW_PV_DECODESIGNAL_H
+#endif // PULSEVIEW_PV_VIEW_DECODESIGNAL_H