From e4c94bf4ffedb5345f7a33fab4604921ae5cf488 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 11 Dec 2012 03:03:17 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20an=20About=20dialog=E2=80=93related=20cra?= =?UTF-8?q?sh.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the dialog is closed by the user clicking the X, rather than a button in the dialog, the dialog doesn't exist anymore, so we can't simply hide and later re-present it. --- CHANGELOG | 5 +++++ zenmap/zenmapGUI/MainWindow.py | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 4e7817d9a..c0740089a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ # Nmap Changelog ($Id$); -*-text-*- +o [Zenmap] Fixed a crash that could be caused by opening the About + dialog, using the window manager to close it, and opening it again. + This was reported by Yashartha Chaturvedi and Jordan Schroeder. + [David Fifield] + o [Ncat] Made test-addrset.sh exit with nonzero status if any tests fail. This in turn causes "make check" to fail if any tests fail. [Andreas Stieger] diff --git a/zenmap/zenmapGUI/MainWindow.py b/zenmap/zenmapGUI/MainWindow.py index a1df8ec66..0e5dbd648 100644 --- a/zenmap/zenmapGUI/MainWindow.py +++ b/zenmap/zenmapGUI/MainWindow.py @@ -665,10 +665,16 @@ This scan has not been run yet. Start the scan with the "Scan" button first.')) self._save_all(self.scan_interface, dir_chooser.get_filename()) dir_chooser.destroy() + def _about_cb_response(self, dialog, response_id): + if response_id == gtk.RESPONSE_DELETE_EVENT: + self._about_dialog = None + else: + self._about_dialog.hide() + def _show_about_cb(self, widget): if self._about_dialog is None: self._about_dialog = About() - self._about_dialog.connect("response", lambda dialog, response: dialog.hide()) + self._about_dialog.connect("response", self._about_cb_response) self._about_dialog.present() def _save_all(self, scan_interface, directory):