projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure to use QT4 even if QT5 is available
[pulseview.git]
/
pv
/
view
/
decodesignal.cpp
diff --git
a/pv/view/decodesignal.cpp
b/pv/view/decodesignal.cpp
index afc465b9e7a1fe4ff39ce10f4a8acac14e8d1264..32307e9c99dcf5d739205df177d904af5bf05ff0 100644
(file)
--- a/
pv/view/decodesignal.cpp
+++ b/
pv/view/decodesignal.cpp
@@
-24,7
+24,10
@@
extern "C" {
#include <extdef.h>
#include <extdef.h>
+#include <boost/foreach.hpp>
+
#include <QAction>
#include <QAction>
+#include <QMenu>
#include "decodesignal.h"
#include "decodesignal.h"
@@
-59,11
+62,6
@@
DecodeSignal::DecodeSignal(pv::SigSession &session,
this, SLOT(on_new_decode_data()));
}
this, SLOT(on_new_decode_data()));
}
-void DecodeSignal::init_context_bar_actions(QWidget *parent)
-{
- (void)parent;
-}
-
bool DecodeSignal::enabled() const
{
return true;
bool DecodeSignal::enabled() const
{
return true;
@@
-104,18
+102,11
@@
void DecodeSignal::paint_mid(QPainter &p, int left, int right)
vector< shared_ptr<Annotation> > annotations(_decoder->annotations());
BOOST_FOREACH(shared_ptr<Annotation> a, annotations) {
assert(a);
vector< shared_ptr<Annotation> > annotations(_decoder->annotations());
BOOST_FOREACH(shared_ptr<Annotation> 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<QAction*> DecodeSignal::get_context_bar_actions()
-{
- list<QAction*> actions;
- return actions;
-}
-
QMenu* DecodeSignal::create_context_menu(QWidget *parent)
{
QMenu *const menu = Trace::create_context_menu(parent);
QMenu* DecodeSignal::create_context_menu(QWidget *parent)
{
QMenu *const menu = Trace::create_context_menu(parent);
@@
-123,6
+114,7
@@
QMenu* DecodeSignal::create_context_menu(QWidget *parent)
menu->addSeparator();
QAction *const del = new QAction(tr("Delete"), this);
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);
connect(del, SIGNAL(triggered()), this, SLOT(on_delete()));
menu->addAction(del);
@@
-135,6
+127,11
@@
void DecodeSignal::on_new_decode_data()
_view->update_viewport();
}
_view->update_viewport();
}
+void DecodeSignal::delete_pressed()
+{
+ on_delete();
+}
+
void DecodeSignal::on_delete()
{
_session.remove_decode_signal(this);
void DecodeSignal::on_delete()
{
_session.remove_decode_signal(this);