# HG changeset patch # User Sascha L. Teichmann # Date 1218546071 -7200 # Node ID 83f99008a3f9d235aa492386edacb644a3c1f504 # Parent e347f0de5e224a95ff5b8ca53de4209e7c9c261a Insert anonym tasks into project tree when give them a name. diff -r e347f0de5e22 -r 83f99008a3f9 ChangeLog --- 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 + + * 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 * contrib/zeiterfassung: Applied Stephan Holl's week-option.patch which diff -r e347f0de5e22 -r 83f99008a3f9 getan --- 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)