1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-03 20:34:17 +01:00

Fix non-blocking error dialog.

This commit is contained in:
Dan O'Reilly
2008-12-16 01:30:46 -05:00
parent 556c40ad75
commit 69d2cd2d77

View File

@@ -89,12 +89,14 @@ def handle_no_dbus(from_tray=False):
def error(parent, message, block=True):
""" Shows an error dialog """
def delete_event(dialog, id):
dialog.destroy()
dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR,
gtk.BUTTONS_OK)
dialog.set_markup(message)
if not block:
dialog.present()
dialog.connect("response", lambda *args: dialog.destroy())
dialog.connect("response", delete_event)
else:
dialog.run()
dialog.destroy()