From 5bdd6affddc1f2bd61cff14a6b424ac5fb853079 Mon Sep 17 00:00:00 2001 From: Neroth Date: Wed, 25 Jan 2012 21:58:41 +0100 Subject: [PATCH] Add default in modal dialogs --- src/weather-settings.js.in | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/weather-settings.js.in b/src/weather-settings.js.in index 50f8ccf..4e3002e 100644 --- a/src/weather-settings.js.in +++ b/src/weather-settings.js.in @@ -75,7 +75,12 @@ WeatherSetting.prototype = dialog.set_transient_for(this.Window.get_object("main-window")); dialog.add_button(Gtk.STOCK_CANCEL, 0); - dialog.add_button(Gtk.STOCK_OK, 1); + var d = dialog.add_button(Gtk.STOCK_YES, 1); + + d.set_can_default(true); + dialog.set_default(d); + entry.activates_default = true; + var dialog_area = dialog.get_content_area(); dialog_area.pack_start(label); dialog_area.pack_start(entry); @@ -109,7 +114,11 @@ WeatherSetting.prototype = dialog.set_transient_for(this.Window.get_object("main-window")); dialog.add_button(Gtk.STOCK_NO, 0); - dialog.add_button(Gtk.STOCK_YES, 1); + var d = dialog.add_button(Gtk.STOCK_YES, 1); + + d.set_can_default(true); + dialog.set_default(d); + var dialog_area = dialog.get_content_area(); dialog_area.pack_start(label); dialog.signal.response.connect(function(w, response_id)