-
- Window* win = row[_model.editor];
- if (win && !win->is_visible()) {
- win->present ();
- } else {
- cpi = row[_model.protocol_info];
-
- if (cpi && cpi->protocol && cpi->protocol->has_editor ()) {
- Box* box = (Box*) cpi->protocol->get_gui ();
- if (box) {
- string title = row[_model.name];
- ArdourWindow* win = new ArdourWindow (_parent, title);
- win->set_title ("Control Protocol Options");
- win->add (*box);
- box->show ();
- win->present ();
- row[_model.editor] = win;
- }
- }
+ if (!row[_model.enabled]) {
+ return;
+ }
+ cpi = row[_model.protocol_info];
+ if (!cpi || !cpi->protocol || !cpi->protocol->has_editor ()) {
+ return;
+ }
+ Box* box = (Box*) cpi->protocol->get_gui ();
+ if (!box) {
+ return;
+ }
+ if (box->get_parent()) {
+ static_cast<ArdourWindow*>(box->get_parent())->present();
+ return;