allow double click on radio buttons in ambiguous file dialog to finish dialog
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 30 Mar 2013 14:04:50 +0000 (10:04 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 30 Mar 2013 14:04:50 +0000 (10:04 -0400)
gtk2_ardour/ambiguous_file_dialog.cc
gtk2_ardour/ambiguous_file_dialog.h

index 3527ab471aaa31b250ada544ca535136d3932cb6..be4bdc2dc1a5505b53982a89d456d559cfde1c9c 100644 (file)
@@ -38,6 +38,7 @@ AmbiguousFileDialog::AmbiguousFileDialog (const string& file, const vector<strin
        for (vector<string>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
                _radio_buttons.push_back (manage (new RadioButton (_group, *i)));
                get_vbox()->pack_start (*_radio_buttons.back ());
+               _radio_buttons.back()->signal_button_press_event().connect (sigc::mem_fun (*this, &AmbiguousFileDialog::rb_button_press), false);
        }
 
        get_vbox()->pack_start (*manage (new Label (_("\n\nPlease select the path that you want to get the file from."))));
@@ -48,6 +49,15 @@ AmbiguousFileDialog::AmbiguousFileDialog (const string& file, const vector<strin
        show_all ();
 }
 
+bool
+AmbiguousFileDialog::rb_button_press (GdkEventButton* ev)
+{
+       if (ev->type == GDK_2BUTTON_PRESS) {
+               response (RESPONSE_OK);
+       }
+       return false;
+}
+
 int
 AmbiguousFileDialog::get_which () const
 {
index 796f490e799f9a42b08df0f0efd6f22a6bb01a2d..69c2ca6b76ca0eb3ba52a8fca472eb0ddb17c111 100644 (file)
@@ -30,6 +30,7 @@ public:
 private:
        Gtk::RadioButtonGroup _group;
        std::vector<Gtk::RadioButton*> _radio_buttons;
+        bool rb_button_press (GdkEventButton*);
 };