diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-27 23:27:42 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-27 23:27:42 +0100 |
commit | 8710a2d9432469909eb51d0644f2f25133240dbb (patch) | |
tree | 5f0c9e1663df050249152ec48f75dfa554ce56f2 /gtk2_ardour/editor_ops.cc | |
parent | e5c819956a95a1dc9dee8f805dc55757dc51233d (diff) |
Dialog default to cancel (#7915)
There are various ways to cancel a dialog. Only checking for
RESPONSE_CANCEL is not sufficient. e.g. Esc causes a delete-event.
* Gtk::RESPONSE_CLOSE
* Gtk::RESPONSE_REJECT
* Gtk::RESPONSE_DELETE_EVENT
* Gtk::RESPONSE_CANCEL
* Gtk::RESPONSE_NO
Among others this fixes "Clicking session > open,
then hitting ESC opens the currently selected folder and session"
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 0ffae1ca5d..8ee35ca4db 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -4017,10 +4017,10 @@ Editor::freeze_route () int response = d.run (); switch (response) { - case Gtk::RESPONSE_CANCEL: - return; - default: - break; + case Gtk::RESPONSE_OK: + break; + default: + return; } } @@ -5759,8 +5759,11 @@ Editor::insert_patch_change (bool from_context) Evoral::PatchChange<Temporal::Beats> empty (Temporal::Beats(), 0, 0, 0); PatchChangeDialog d (0, _session, empty, first->instrument_info(), Gtk::Stock::ADD); - if (d.run() == RESPONSE_CANCEL) { - return; + switch (d.run()) { + case Gtk::RESPONSE_ACCEPT: + break; + default: + return; } for (RegionSelection::iterator i = rs.begin (); i != rs.end(); ++i) { @@ -7324,8 +7327,12 @@ Editor::close_region_gaps () dialog.add_button (_("Ok"), RESPONSE_ACCEPT); dialog.show_all (); - if (dialog.run () == RESPONSE_CANCEL) { - return; + switch (dialog.run ()) { + case Gtk::RESPONSE_ACCEPT: + case Gtk::RESPONSE_OK: + break; + default: + return; } samplepos_t crossfade_len = spin_crossfade.get_value(); |