1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Fix an About dialog–related crash.

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.
This commit is contained in:
david
2012-12-11 03:03:17 +00:00
parent 87c2b0438a
commit e4c94bf4ff
2 changed files with 12 additions and 1 deletions

View File

@@ -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):