From: Joel Holdsworth Date: Sun, 29 Sep 2013 13:56:25 +0000 (+0900) Subject: Added Signal::populate_popup_form X-Git-Tag: pulseview-0.2.0~274 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0c0218fd70bde15f2ccd20f39f6d3ddddd3e1691;p=pulseview.git Added Signal::populate_popup_form --- diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index d61ccd83..446814ed 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -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); diff --git a/pv/view/signal.h b/pv/view/signal.h index d55bcf1f..aff8c4c4 100644 --- a/pv/view/signal.h +++ b/pv/view/signal.h @@ -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);