diff options
Diffstat (limited to 'gtk2_ardour/script_selector.cc')
-rw-r--r-- | gtk2_ardour/script_selector.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gtk2_ardour/script_selector.cc b/gtk2_ardour/script_selector.cc index a80a0af1cc..c13b122cd1 100644 --- a/gtk2_ardour/script_selector.cc +++ b/gtk2_ardour/script_selector.cc @@ -176,17 +176,21 @@ ScriptParameterDialog::ScriptParameterDialog (std::string title, } for (size_t i = 0; i < _lsp.size (); ++i) { - CheckButton* c = manage (new CheckButton (_lsp[i]->title)); Entry* e = manage (new Entry()); - c->set_active (!_lsp[i]->optional); // also if default ?? - c->set_sensitive (_lsp[i]->optional); - e->set_text (_lsp[i]->dflt); - e->set_sensitive (c->get_active ()); + if (_lsp[i]->optional) { + CheckButton* c = manage (new CheckButton (_lsp[i]->title)); + c->set_active (!_lsp[i]->dflt.empty()); + c->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &ScriptParameterDialog::active_changed), i, c, e)); + t->attach (*c, 0, 1, ty, ty+1); + } else { + Label* l = manage (new Label (_lsp[i]->title, Gtk::ALIGN_LEFT)); + t->attach (*l, 0, 1, ty, ty+1); + } - c->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &ScriptParameterDialog::active_changed), i, c, e)); + e->set_text (_lsp[i]->dflt); + e->set_sensitive (!_lsp[i]->dflt.empty()); e->signal_changed().connect (sigc::bind (sigc::mem_fun (*this, &ScriptParameterDialog::value_changed), i, e)); - t->attach (*c, 0, 1, ty, ty+1); t->attach (*e, 1, 2, ty, ty+1); ++ty; } |