Commits

Erik Grinaker committed c8f7da6

hide any open dialogs when locking the file

Comments (0)

Files changed (4)

 	* workaround for gnome-python bug causing crashes on 64-bit
 	systems when changing a preference
 
+	* hide any open dialogs when locking the file
+
 2005-03-17  Erik Grinaker <erikg@codepoet.no>
 
 	* fix potential crash on quit with some pygtk versions
 - prefs, password generator and search dialogs are no longer modal
 - display non-ascii characters in filenames correctly
 - use fallback folder icons when not found in theme
+- hide any open dialogs when locking the file
 - update icons on theme change
 - left-align labels in link-buttons (for URLs etc)
 
   - use gtk.Window.get_focus()
 - bugfix: gnome.libgnome_module_info_get() removed in new gnome-python
 - examine drag/drop undo/redo crashes
-- bugfix: hide any open dialogs when locking file (for autolock)
 
 0.5.x:
 - ensure complete UTF-8 support

src/revelation.in

 		if password is None:
 			return
 
+		# TODO can this be done more elegantly?
+		transients = [ window for window in gtk.window_list_toplevels() if window.get_transient_for() == self ]
+
 		# store current state
 		activeiter = self.tree.get_active()
 		oldtitle = self.get_title()
 
-		# lock the file
+		# clear application contents
 		self.tree.set_model(None)
 		self.entryview.clear()
 		self.set_title("[Locked]")
 		self.statusbar.set_status("File locked")
 
+		# hide any dialogs
+		for window in transients:
+			window.hide()
+
+		# lock file
 		dialog.PasswordLock(self, password).run()
 
 		# unlock the file and restore state
 		self.set_title(oldtitle)
 		self.statusbar.set_status("File unlocked")
 
+		for window in transients:
+			window.show()
+
 
 	def file_new(self):
 		"Opens a new file"