mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 03:36:32 +01:00
don't allow to delete factory presets
This commit is contained in:
parent
3718b4109b
commit
ce7d18bc16
1 changed files with 11 additions and 0 deletions
|
|
@ -120,6 +120,12 @@ Plugin::~Plugin ()
|
|||
void
|
||||
Plugin::remove_preset (string name)
|
||||
{
|
||||
Plugin::PresetRecord const * p = preset_by_label (name);
|
||||
if (!p->user) {
|
||||
PBD::error << _("Cannot remove plugin factory preset.") << PBD::endmsg;
|
||||
return;
|
||||
}
|
||||
|
||||
do_remove_preset (name);
|
||||
_presets.erase (preset_by_label (name)->uri);
|
||||
|
||||
|
|
@ -133,6 +139,11 @@ Plugin::remove_preset (string name)
|
|||
Plugin::PresetRecord
|
||||
Plugin::save_preset (string name)
|
||||
{
|
||||
if (preset_by_label (name)) {
|
||||
PBD::error << _("Preset with given name already exists.") << PBD::endmsg;
|
||||
return Plugin::PresetRecord ();
|
||||
}
|
||||
|
||||
string const uri = do_save_preset (name);
|
||||
|
||||
if (!uri.empty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue