diff options
author | Robin Gareus <robin@gareus.org> | 2018-07-19 14:57:46 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-07-19 14:57:46 +0200 |
commit | 34f0cd5209ee821d681c90cff805a02c0d3c7bdb (patch) | |
tree | f1f6e009460733f5b25f9416adb332bda8fbc105 /gtk2_ardour | |
parent | 0e79253412af587eb6cd8f3f72b841f5517dd47c (diff) |
Fix Ctrl-Surface UI/Edit button sensitivity
Only enable button if the surface has an editor-GUI.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/rc_option_editor.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 1432919201..42a0277f8d 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -1404,10 +1404,12 @@ class ControlSurfacesOptions : public OptionEditorMiniPage { //enable the Edit button when a row is selected for editing TreeModel::Row row = *(_view.get_selection()->get_selected()); - if (row && row[_model.enabled]) - edit_button->set_sensitive (true); - else + if (row && row[_model.enabled]) { + ControlProtocolInfo* cpi = row[_model.protocol_info]; + edit_button->set_sensitive (cpi && cpi->protocol && cpi->protocol->has_editor ()); + } else { edit_button->set_sensitive (false); + } } void view_changed (TreeModel::Path const &, TreeModel::iterator const & i) |