mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Allow to rename plugins (#9352)
This commit is contained in:
parent
58b98e8c5c
commit
cad949eb4e
1 changed files with 51 additions and 33 deletions
|
|
@ -2518,7 +2518,11 @@ ProcessorBox::show_processor_menu (int arg)
|
||||||
|
|
||||||
/* disallow rename for multiple selections, for plugin inserts and for the fader */
|
/* disallow rename for multiple selections, for plugin inserts and for the fader */
|
||||||
rename_action->set_sensitive (single_selection
|
rename_action->set_sensitive (single_selection
|
||||||
&& !pi
|
#ifdef MIXBUS
|
||||||
|
&& !mixbus_is_channelstrip (single_selection)
|
||||||
|
#endif
|
||||||
|
/* aux-send names are kept in sync with the target bus name */
|
||||||
|
&& !std::dynamic_pointer_cast<InternalSend> (single_selection->processor ())
|
||||||
&& !std::dynamic_pointer_cast<Amp> (single_selection->processor ())
|
&& !std::dynamic_pointer_cast<Amp> (single_selection->processor ())
|
||||||
&& !std::dynamic_pointer_cast<UnknownProcessor> (single_selection->processor ()));
|
&& !std::dynamic_pointer_cast<UnknownProcessor> (single_selection->processor ()));
|
||||||
|
|
||||||
|
|
@ -3578,21 +3582,42 @@ ProcessorBox::idle_delete_processor (std::weak_ptr<Processor> weak_processor)
|
||||||
void
|
void
|
||||||
ProcessorBox::rename_processor (std::shared_ptr<Processor> processor)
|
ProcessorBox::rename_processor (std::shared_ptr<Processor> processor)
|
||||||
{
|
{
|
||||||
|
shared_ptr<PluginInsert> pi = std::dynamic_pointer_cast<PluginInsert> (processor);
|
||||||
|
|
||||||
Prompter name_prompter (true);
|
Prompter name_prompter (true);
|
||||||
string result;
|
name_prompter.set_title (pi ? _("Rename Processor") : _("Rename Plugin"));
|
||||||
name_prompter.set_title (_("Rename Processor"));
|
|
||||||
name_prompter.set_prompt (_("New name:"));
|
name_prompter.set_prompt (_("New name:"));
|
||||||
name_prompter.set_initial_text (processor->name());
|
name_prompter.set_initial_text (processor->name());
|
||||||
name_prompter.add_button (_("Rename"), Gtk::RESPONSE_ACCEPT);
|
name_prompter.add_button (_("Rename"), Gtk::RESPONSE_ACCEPT);
|
||||||
name_prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
|
name_prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
|
||||||
name_prompter.show_all ();
|
name_prompter.show_all ();
|
||||||
|
|
||||||
switch (name_prompter.run ()) {
|
if (pi) {
|
||||||
|
name_prompter.set_default_text (pi->plugin ()->name ());
|
||||||
|
}
|
||||||
|
|
||||||
case Gtk::RESPONSE_ACCEPT:
|
if (name_prompter.run () != Gtk::RESPONSE_ACCEPT) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string result;
|
||||||
name_prompter.get_result (result);
|
name_prompter.get_result (result);
|
||||||
if (result.length() && result != processor->name ()) {
|
|
||||||
|
|
||||||
|
if (0 == result.length() || result == processor->name ()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pi) {
|
||||||
|
processor->set_name (result);
|
||||||
|
|
||||||
|
PluginUIWindow* plugin_ui = dynamic_cast<PluginUIWindow*> (get_processor_ui (pi));
|
||||||
|
if (plugin_ui) {
|
||||||
|
plugin_ui->set_title (generate_processor_title (pi));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* for sends and inserts, check if the name is legal */
|
||||||
int tries = 0;
|
int tries = 0;
|
||||||
string test = result;
|
string test = result;
|
||||||
|
|
||||||
|
|
@ -3610,15 +3635,9 @@ ProcessorBox::rename_processor (std::shared_ptr<Processor> processor)
|
||||||
processor->set_name (result);
|
processor->set_name (result);
|
||||||
} else {
|
} else {
|
||||||
/* unlikely! */
|
/* unlikely! */
|
||||||
ARDOUR_UI::instance()->popup_error
|
ARDOUR_UI::instance()->popup_error (string_compose (_("At least 100 IO objects exist with a name like %1 - name not changed"), result));
|
||||||
(string_compose (_("At least 100 IO objects exist with a name like %1 - name not changed"), result));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ProcessorBox::paste_processors ()
|
ProcessorBox::paste_processors ()
|
||||||
|
|
@ -4526,7 +4545,6 @@ ProcessorBox::manage_pins (std::shared_ptr<Processor> processor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ProcessorBox::route_property_changed (const PropertyChange& what_changed)
|
ProcessorBox::route_property_changed (const PropertyChange& what_changed)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue