Commits

Erik Grinaker committed 9e1db93

fixed a dnd bug

Comments (0)

Files changed (4)

 Revelation changelog
 
----------------[ xxxx-xx-xx : 0.4.0 ]---------------
+---------------[ 2005-01-24: 0.4.0-pre1 ]---------------
 
 2005-01-24  Erik Grinaker <erikg@codepoet.no>
 
 
 	* fixed a couple of io unit tests
 
+	* fixed a treeview drag/drop bug
+
 2005-01-08  Erik Grinaker <erikg@codepoet.no>
 
 	* wrote more ui module unit tests (yawn)
-xxxx-xx-xx: Revelation 0.4.0
-============================
+2005-01-24: Revelation 0.4.0-pre1
+=================================
 
 New features:
 - port to gtk+ 2.4 (new file dialog, combobox etc)
 dnl initialize autoconf/automake
 AC_PREREQ(2.53)
 AC_INIT(src/revelation.in)
-AM_INIT_AUTOMAKE(revelation, 0.4.0)
+AM_INIT_AUTOMAKE(revelation, 0.4.0-pre1)
 
 
 dnl some macros
 			destpath, pos = destrow
 
 		destiter = self.entrystore.get_iter(destpath)
+		destpath = self.entrystore.get_path(destiter)
 
-		# avoid drop to descendants
+		# avoid drops to current iter or descentants
 		for sourceiter in sourceiters:
-			if self.entrystore.is_ancestor(sourceiter, destiter) == True or self.entrystore.get_path(sourceiter) == self.entrystore.get_path(destiter):
+			sourcepath = self.entrystore.get_path(sourceiter)
+
+			if self.entrystore.is_ancestor(sourceiter, destiter) == True or sourcepath == destpath:
 				context.finish(False, False, time)
 				return
 
+			elif pos in ( gtk.TREE_VIEW_DROP_INTO_OR_BEFORE, gtk.TREE_VIEW_DROP_BEFORE ) and sourcepath[:-1] == destpath[:-1] and sourcepath[-1] == destpath[-1] - 1:
+				context.finish(False, False, time)
+				return
+
+			elif pos in ( gtk.TREE_VIEW_DROP_INTO_OR_AFTER, gtk.TREE_VIEW_DROP_AFTER ) and sourcepath[:-1] == destpath[:-1] and sourcepath[-1] == destpath[-1] + 1:
+				context.finish(False, False, time)
+				return
+
+
 		# move the entries
 		if pos in ( gtk.TREE_VIEW_DROP_INTO_OR_BEFORE, gtk.TREE_VIEW_DROP_INTO_OR_AFTER):
 			parent = destiter