Prompt the user for confirmation before removing an export preset
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>
Wed, 19 Jun 2013 17:05:46 +0000 (19:05 +0200)
committerAdrian Knoth <adi@drcomp.erfurt.thur.de>
Wed, 19 Jun 2013 17:05:46 +0000 (19:05 +0200)
Requested by Radio SRB (http://srb.fm)

gtk2_ardour/export_preset_selector.cc

index 3898916bc05899d767ec871c5a8accf20ad62f97..9f699bbb800bc0587395a1e53e126a958f67c01c 100644 (file)
@@ -153,6 +153,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 ();