GUI Updates for plugin save/delete operations

This commit is contained in:
Robin Gareus 2018-12-02 01:38:14 +01:00
parent ae4604a24b
commit c8d08338df
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 6 additions and 8 deletions

View file

@ -409,12 +409,9 @@ AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
smaller_hbox->pack_start (_preset_modified, false, false); smaller_hbox->pack_start (_preset_modified, false, false);
smaller_hbox->pack_start (_preset_combo, false, false); smaller_hbox->pack_start (_preset_combo, false, false);
smaller_hbox->pack_start (add_button, false, false); smaller_hbox->pack_start (add_button, false, false);
#if 0
/* Ardour does not currently allow to overwrite existing presets
* see save_property_list() in audio_unit.cc
*/
smaller_hbox->pack_start (save_button, false, false); smaller_hbox->pack_start (save_button, false, false);
#endif smaller_hbox->pack_start (delete_button, false, false);
#if 0 #if 0
/* one day these might be useful with an AU plugin, but not yet */ /* one day these might be useful with an AU plugin, but not yet */
smaller_hbox->pack_start (automation_mode_label, false, false); smaller_hbox->pack_start (automation_mode_label, false, false);

View file

@ -888,17 +888,17 @@ PlugUIBase::update_preset ()
} }
--_no_load_preset; --_no_load_preset;
save_button.set_sensitive (!p.uri.empty() && p.user);
delete_button.set_sensitive (!p.uri.empty() && p.user); delete_button.set_sensitive (!p.uri.empty() && p.user);
update_preset_modified (); update_preset_modified ();
} }
void void
PlugUIBase::update_preset_modified () PlugUIBase::update_preset_modified ()
{ {
Plugin::PresetRecord p = plugin->last_preset();
if (plugin->last_preset().uri.empty()) { if (p.uri.empty()) {
save_button.set_sensitive (false);
_preset_modified.set_text (""); _preset_modified.set_text ("");
return; return;
} }
@ -907,6 +907,7 @@ PlugUIBase::update_preset_modified ()
if (_preset_modified.get_text().empty() == c) { if (_preset_modified.get_text().empty() == c) {
_preset_modified.set_text (c ? "*" : ""); _preset_modified.set_text (c ? "*" : "");
} }
save_button.set_sensitive (c && p.user);
} }
void void