13
0

allow double click on radio buttons in ambiguous file dialog to finish dialog

This commit is contained in:
Paul Davis 2013-03-30 10:04:50 -04:00
parent 0a05c08a1a
commit 91a2798001
2 changed files with 11 additions and 0 deletions

View 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
{

View File

@ -30,6 +30,7 @@ public:
private:
Gtk::RadioButtonGroup _group;
std::vector<Gtk::RadioButton*> _radio_buttons;
bool rb_button_press (GdkEventButton*);
};