GTG

Merge lp://qastaging/~mrasmus/gtg/reset-tag-color into lp://qastaging/~gtg/gtg/old-trunk

Proposed by Matthew Rasmus
Status: Merged
Merged at revision: not available
Proposed branch: lp://qastaging/~mrasmus/gtg/reset-tag-color
Merge into: lp://qastaging/~gtg/gtg/old-trunk
Diff against target: 100 lines (+36/-2)
4 files modified
GTG/core/tagstore.py (+9/-0)
GTG/core/task.py (+1/-1)
GTG/taskbrowser/browser.py (+10/-1)
GTG/taskbrowser/taskbrowser.glade (+16/-0)
To merge this branch: bzr merge lp://qastaging/~mrasmus/gtg/reset-tag-color
Reviewer Review Type Date Requested Status
Bertrand Rousseau (community) Approve
Review via email: mp+16397@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Bertrand Rousseau (bertrand-rousseau) wrote :

Thanks for this. It seems the icon is not set correctly (I see a "broken image" icon on my computer). Could you fix this?

review: Needs Fixing
487. By Matthew Rasmus

Fixed Reset Color icon

Revision history for this message
Matthew Rasmus (mrasmus) wrote :

> Thanks for this. It seems the icon is not set correctly (I see a "broken
> image" icon on my computer). Could you fix this?

Oops, meant to fix that earlier. Guess I got a bit ahead of myself. Should be fixed now.

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

Fine for me now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/core/tagstore.py'
2--- GTG/core/tagstore.py 2009-12-08 00:14:46 +0000
3+++ GTG/core/tagstore.py 2009-12-20 19:22:12 +0000
4@@ -219,6 +219,15 @@
5 Returns C{None} if there is no attribute matching C{att_name}.
6 """
7 return self._attributes.get(att_name, None)
8+
9+ def del_attribute(self, att_name):
10+ """Deletes the attribute C{att_name}.
11+ """
12+ if not att_name in self._attributes:
13+ return
14+ del self._attributes[att_name]
15+ if self._save:
16+ self._save()
17
18 def get_all_attributes(self, butname=False):
19 """Return a list of all attribute names.
20
21=== modified file 'GTG/core/task.py'
22--- GTG/core/task.py 2009-12-20 00:57:07 +0000
23+++ GTG/core/task.py 2009-12-20 19:22:12 +0000
24@@ -435,7 +435,7 @@
25 val = unicode(str(att_value), "UTF-8")
26 self.attributes[(namespace, att_name)] = val
27 self.sync()
28-
29+
30 def get_attribute(self, att_name, namespace=""):
31 """Get the attribute C{att_name}.
32
33
34=== modified file 'GTG/taskbrowser/browser.py'
35--- GTG/taskbrowser/browser.py 2009-12-20 02:08:08 +0000
36+++ GTG/taskbrowser/browser.py 2009-12-20 19:22:12 +0000
37@@ -320,6 +320,8 @@
38 self.on_add_subtask,
39 "on_colorchooser_activate":
40 self.on_colorchooser_activate,
41+ "on_resetcolor_activate":
42+ self.on_resetcolor_activate,
43 "on_workview_toggled":
44 self.on_workview_toggled,
45 "on_note_toggled":
46@@ -1083,6 +1085,13 @@
47 t.set_attribute("color", strcolor)
48 self.task_tv.refresh()
49 dialog.destroy()
50+
51+ def on_resetcolor_activate(self, widget):
52+ tags, notag_only = self.get_selected_tags()
53+ for t in tags:
54+ t.del_attribute("color")
55+ self.task_tv.refresh()
56+ self.tags_tv.refresh()
57
58 def on_workview_toggled(self, widget):
59 self.do_toggle_workview()
60@@ -1243,7 +1252,7 @@
61 # Then we are looking at single, normal tag rather than
62 # the special 'All tags' or 'Tasks without tags'. We only
63 # want to popup the menu for normal tags.
64- display_in_workview_item = self.tagpopup.get_children()[1]
65+ display_in_workview_item = self.tagpopup.get_children()[2]
66 selected_tag = selected_tags[0]
67 nonworkview = selected_tag.get_attribute("nonworkview")
68 # We must invert because the tagstore has "True" for tasks
69
70=== modified file 'GTG/taskbrowser/taskbrowser.glade'
71--- GTG/taskbrowser/taskbrowser.glade 2009-12-17 07:57:00 +0000
72+++ GTG/taskbrowser/taskbrowser.glade 2009-12-20 19:22:12 +0000
73@@ -765,6 +765,16 @@
74 </object>
75 </child>
76 <child>
77+ <object class="GtkImageMenuItem" id="resetcolor">
78+ <property name="label">Reset Color</property>
79+ <property name="visible">True</property>
80+ <property name="image">image2</property>
81+ <property name="use_stock">False</property>
82+ <property name="accel_group">accelgroup1</property>
83+ <signal name="activate" handler="on_resetcolor_activate"/>
84+ </object>
85+ </child>
86+ <child>
87 <object class="GtkCheckMenuItem" id="nonworkviewtag">
88 <property name="visible">True</property>
89 <property name="label" translatable="yes">Tag is displayed in the workview</property>
90@@ -981,4 +991,10 @@
91 <property name="visible">True</property>
92 <property name="stock">gtk-save-as</property>
93 </object>
94+ <object class="GtkImage" id="image2">
95+ <property name="visible">True</property>
96+ <property name="xalign">0.44999998807907104</property>
97+ <property name="yalign">0.47999998927116394</property>
98+ <property name="stock">gtk-revert-to-saved</property>
99+ </object>
100 </interface>

Subscribers

People subscribed via source and target branches

to status/vote changes: