Fix Ctrl-Surface UI/Edit button sensitivity
authorRobin Gareus <robin@gareus.org>
Thu, 19 Jul 2018 12:57:46 +0000 (14:57 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 19 Jul 2018 12:57:46 +0000 (14:57 +0200)
Only enable button if the surface has an editor-GUI.

gtk2_ardour/rc_option_editor.cc

index 1432919201831e04fa71ec237960e17c44ca0634..42a0277f8d76a777b770620b2d98803db1670a8f 100644 (file)
@@ -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)