changeset 5021a4d523dd in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: gtk3 details:http://hg.gajim.org/gajim?cmd=changeset;node=5021a4d523dd description: better way to handle close button in about dialog
diffstat:
src/dialogs.py | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
diffs (22 lines):
diff -r a84d677931e3 -r 5021a4d523dd src/dialogs.py --- a/src/dialogs.py Sun Mar 23 11:37:17 2014 +0100 +++ b/src/dialogs.py Sun Mar 23 16:24:59 2014 +0100 @@ -1344,12 +1344,14 @@ artists_text = a_file.read() artists = artists_text.split('\n') dlg.set_artists(artists) - # connect close button to destroy() function - for button in dlg.action_area.get_children(): - if button.get_property('label') == "_Close": - button.connect('clicked', lambda x:dlg.destroy()) + + dlg.connect('response', self.on_response) dlg.show_all()
+ def on_response(self, dialog, response_id): + if response_id == Gtk.ResponseType.CANCEL: + dialog.destroy() + def tuple2str(self, tuple_): str_ = '' for num in tuple_: