From: Dan Breslau Date: Wed, 26 Oct 2016 00:18:58 +0000 (-0400) Subject: Use get_button_for_response() to get the YES button X-Git-Tag: v0.9.6~2 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot-ui.git;a=commitdiff_plain;h=5649705f860f0c810cbb8fb0a04db815a568727e Use get_button_for_response() to get the YES button --- diff --git a/src/moonshot-warning-dialog.vala b/src/moonshot-warning-dialog.vala index 43f7aa3..ad147bd 100644 --- a/src/moonshot-warning-dialog.vala +++ b/src/moonshot-warning-dialog.vala @@ -75,12 +75,7 @@ class WarningDialog remember_checkbutton.set_receives_default(false); Container action_area = (Container) dialog.get_action_area(); - // This is awful, because it assumes the Yes button is first in the - // children (and for that matter, it assumes there are no intermediate - // containers.) But searching for "Yes" in the widget text would - // cause localization problems. - // TODO: Rewrite to use Dialog instead of MessageDialog? - var yes_button = action_area.get_children().first().data; + Button yes_button = (Button) dialog.get_widget_for_response(ResponseType.YES); yes_button.grab_default(); yes_button.grab_focus();