]> sigrok.org Git - pulseview.git/blobdiff - pv/view/signal.cpp
Populate signal popup combo box with signal name instead of probe name
[pulseview.git] / pv / view / signal.cpp
index aadaed78f7d238cac06a1a1ec789eb5795864650..0ce423feaae6b97e5bc6809d75fa368b0a71bccb 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <QApplication>
 #include <QFormLayout>
+#include <QLineEdit>
 #include <QMenu>
 
 #include <libsigrok/libsigrok.h>
@@ -34,7 +35,7 @@
 
 #include <pv/device/devinst.h>
 
-using boost::shared_ptr;
+using std::shared_ptr;
 
 namespace pv {
 namespace view {
@@ -57,7 +58,7 @@ const char *const ProbeNames[] = {
 };
 
 Signal::Signal(shared_ptr<pv::device::DevInst> dev_inst,
-       const sr_probe *const probe) :
+       const sr_channel *const probe) :
        Trace(probe->name),
        _dev_inst(dev_inst),
        _probe(probe),
@@ -86,7 +87,7 @@ void Signal::enable(bool enable)
        visibility_changed();
 }
 
-const sr_probe* Signal::probe() const
+const sr_channel* Signal::probe() const
 {
        return _probe;
 }
@@ -98,7 +99,9 @@ void Signal::populate_popup_form(QWidget *parent, QFormLayout *form)
 
        for(unsigned int i = 0; i < countof(ProbeNames); i++)
                _name_widget->insertItem(i, ProbeNames[i]);
-       _name_widget->setEditText(_probe->name);
+       _name_widget->setEditText(_name);
+       _name_widget->lineEdit()->selectAll();
+       _name_widget->setFocus();
 
        connect(_name_widget, SIGNAL(editTextChanged(const QString&)),
                this, SLOT(on_text_changed(const QString&)));