hotfix for flying percussive hits while dragging.
[ardour.git] / gtk2_ardour / new_plugin_preset_dialog.cc
index 7002d5d24096ebfaec421bee56a6705893925b9c..70926f5a378ff051f2a3b944e9ac0d6cfd4652fd 100644 (file)
 
 #include <gtkmm/stock.h>
 #include "new_plugin_preset_dialog.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace Gtk;
 
-NewPluginPresetDialog::NewPluginPresetDialog (boost::shared_ptr<ARDOUR::Plugin> p)
-       : ArdourDialog (_("New Preset"))
+NewPluginPresetDialog::NewPluginPresetDialog (boost::shared_ptr<ARDOUR::Plugin> p, std::string title, bool favorite_btn)
+       : ArdourDialog (title)
        , _replace (_("Replace existing preset with this name"))
 {
        HBox* h = manage (new HBox);
@@ -39,7 +40,13 @@ NewPluginPresetDialog::NewPluginPresetDialog (boost::shared_ptr<ARDOUR::Plugin>
        get_vbox()->pack_start (_replace);
 
        add_button (Stock::CANCEL, RESPONSE_CANCEL);
+       if (favorite_btn) {
+               add_button (_("New Favorite Only"), RESPONSE_NO);
+       }
        _add = add_button (Stock::ADD, RESPONSE_ACCEPT);
+       set_default_response (RESPONSE_ACCEPT);
+       _name.set_activates_default(true);
+
 
        show_all ();
 
@@ -59,7 +66,7 @@ NewPluginPresetDialog::setup_sensitivity ()
                _add->set_sensitive (false);
                return;
        }
-               
+
        vector<ARDOUR::Plugin::PresetRecord>::const_iterator i = _presets.begin ();
        while (i != _presets.end() && i->label != _name.get_text()) {
                ++i;