From 0b6f0212952e0503bd5f97a27f62bbcdb20041a6 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 21 Feb 2006 11:21:58 +0000 Subject: [PATCH] don't give focus to buttons in HIGdialogs. fixes #1412 --- src/dialogs.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index 7a4a4b6a0..f5d22a303 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -521,6 +521,10 @@ class HigDialog(gtk.MessageDialog): self.format_secondary_text(sectext) def get_response(self): + # Give focus to top vbox + vb = self.get_children()[0].get_children()[0] + vb.set_flags(gtk.CAN_FOCUS) + vb.grab_focus() self.show_all() response = self.run() self.destroy() @@ -531,12 +535,7 @@ class ConfirmationDialog(HigDialog): def __init__(self, pritext, sectext=''): HigDialog.__init__(self, None, gtk.MESSAGE_QUESTION, gtk.BUTTONS_OK_CANCEL, pritext, sectext) - - self.set_default_response(gtk.RESPONSE_OK) - - ok_button = self.action_area.get_children()[0] # right to left - ok_button.grab_focus() - + class WarningDialog(HigDialog): def __init__(self, pritext, sectext=''): '''HIG compliant warning dialog.''' @@ -561,7 +560,6 @@ class ErrorDialog(HigDialog): HigDialog.__init__( self, None, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, pritext, sectext) - class YesNoDialog(HigDialog): def __init__(self, pritext, sectext=''): '''HIG compliant YesNo dialog.''' @@ -575,13 +573,13 @@ class ConfirmationDialogCheck(ConfirmationDialog): pritext, sectext) self.set_default_response(gtk.RESPONSE_OK) - + ok_button = self.action_area.get_children()[0] # right to left ok_button.grab_focus() - + self.checkbutton = gtk.CheckButton(checktext) self.vbox.pack_start(self.checkbutton, expand = False, fill = True) - + def is_checked(self): ''' Get active state of the checkbutton ''' return self.checkbutton.get_active()