don't give focus to buttons in HIGdialogs. fixes #1412

This commit is contained in:
Yann Leboulanger 2006-02-21 11:21:58 +00:00
parent 36fd9dc0a8
commit 0b6f021295
1 changed files with 8 additions and 10 deletions

View File

@ -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()
@ -532,11 +536,6 @@ class ConfirmationDialog(HigDialog):
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.'''