diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2020-02-18 20:41:23 -0600 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2020-02-18 20:41:23 -0600 |
commit | 4f9a91cab834bcc0c60ae065cb1d3da969c5d55a (patch) | |
tree | e9963ff5df818ff5657156ebdbad22a6d7f64b9e /gtk2_ardour/vca_master_strip.cc | |
parent | d6315618da305a99932799998102e9d00cd28951 (diff) |
Prompt user when deleting a VCA (amends 01c6f5)
Editor::remove_tracks expected the VCA to be selected, but right-click does not force selection in a VCA strip.
Diffstat (limited to 'gtk2_ardour/vca_master_strip.cc')
-rw-r--r-- | gtk2_ardour/vca_master_strip.cc | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/gtk2_ardour/vca_master_strip.cc b/gtk2_ardour/vca_master_strip.cc index f23350e0b6..faeba8dac8 100644 --- a/gtk2_ardour/vca_master_strip.cc +++ b/gtk2_ardour/vca_master_strip.cc @@ -36,7 +36,6 @@ #include "floating_text_entry.h" #include "gui_thread.h" #include "mixer_ui.h" -#include "public_editor.h" #include "ui_config.h" #include "utils.h" #include "vca_master_strip.h" @@ -469,7 +468,7 @@ VCAMasterStrip::build_context_menu () items.push_back (SeparatorElem()); items.push_back (MenuElem (_("Drop All Slaves"), sigc::mem_fun (*this, &VCAMasterStrip::drop_all_slaves))); items.push_back (SeparatorElem()); - items.push_back (MenuElem (_("Remove"), sigc::mem_fun(PublicEditor::instance(), &PublicEditor::remove_tracks))); + items.push_back (MenuElem (_("Remove"), sigc::mem_fun (*this, &VCAMasterStrip::remove))); } void @@ -495,6 +494,42 @@ VCAMasterStrip::spill_change (boost::shared_ptr<Stripable> vca) } void +VCAMasterStrip::remove () +{ + if (!_session) { + return; + } + + ArdourMessageDialog checker (_("Do you really want to remove this VCA?"), + true, + Gtk::MESSAGE_QUESTION, + Gtk::BUTTONS_NONE); + + string title = string_compose (_("Remove %1"), "VCA"); + checker.set_title (title); + + checker.set_secondary_text(_("This action cannot be undone.")); + + checker.add_button (_("No, do nothing."), RESPONSE_CANCEL); + checker.add_button (_("Yes, remove it."), RESPONSE_ACCEPT); + checker.set_default_response (RESPONSE_CANCEL); + + checker.set_name (X_("RemoveVcaDialog")); + checker.set_wmclass (X_("ardour_vca_remove"), PROGRAM_NAME); + checker.set_position (Gtk::WIN_POS_MOUSE); + + switch (checker.run()) { + case RESPONSE_ACCEPT: + break; + default: + return; + } + checker.hide(); + + _session->vca_manager().remove_vca (_vca); +} + +void VCAMasterStrip::assign_all_selected () { Mixer_UI::instance()->do_vca_assign (_vca); |