X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fdecodesignal.cpp;h=885312088c2ba11db0d6170687c294b837c06553;hb=b6b267bba9d55d23fe5c3537e4785238d4377ad7;hp=afc465b9e7a1fe4ff39ce10f4a8acac14e8d1264;hpb=c51482b339fbb76e0de042ac3f136a6e5b752b9a;p=pulseview.git diff --git a/pv/view/decodesignal.cpp b/pv/view/decodesignal.cpp index afc465b..8853120 100644 --- a/pv/view/decodesignal.cpp +++ b/pv/view/decodesignal.cpp @@ -24,7 +24,10 @@ extern "C" { #include +#include + #include +#include #include "decodesignal.h" @@ -59,14 +62,14 @@ DecodeSignal::DecodeSignal(pv::SigSession &session, this, SLOT(on_new_decode_data())); } -void DecodeSignal::init_context_bar_actions(QWidget *parent) +bool DecodeSignal::enabled() const { - (void)parent; + return true; } -bool DecodeSignal::enabled() const +const boost::shared_ptr& DecodeSignal::decoder() const { - return true; + return _decoder; } void DecodeSignal::set_view(pv::view::View *view) @@ -104,18 +107,11 @@ void DecodeSignal::paint_mid(QPainter &p, int left, int right) vector< shared_ptr > annotations(_decoder->annotations()); BOOST_FOREACH(shared_ptr a, annotations) { assert(a); - a->paint(p, _colour, _colour.darker(), get_text_colour(), - _text_size.height(), left, right, samples_per_pixel, - pixels_offset, y); + a->paint(p, get_text_colour(), _text_size.height(), + left, right, samples_per_pixel, pixels_offset, y); } } -const list DecodeSignal::get_context_bar_actions() -{ - list actions; - return actions; -} - QMenu* DecodeSignal::create_context_menu(QWidget *parent) { QMenu *const menu = Trace::create_context_menu(parent); @@ -123,6 +119,7 @@ QMenu* DecodeSignal::create_context_menu(QWidget *parent) menu->addSeparator(); QAction *const del = new QAction(tr("Delete"), this); + del->setShortcuts(QKeySequence::Delete); connect(del, SIGNAL(triggered()), this, SLOT(on_delete())); menu->addAction(del); @@ -135,6 +132,11 @@ void DecodeSignal::on_new_decode_data() _view->update_viewport(); } +void DecodeSignal::delete_pressed() +{ + on_delete(); +} + void DecodeSignal::on_delete() { _session.remove_decode_signal(this);