Add OK/Cancel buttons to quantize dialog.
authorDavid Robillard <d@drobilla.net>
Tue, 27 Oct 2009 02:36:42 +0000 (02:36 +0000)
committerDavid Robillard <d@drobilla.net>
Tue, 27 Oct 2009 02:36:42 +0000 (02:36 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@5939 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_ops.cc
gtk2_ardour/quantize_dialog.cc

index a128ed6cf23fa8333d4b6fa6926e438e64182aac..9de3d0138fdf87bbdb8c5e6e8cf1965dfd5c6f35 100644 (file)
@@ -4848,15 +4848,17 @@ Editor::quantize_region ()
        QuantizeDialog* qd = new QuantizeDialog (*this);
 
        qd->present ();
-       qd->run ();
+       const int r = qd->run ();
        qd->hide ();
 
-       Quantize quant (*session, Plain,
-                       qd->snap_start(), qd->snap_end(),
-                       qd->start_grid_size(), qd->end_grid_size(),
-                       qd->strength(), qd->swing(), qd->threshold());
+       if (r == Gtk::RESPONSE_OK) {
+               Quantize quant (*session, Plain,
+                               qd->snap_start(), qd->snap_end(),
+                               qd->start_grid_size(), qd->end_grid_size(),
+                               qd->strength(), qd->swing(), qd->threshold());
 
-       apply_midi_note_edit_op (quant);
+               apply_midi_note_edit_op (quant);
+       }
 }
 
 void
index 5ed867c4c30e27864affeaad189f2faad9dc4fce..f8a6d3a516861680775722303837fc17eb74d189 100644 (file)
@@ -17,6 +17,7 @@
 
 */
 
+#include <gtkmm/stock.h>
 #include "gtkmm2ext/utils.h"
 
 #include "quantize_dialog.h"
@@ -147,6 +148,9 @@ QuantizeDialog::QuantizeDialog (PublicEditor& e)
 
        snap_start_button.set_active (true);
        snap_end_button.set_active (false);
+
+       add_button (Stock::CANCEL, RESPONSE_CANCEL);
+       add_button (Stock::OK, RESPONSE_OK);
 }
 
 QuantizeDialog::~QuantizeDialog()