]> sigrok.org Git - pulseview.git/commitdiff
Added Disable context menu item to Signal
authorJoel Holdsworth <redacted>
Sun, 13 Oct 2013 22:16:09 +0000 (23:16 +0100)
committerJoel Holdsworth <redacted>
Mon, 14 Oct 2013 12:00:26 +0000 (13:00 +0100)
pv/view/signal.cpp
pv/view/signal.h

index aee214168aed2261b302dea197adcd0a7f65674a..44341aeab5cfa406dd3fa65390169907e2089248 100644 (file)
@@ -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
index 86d2f38007a5b14455c95caca358aec759f89c12..ecd13dc92a17493d79f7f84a02a141fc5d6d30cf 100644 (file)
@@ -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;