Commits

Erik Grinaker committed 693fe3e

fix potential crash on quit with some pygtk versions

Comments (0)

Files changed (4)

 
 	* make password warnings handle escape as cancel
 
+	* fix potential crash on quit with some pygtk versions
+
 2005-02-09  Erik Grinaker <erikg@codepoet.no>
 
 	* make undo actually for for edit actions
 - make undo actually work for edit actions
 - don't crash when redoing an undone edit action
 - don't crash when unable to save file (wrong permissions etc)
+- fix potential crash on quit with some pygtk versions
 - workaround for gnome-python 2.9.x crasher bug in the session client
 - properly handle invalid data in data files
 - prefs, password generator and search dialogs are no longer modal
 - display non-ascii characters in filenames correctly
 
 
+
 2005-02-08: Revelation 0.4.0
 ============================
 
 - gnome panel applets (account lookup, password generator etc)
   - show complete account tree as a popup-submenu of the applet
 - check all dialog buttons, and use better stock items where useful
-- run unit tests on built libraries instead of installed ones
+e run unit tests on built libraries instead of installed ones
 - why does it ask for password when attempting to import gpasman?
 - only copy/paste entries with keyboard shortcut when tree has focus
   (ctrl-c should copy selected label in dataview when focused)
 - bugfix: crash when gnome icon theme is missing or not configured
 - option to edit instead of run on doubleclick
 - revisit the copy chain etc ui
-- bugfix: don't use lambda for delete_event (may crash on quit)
 - bugfix: gnome.libgnome_module_info_get() removed in new gnome-python
 - clean up the build-system
 
 		authmanager.gnome_authentication_manager_init()
 		ui.App.__init__(self, config.APPNAME)
 
-		self.connect("delete-event", lambda w,d: True ^ self.quit())
+		self.connect("delete-event", self.__cb_quit)
 
 		try:
 			self.__init_facilities()
 			"entry-goto"		: lambda w: self.entry_goto(self.tree.get_selected()),
 			"entry-remove"		: lambda w: self.entry_remove(self.tree.get_selected()),
 			"file-change-password"	: lambda w: self.file_change_password(),
-			"file-close"		: lambda w: self.quit(),
+			"file-close"		: self.__cb_quit,
 			"file-export"		: lambda w: self.file_export(),
 			"file-import"		: lambda w: self.file_import(),
 			"file-lock"		: lambda w: self.file_lock(),
 			"help-homepage"		: lambda w: gnome.url_show(config.URL),
 			"prefs"			: lambda w: dialog.Preferences(self, self.config).run(),
 			"pwgenerator"		: lambda w: dialog.PasswordGenerator(self, self.config).run(),
-			"quit"			: lambda w: self.quit(),
+			"quit"			: self.__cb_quit,
 			"redo"			: lambda w: self.redo(),
 			"select-all"		: lambda w: self.tree.select_all(),
 			"select-none"		: lambda w: self.tree.unselect_all(),
 			self.locktimer.start(self.config.get("file/autolock_timeout") * 60)
 
 
+	def __cb_quit(self, widget, data = None):
+		"Callback for quit"
+
+		if self.quit() == False:
+			return True
+
+		else:
+			return False
+
+
 	def __cb_session_save(self, widget, phase, what, end, interaction, fast, data = None):
 		"Handles session saves"
 
 
 			gtk.main_quit()
 			sys.exit(0)
+			return True
 
 		except dialog.CancelError:
 			self.statusbar.set_status("Quit cancelled")