Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/MMapArea.py
diff options
context:
space:
mode:
authormatthias.vogelgesang <matthias.vogelgesang@8f060a39-251c-0410-b1f3-431655927647>2008-04-06 15:51:08 (GMT)
committer matthias.vogelgesang <matthias.vogelgesang@8f060a39-251c-0410-b1f3-431655927647>2008-04-06 15:51:08 (GMT)
commitc3b5d2663aef364d4f1256e125c72f28d7ddd750 (patch)
tree837cb91d8c9ca1d847df0ce086da843657683a7d /src/MMapArea.py
parent503e2a1f8deb8eeff2de84222f658baafbd053ec (diff)
* src/MMapArea.py
Fix bug and update model on thought deletion. git-svn-id: http://labyrinth.googlecode.com/svn/trunk@303 8f060a39-251c-0410-b1f3-431655927647
Diffstat (limited to 'src/MMapArea.py')
-rw-r--r--src/MMapArea.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/MMapArea.py b/src/MMapArea.py
index c463e2e..6952338 100644
--- a/src/MMapArea.py
+++ b/src/MMapArea.py
@@ -692,7 +692,7 @@ class MMapArea (gtk.DrawingArea):
self.editing.finish_editing ()
self.editing = None
if thought.model_iter:
- self.tree_model.set_value(thought.model_iter, 0, thought.text)
+ self.tree_model.set_value (thought.model_iter, 0, thought.text)
else:
self.add_thought_to_model (thought)
@@ -853,6 +853,7 @@ class MMapArea (gtk.DrawingArea):
def delete_thought (self, thought):
action = UndoManager.UndoAction (self, UNDO_DELETE_SINGLE, self.undo_deletion, [thought])
+ self.tree_model.remove(thought.model_iter)
if thought.element in self.element.childNodes:
self.element.removeChild (thought.element)
self.thoughts.remove (thought)
@@ -883,13 +884,14 @@ class MMapArea (gtk.DrawingArea):
self.undo.block ()
if mode == UndoManager.UNDO:
self.unselect_all ()
+ for l in action.args[1:]:
+ self.links.append (l)
+ self.element.appendChild (l.element)
for t in action.args[0]:
self.thoughts.append (t)
self.select_thought (t, -1)
self.element.appendChild (t.element)
- for l in action.args[1:]:
- self.links.append (l)
- self.element.appendChild (l.element)
+ self.add_thought_to_model (t)
if action.undo_type == UNDO_DELETE_SINGLE:
self.begin_editing (action.args[0][0])
self.emit ("change_buffer", action.args[0][0].extended_buffer)
@@ -1062,7 +1064,7 @@ class MMapArea (gtk.DrawingArea):
thought.model_iter = self.tree_model.insert_after(row.iter, None, [thought.text])
else:
for r in row.iterchildren():
- self.recursively_add_thought_to_model(parent, text, r)
+ self.recursively_add_thought_to_model(parent, thought, r)
def add_thought_to_model(self, thought):
for l in self.links:
@@ -1075,8 +1077,8 @@ class MMapArea (gtk.DrawingArea):
def recursively_add_thoughts(self, parent, it):
for l in self.links:
if l.parent == parent and l.child != None:
- it2 = self.tree_model.insert_after(it, None, [l.child.text])
- self.recursively_add_thoughts(l.child, it2)
+ l.child.model_iter = self.tree_model.insert_after(it, None, [l.child.text])
+ self.recursively_add_thoughts(l.child, l.child.model_iter)
def initialize_model(self, model):
self.tree_model = model