additional DEBUG_TRACE output for slave/diskreader
[ardour.git] / gtk2_ardour / export_preset_selector.cc
index 3898916bc05899d767ec871c5a8accf20ad62f97..7f5fac72d5cb347f0eb266914eceace2af235b90 100644 (file)
 
 */
 
-#include "export_preset_selector.h"
+#include <gtkmm/messagedialog.h>
+#include <gtkmm/stock.h>
 
 #include "ardour/export_preset.h"
 
-#include "i18n.h"
+#include "export_preset_selector.h"
+
+#include "pbd/i18n.h"
 
 ExportPresetSelector::ExportPresetSelector () :
   label (_("Preset"), Gtk::ALIGN_LEFT),
@@ -41,11 +44,6 @@ ExportPresetSelector::ExportPresetSelector () :
        pack_start (remove_button, false, false, 6);
        pack_start (new_button, false, false, 0);
 
-       entry.set_name ("PaddedButton");
-       save_button.set_name ("PaddedButton");
-       remove_button.set_name ("PaddedButton");
-       new_button.set_name ("PaddedButton");
-
        save_button.set_sensitive (false);
        remove_button.set_sensitive (false);
        new_button.set_sensitive (false);
@@ -123,8 +121,8 @@ ExportPresetSelector::update_selection ()
                }
        }
 
-       save_button.set_sensitive (current);
-       remove_button.set_sensitive (current);
+       save_button.set_sensitive (current != 0);
+       remove_button.set_sensitive (current != 0);
        new_button.set_sensitive (!current && !text.empty() && !preset_name_exists);
 }
 
@@ -153,6 +151,18 @@ ExportPresetSelector::remove_current ()
 {
        if (!profile_manager) { return; }
 
+       Gtk::MessageDialog dialog (_("Do you really want to remove this preset?"),
+                       false,
+                       Gtk::MESSAGE_QUESTION,
+                       Gtk::BUTTONS_YES_NO);
+
+       if (Gtk::RESPONSE_YES != dialog.run ()) {
+               /* User has selected "no" or closed the dialog, better
+                * abort
+                */
+               return;
+       }
+
        profile_manager->remove_preset();
        entry.get_entry()->set_text ("");
        sync_with_manager ();