From 34f0cd5209ee821d681c90cff805a02c0d3c7bdb Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 19 Jul 2018 14:57:46 +0200 Subject: Fix Ctrl-Surface UI/Edit button sensitivity Only enable button if the surface has an editor-GUI. --- gtk2_ardour/rc_option_editor.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gtk2_ardour') 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) -- cgit v1.2.3