# HG changeset patch # User Erik Grinaker # Date 1111422235 0 # Node ID 3ad5dfd18b53559b9e021a126ace994f211559e5 # Parent 3774754e1ed095ad13d7e8114141959a455fd58a don't crash when closing non-modal dialogs with escape diff -r 3774754e1ed095ad13d7e8114141959a455fd58a -r 3ad5dfd18b53559b9e021a126ace994f211559e5 ChangeLog --- a/ChangeLog Sat Mar 19 00:29:52 2005 +0000 +++ b/ChangeLog Mon Mar 21 16:23:55 2005 +0000 @@ -2,6 +2,10 @@ ---------------[ xxxx-xx-xx : 0.4.1 ]--------------- +2005-03-21 Erik Grinaker + + * don't crash when closing non-modal dialog with escape + 2005-03-18 Erik Grinaker * left-align labels in link-buttons (for URLs etc) diff -r 3774754e1ed095ad13d7e8114141959a455fd58a -r 3ad5dfd18b53559b9e021a126ace994f211559e5 TODO --- a/TODO Sat Mar 19 00:29:52 2005 +0000 +++ b/TODO Mon Mar 21 16:23:55 2005 +0000 @@ -12,8 +12,6 @@ - only copy/paste entries with keyboard shortcut when tree has focus (ctrl-c should copy selected label in dataview when focused) - use gtk.Window.get_focus() -- examine drag/drop undo/redo crashes -- examine crash when closing prefs/pwchecker with escape 0.5.x: - ensure complete UTF-8 support diff -r 3774754e1ed095ad13d7e8114141959a455fd58a -r 3ad5dfd18b53559b9e021a126ace994f211559e5 src/lib/dialog.py --- a/src/lib/dialog.py Sat Mar 19 00:29:52 2005 +0000 +++ b/src/lib/dialog.py Mon Mar 21 16:23:55 2005 +0000 @@ -52,12 +52,13 @@ def __init__(self, parent, title, buttons = (), default = None): gtk.Dialog.__init__( self, title, parent, - gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL | gtk.DIALOG_NO_SEPARATOR + gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_NO_SEPARATOR ) self.set_border_width(6) self.vbox.set_spacing(12) self.set_resizable(False) + self.set_modal(True) self.connect("key_press_event", self.__cb_keypress) @@ -1067,7 +1068,7 @@ def __init__(self, parent): Utility.__init__( - self, parent, "Password Generator", + self, parent, "Password Checker", ( ( gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE ), ( ui.STOCK_PASSWORD_CHECK, gtk.RESPONSE_OK ) ) ) @@ -1130,6 +1131,10 @@ if EVENT_FILTER != None: self.window.add_filter(EVENT_FILTER) + # for some reason, gtk crashes on close-by-escape if we don't do this + self.get_button(0).grab_focus() + self.entry.grab_focus() + class PasswordGenerator(Utility): @@ -1376,3 +1381,7 @@ if EVENT_FILTER != None: self.window.add_filter(EVENT_FILTER) + # for some reason, gtk crashes on close-by-escape if we don't do this + self.get_button(0).grab_focus() + self.notebook.grab_focus() +