diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-04-06 17:56:18 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-04-06 17:56:23 -0400 |
commit | 803853b4a43582f8d89542d0b3ec58e972826f64 (patch) | |
tree | 99ed6cfe2fb26efcee2bdd1d1b0d5be740f15a16 /gtk2_ardour/editor_ops.cc | |
parent | 537b3a2a0e34f1e49d47b8a51d08c690e02f1454 (diff) |
rationalize incorrect design for removing tracks.
Still requires a way to make this work correctly from the mixer window
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 5ccf589ef3..116bc4571d 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -6750,6 +6750,23 @@ Editor::toggle_tracks_active () void Editor::remove_tracks () { + /* this will delete GUI objects that may be the subject of an event + handler in which this method is called. Defer actual deletion to the + next idle callback, when all event handling is finished. + */ + Glib::signal_idle().connect (sigc::mem_fun (*this, &Editor::idle_remove_tracks)); +} + +bool +Editor::idle_remove_tracks () +{ + _remove_tracks (); + return false; /* do not call again */ +} + +void +Editor::_remove_tracks () +{ TrackSelection& ts (selection->tracks); if (ts.empty()) { @@ -6804,19 +6821,9 @@ edit your ardour.rc file to set the\n\ return; } - // XXX should be using gettext plural forms, maybe? - if (ntracks > 1) { - trackstr = _("tracks"); - } else { - trackstr = _("track"); - } - - if (nbusses > 1) { - busstr = _("busses"); - } else { - busstr = _("bus"); - } - + trackstr = P_("track", "tracks", ntracks); + busstr = P_("bus", "busses", nbusses); + if (ntracks) { if (nbusses) { prompt = string_compose (_("Do you really want to remove %1 %2 and %3 %4?\n" |