Remove "implicit" selection for plugin deletion.

Allow deletions in the mixer strip to fall through to editor if nothing was selected.
This commit is contained in:
Ben Loftis 2014-07-24 12:30:11 -05:00
parent 3876b48879
commit 6bdc976462
6 changed files with 20 additions and 10 deletions

View File

@ -3734,10 +3734,12 @@ Editor::delete_ ()
{
//special case: if the user is pointing in the editor/mixer strip, they may be trying to delete a plugin.
//we need this because the editor-mixer strip is in the editor window, so it doesn't get the bindings from the mix window
bool deleted = false;
MixerStrip *entered = MixerStrip::entered_mixer_strip();
if ( current_mixer_strip && current_mixer_strip == entered )
current_mixer_strip->delete_processors ();
else
deleted = current_mixer_strip->delete_processors ();
if (!deleted)
cut_copy (Delete);
}

View File

@ -2219,10 +2219,10 @@ MixerStrip::select_all_processors ()
processor_box.processor_operation (ProcessorBox::ProcessorsSelectAll);
}
void
bool
MixerStrip::delete_processors ()
{
processor_box.processor_operation (ProcessorBox::ProcessorsDelete);
return processor_box.processor_operation (ProcessorBox::ProcessorsDelete);
}
void

View File

@ -126,7 +126,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
void cut_processors ();
void paste_processors ();
void select_all_processors ();
void delete_processors ();
bool delete_processors (); //note: returns false if nothing was deleted
void toggle_processors ();
void ab_plugins ();

View File

@ -1912,8 +1912,7 @@ Mixer_UI::set_route_targets_for_operation ()
return;
}
/* nothing selected ... try to get mixer strip at mouse */
/* removed "implicit" selections of strips and plugins, after discussion on IRC
int x, y;
get_pointer (x, y);
@ -1922,6 +1921,8 @@ Mixer_UI::set_route_targets_for_operation ()
if (ms) {
_route_targets.insert (ms);
}
*/
}
void

View File

@ -1195,14 +1195,18 @@ ProcessorBox::leave_notify (GdkEventCrossing*)
return false;
}
void
bool
ProcessorBox::processor_operation (ProcessorOperation op)
{
ProcSelection targets;
get_selected_processors (targets);
if (targets.empty()) {
if ((op == ProcessorsDelete) && targets.empty())
return false; //special case: editor-mixer needs to know that nothing got deleted; the user probably meant to delete something in the editor
/* removed "implicit" selections of strips and plugins, after discussion on IRC
if (targets.empty()) {
int x, y;
processor_display.get_pointer (x, y);
@ -1213,6 +1217,7 @@ ProcessorBox::processor_operation (ProcessorOperation op)
targets.push_back (pointer.first->processor ());
}
}
*/
switch (op) {
case ProcessorsSelectAll:
@ -1256,6 +1261,8 @@ ProcessorBox::processor_operation (ProcessorOperation op)
default:
break;
}
return true;
}
ProcessorWindowProxy*

View File

@ -280,7 +280,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
void set_route (boost::shared_ptr<ARDOUR::Route>);
void set_width (Width);
void processor_operation (ProcessorOperation);
bool processor_operation (ProcessorOperation);
void select_all_processors ();
void deselect_all_processors ();