From c31e8e9d41259027b4101ddeca2b7501131a9388 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Sat, 30 Jul 2005 00:27:58 +0000 Subject: [PATCH] ok button is focused by default --- src/dialogs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index 20f4248d2..e5e3ca202 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -484,11 +484,12 @@ class ConfirmationDialogCheck(ConfirmationDialog): '''HIG compliant confirmation dialog with checkbutton.''' def __init__(self, pritext, sectext='', checktext = ''): HigDialog.__init__(self, None, pritext, sectext, - gtk.STOCK_DIALOG_WARNING, [ [gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL], - [ gtk.STOCK_OK, gtk.RESPONSE_OK ] ]) + gtk.STOCK_DIALOG_WARNING, [ [gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL] ]) + # add ok button manually, because we need to focus on it + ok_button = self.add_button (gtk.STOCK_OK, gtk.RESPONSE_OK) self.checkbutton = gtk.CheckButton(checktext) self.vbox.pack_start(self.checkbutton, expand=False, fill=True) - + ok_button.grab_focus() # override this method not to destroy the dialog def get_response(self): self.show_all()