GTG

Merge lp:~gtg-user/gtg/gmail-like-ui into lp:~gtg/gtg/old-trunk

Proposed by myfreeweb
Status: Rejected
Rejected by: Luca Invernizzi
Proposed branch: lp:~gtg-user/gtg/gmail-like-ui
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 87 lines (+26/-9)
2 files modified
GTG/core/task.py (+19/-7)
GTG/taskbrowser/tasktree.py (+7/-2)
To merge this branch: bzr merge lp:~gtg-user/gtg/gmail-like-ui
Reviewer Review Type Date Requested Status
Luca Invernizzi (community) Disapprove
Review via email: mp+18068@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Luca Invernizzi (invernizzi) wrote :

Hello,
this branch is just a coded mockup, is not ready for merging (I know, I've coded it with Kevin! :-D).
Besides, there is still an ongoing discussion on whether this feature is wanted or not (#384049).
If it's dropped but many people want this, maybe I can figure out to provide this as a plugin.

review: Disapprove

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/core/task.py'
2--- GTG/core/task.py 2010-01-08 20:51:01 +0000
3+++ GTG/core/task.py 2010-01-26 11:36:18 +0000
4@@ -249,7 +249,10 @@
5 """
6 #defensive programmtion to avoid returning None
7 if self.content:
8- element = xml.dom.minidom.parseString(self.content)
9+ txt = self.content
10+ for tag in self.get_tags_name():
11+ txt = self._strip_tag(txt, tag)
12+ element = xml.dom.minidom.parseString(txt)
13 txt = self.__strip_content(element)
14 txt = txt.strip()
15 #We keep the desired number of lines
16@@ -272,7 +275,8 @@
17 if element:
18 for n in element.childNodes:
19 if n.nodeType == n.ELEMENT_NODE:
20- txt += self.__strip_content(n)
21+ if n.tagName!='subtask':
22+ txt += self.__strip_content(n)
23 elif n.nodeType == n.TEXT_NODE:
24 txt += n.nodeValue
25 return txt
26@@ -558,11 +562,19 @@
27 for child in self.get_subtasks():
28 if child.can_be_deleted:
29 child.remove_tag(tagname)
30- self.content = (self.content
31- .replace('<tag>%s</tag>\n\n'%(tagname), '') #trail \n
32- .replace('<tag>%s</tag>, '%(tagname), '') #trail comma
33- .replace('<tag>%s</tag>'%(tagname), '')
34- )
35+ self.content = self._strip_tag(self.content, tagname)
36+
37+ def _strip_tag(self, text, tagname):
38+ return (text
39+ .replace('<tag>%s</tag>\n\n'%(tagname), '') #trail \n
40+ .replace('<tag>%s</tag>, '%(tagname), '') #trail comma
41+ .replace('<tag>%s</tag>'%(tagname), '')
42+ #in case XML is missing (bug #504899)
43+ .replace('%s\n\n'%(tagname), '')
44+ .replace('%s, '%(tagname), '')
45+ .replace(tagname, '')
46+ )
47+
48
49 #tag_list is a list of tags object
50 #return true if at least one of the list is in the task
51
52=== modified file 'GTG/taskbrowser/tasktree.py'
53--- GTG/taskbrowser/tasktree.py 2009-12-21 00:05:04 +0000
54+++ GTG/taskbrowser/tasktree.py 2010-01-26 11:36:18 +0000
55@@ -21,6 +21,7 @@
56 import gobject
57 import pango
58 import xml.sax.saxutils as saxutils
59+import re
60
61 from GTG import _
62 from GTG.core.tree import Tree, TreeNode
63@@ -130,10 +131,14 @@
64 elif column == COL_LABEL:
65 if task.get_status() == Task.STA_ACTIVE:
66 count = self._count_active_subtasks_rec(task)
67+ text_first_line = task.get_excerpt(lines=1)
68 if count != 0:
69 title = saxutils.escape(task.get_title()) + " (%s)" % count
70+ title += "<small> <span color='#BBBBBB'>" + \
71+ saxutils.escape(text_first_line) + "</span></small>"
72 else:
73- title = saxutils.escape(task.get_title())
74+ title = saxutils.escape(task.get_title()) + "<small> <span color='#BBBBBB'>" + \
75+ saxutils.escape(text_first_line) + "</span></small>"
76 elif task.get_status() == Task.STA_DISMISSED:
77 title = "<span color='#AAAAAA'>"\
78 + saxutils.escape(task.get_title()) + "</span>"
79@@ -405,7 +410,7 @@
80 render_text = gtk.CellRendererText()
81 render_text.set_property("ellipsize", pango.ELLIPSIZE_END)
82 title_col.set_title(_("Title"))
83- title_col.pack_start(render_text, expand=True)
84+ title_col.pack_start(render_text, expand = True)
85 title_col.add_attribute(render_text, "markup", COL_LABEL)
86 title_col.set_resizable(True)
87 title_col.set_expand(True)

Subscribers

People subscribed via source and target branches

to status/vote changes: