From: Joel Holdsworth Date: Sun, 13 Oct 2013 22:16:09 +0000 (+0100) Subject: Added Disable context menu item to Signal X-Git-Tag: pulseview-0.2.0~248 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=86e823cab6eaa244e9d12d0fb2809b5733687368;p=pulseview.git Added Disable context menu item to Signal --- diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index aee21416..44341aea 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -98,5 +98,23 @@ void Signal::populate_popup_form(QWidget *parent, QFormLayout *form) add_colour_option(parent, form); } +QMenu* Signal::create_context_menu(QWidget *parent) +{ + QMenu *const menu = Trace::create_context_menu(parent); + + menu->addSeparator(); + + QAction *const disable = new QAction(tr("Disable"), this); + connect(disable, SIGNAL(triggered()), this, SLOT(on_disable())); + menu->addAction(disable); + + return menu; +} + +void Signal::on_disable() +{ + enable(false); +} + } // namespace view } // namespace pv diff --git a/pv/view/signal.h b/pv/view/signal.h index 86d2f380..ecd13dc9 100644 --- a/pv/view/signal.h +++ b/pv/view/signal.h @@ -62,6 +62,11 @@ public: virtual void populate_popup_form(QWidget *parent, QFormLayout *form); + QMenu* create_context_menu(QWidget *parent); + +private slots: + void on_disable(); + protected: sr_probe *const _probe;