GUI Updates for plugin save/delete operations
authorRobin Gareus <robin@gareus.org>
Sun, 2 Dec 2018 00:38:14 +0000 (01:38 +0100)
committerRobin Gareus <robin@gareus.org>
Sun, 2 Dec 2018 00:38:14 +0000 (01:38 +0100)
gtk2_ardour/au_pluginui.mm
gtk2_ardour/plugin_ui.cc

index 00bbcbda1bc5f61ec7ce6a0b99792648617941bd..1a80837acfa2e117703fe69051df2d182a4beb3a 100644 (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_combo, 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);
-#endif
+       smaller_hbox->pack_start (delete_button, false, false);
+
 #if 0
        /* one day these might be useful with an AU plugin, but not yet */
        smaller_hbox->pack_start (automation_mode_label, false, false);
index cb00cff41ef79133a1e1babeccaa827d6b3a4441..8b0ce54dbc25569a7e598c518b0482f4c7220672 100644 (file)
@@ -888,17 +888,17 @@ PlugUIBase::update_preset ()
        }
        --_no_load_preset;
 
-       save_button.set_sensitive (!p.uri.empty() && p.user);
        delete_button.set_sensitive (!p.uri.empty() && p.user);
-
        update_preset_modified ();
 }
 
 void
 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 ("");
                return;
        }
@@ -907,6 +907,7 @@ PlugUIBase::update_preset_modified ()
        if (_preset_modified.get_text().empty() == c) {
                _preset_modified.set_text (c ? "*" : "");
        }
+       save_button.set_sensitive (c && p.user);
 }
 
 void