changeset 14:83f99008a3f9

Insert anonym tasks into project tree when give them a name.
author Sascha L. Teichmann <teichmann@intevation.de>
date Tue, 12 Aug 2008 15:01:11 +0200 (2008-08-12)
parents e347f0de5e22
children 0bb0100b2c8d
files ChangeLog getan
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Aug 12 10:14:59 2008 +0200
+++ b/ChangeLog	Tue Aug 12 15:01:11 2008 +0200
@@ -1,3 +1,8 @@
+2008-08-12	Sascha L. Teichmann <sascha.teichmann@intevation.de>
+
+	* getan: When assiging a name to an anonym task remove and 
+	  re-insert it into the project tree to make it selectable.
+
 2008-08-12	Sascha L. Teichmann <sascha.teichmann@intevation.de>
 
 	* contrib/zeiterfassung: Applied Stephan Holl's week-option.patch which
--- a/getan	Tue Aug 12 10:14:59 2008 +0200
+++ b/getan	Tue Aug 12 15:01:11 2008 +0200
@@ -308,6 +308,20 @@
                 return
         self.children.append(build_tree(project, depth))
 
+    def removeProject(self, project):
+
+        if self.isLeaf(): return
+        stack = [self]
+        while stack:
+            parent = stack.pop()
+            for child in parent.children:
+                if not child.isLeaf():
+                    stack.append(child)
+                    continue
+                if child.project == project:
+                    parent.children.remove(child)
+                    return
+
     def isLeaf(self):
         return not self.project is None
 
@@ -391,6 +405,8 @@
                 project.rename(cur, key, description)
             finally:
                 tolerantClose(cur)
+            self.tree.removeProject(project)
+            self.tree.insertProject(project)
                     
     def assignLogs(self, num, key):
         anon = self.findAnonymProject(num)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)