GTG

Merge lp://qastaging/~gtg/gtg/due-col into lp://qastaging/~gtg/gtg/old-trunk

Proposed by Bertrand Rousseau
Status: Merged
Merged at revision: not available
Proposed branch: lp://qastaging/~gtg/gtg/due-col
Merge into: lp://qastaging/~gtg/gtg/old-trunk
Diff against target: 65 lines (+23/-4)
1 file modified
GTG/taskbrowser/tasktree.py (+23/-4)
To merge this branch: bzr merge lp://qastaging/~gtg/gtg/due-col
Reviewer Review Type Date Requested Status
Luca Invernizzi (community) Approve
Lionel Dricot (community) Approve
Review via email: mp+18193@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Bertrand Rousseau (bertrand-rousseau) wrote :

Fix for bug #497227: "Days left" column redundant with "Due date"

lp://qastaging/~gtg/gtg/due-col updated
550. By Bertrand Rousseau

Update translations

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

I agree.

Ideally, the start date column would follow the same rules. Those rules should also be placed in task.py so they can be used in the editor. (there should be a "verbal" argument to get_duedate and get_startdate functions)

review: Approve
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Also, I realize that the start_date column should not be displayed in the workview

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

(but all of this could be done after merging this one)

Revision history for this message
Bertrand Rousseau (bertrand-rousseau) wrote :

Well, if we don't display the start date, then the "Schedule for" feature is hard to use (because you can't sort tasks by their scheduling). So I would let it. Maybe in 0.3 we could disable it by default, to focus on the really needed information, and allow for column add/remove (there's an open bug for that). We could even automatically add the start date column once somebody first schedule a task, so that it's present only if somebody needs it.

Revision history for this message
Bertrand Rousseau (bertrand-rousseau) wrote :

Is it ok to merge this branch? Could I have a confirmation from another developer? I'd like to finish up 0.2.1 release.

Revision history for this message
Luca Invernizzi (invernizzi) wrote :

It's fine for me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/taskbrowser/tasktree.py'
2--- GTG/taskbrowser/tasktree.py 2010-01-08 02:57:24 +0000
3+++ GTG/taskbrowser/tasktree.py 2010-01-28 12:42:18 +0000
4@@ -38,6 +38,7 @@
5 COL_TAGS = 7
6 COL_LABEL = 9
7 COL_SDATE = 10
8+COL_DUE = 11
9
10 class TaskTreeModel(gtk.GenericTreeModel):
11
12@@ -52,6 +53,7 @@
13 gobject.TYPE_PYOBJECT,\
14 str,\
15 str,\
16+ str,\
17 str)
18
19 def __init__(self, requester):
20@@ -116,6 +118,23 @@
21 return str(task.get_start_date())
22 elif column == COL_DDATE:
23 return str(task.get_due_date())
24+ elif column == COL_DUE:
25+ dleft = task.get_days_left()
26+ if not dleft:
27+ return str(task.get_due_date())
28+ if dleft == 1:
29+ return _("Tomorrow")
30+ if dleft == 0:
31+ return _("Today")
32+ if dleft == -1:
33+ return _("Yesterday")
34+ if dleft < -1:
35+ return _("%s days ago") % str(abs(dleft))
36+ if dleft > 1 and dleft <= 15:
37+ return _("In %s days") % str(dleft)
38+ else:
39+ return str(task.get_due_date())
40+
41 elif column == COL_CDATE:
42 return str(task.get_closed_date())
43 elif column == COL_CDATE_STR:
44@@ -430,17 +449,17 @@
45 self.append_column(sdate_col)
46 self.columns.insert(COL_SDATE, sdate_col)
47
48- # Due date column
49+ # Due column
50 ddate_col = gtk.TreeViewColumn()
51 render_text = gtk.CellRendererText()
52- ddate_col.set_title(_("Due date"))
53+ ddate_col.set_title(_("Due"))
54 ddate_col.pack_start(render_text, expand=False)
55- ddate_col.add_attribute(render_text, "markup", COL_DDATE)
56+ ddate_col.add_attribute(render_text, "markup", COL_DUE)
57 ddate_col.set_resizable(False)
58 ddate_col.set_sort_column_id(COL_DDATE)
59 ddate_col.set_cell_data_func(render_text, self._celldatafunction)
60 self.append_column(ddate_col)
61- self.columns.insert(COL_DDATE, ddate_col)
62+ self.columns.insert(COL_DUE, ddate_col)
63
64 # days left
65 # dleft_col = gtk.TreeViewColumn()

Subscribers

People subscribed via source and target branches

to status/vote changes: