mirror of
https://github.com/gryf/wicd.git
synced 2026-01-08 06:44:20 +01:00
Fix non-blocking error dialog.
This commit is contained in:
@@ -89,12 +89,14 @@ def handle_no_dbus(from_tray=False):
|
|||||||
|
|
||||||
def error(parent, message, block=True):
|
def error(parent, message, block=True):
|
||||||
""" Shows an error dialog """
|
""" Shows an error dialog """
|
||||||
|
def delete_event(dialog, id):
|
||||||
|
dialog.destroy()
|
||||||
dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR,
|
dialog = gtk.MessageDialog(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR,
|
||||||
gtk.BUTTONS_OK)
|
gtk.BUTTONS_OK)
|
||||||
dialog.set_markup(message)
|
dialog.set_markup(message)
|
||||||
if not block:
|
if not block:
|
||||||
dialog.present()
|
dialog.present()
|
||||||
dialog.connect("response", lambda *args: dialog.destroy())
|
dialog.connect("response", delete_event)
|
||||||
else:
|
else:
|
||||||
dialog.run()
|
dialog.run()
|
||||||
dialog.destroy()
|
dialog.destroy()
|
||||||
|
|||||||
Reference in New Issue
Block a user