From 7e81dede2fd0b54f7ffc932180334367c6c2eb3d Mon Sep 17 00:00:00 2001 From: Daniel Pavel Date: Sun, 26 May 2013 02:01:59 +0300 Subject: [PATCH] non-modal about dialog; fixes #46 --- lib/solaar/ui/about.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/solaar/ui/about.py b/lib/solaar/ui/about.py index d7628b80..9edac16f 100644 --- a/lib/solaar/ui/about.py +++ b/lib/solaar/ui/about.py @@ -47,10 +47,18 @@ def _create(): about.set_website('http://pwr.github.io/Solaar/') about.set_website_label(NAME) + about.connect('response', lambda x, y: x.hide()) + + def _hide(dialog, event): + dialog.hide() + return True + about.connect('delete-event', _hide) + return about def show_window(_): - w = _create() - w.run() - w.destroy() + global _dialog + if _dialog is None: + _dialog = _create() + _dialog.present()