]> sigrok.org Git - pulseview.git/commitdiff
Added Signal::populate_popup_form
authorJoel Holdsworth <redacted>
Sun, 29 Sep 2013 13:56:25 +0000 (22:56 +0900)
committerJoel Holdsworth <redacted>
Sun, 13 Oct 2013 10:05:22 +0000 (11:05 +0100)
pv/view/signal.cpp
pv/view/signal.h

index d61ccd8368ec8cce971a4735459353b7429d16a4..446814edc5fc4257b1cdf74f71d0ded15b5663ba 100644 (file)
@@ -92,6 +92,21 @@ const sr_probe* Signal::probe() const
        return _probe;
 }
 
+void Signal::populate_popup_form(QWidget *parent, QFormLayout *form)
+{
+       _name_widget = new QComboBox(parent);
+       _name_widget->setEditable(true);
+
+       for(unsigned int i = 0; i < countof(ProbeNames); i++)
+               _name_widget->insertItem(i, ProbeNames[i]);
+       _name_widget->setEditText(_probe->name);
+
+       connect(_name_widget, SIGNAL(editTextChanged(const QString&)),
+               this, SLOT(on_text_changed(const QString&)));
+
+       form->addRow(tr("Name"), _name_widget);
+}
+
 void Signal::on_text_changed(const QString &text)
 {
        Trace::set_name(text);
index d55bcf1fe5205386ef8165be34b020232d496def..aff8c4c427498e54c6eb00dc94dfc05e4c3e4169 100644 (file)
@@ -60,6 +60,9 @@ public:
 
        const sr_probe* probe() const;
 
+private:
+       virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
+
 private slots:
        void on_text_changed(const QString &text);