GTG

Merge lp:~flyfy1/gtg/gtg_songyy_minor_bug_fix1 into lp:~gtg/gtg/old-trunk

Proposed by Song Yangyu
Status: Merged
Merged at revision: 1145
Proposed branch: lp:~flyfy1/gtg/gtg_songyy_minor_bug_fix1
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 64 lines (+8/-16)
2 files modified
GTG/gtk/browser/browser.py (+7/-15)
GTG/gtk/editor/taskview.py (+1/-1)
To merge this branch: bzr merge lp:~flyfy1/gtg/gtg_songyy_minor_bug_fix1
Reviewer Review Type Date Requested Status
Izidor Matušov running, code Approve
Review via email: mp+99794@code.launchpad.net

Description of the change

1. Give a quick work-around solution for the bug #754572
2. Fix bug: when trying to change the color of a colored tag, then pressing cancel would cause error.
3. Fix bug: The 'Cancel' in the color selector functions the same as "OK" -- but they should be different.

To post a comment you must log in.
Revision history for this message
Izidor Matušov (izidor) wrote :

Thank you for your patch. It looks good to me.

review: Approve (running, code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/gtk/browser/browser.py'
2--- GTG/gtk/browser/browser.py 2012-03-27 10:46:47 +0000
3+++ GTG/gtk/browser/browser.py 2012-03-28 17:36:22 +0000
4@@ -666,14 +666,6 @@
5 self.about.hide()
6 return True
7
8- def on_color_changed(self, widget):
9- gtkcolor = widget.get_current_color()
10- strcolor = gtk.color_selection_palette_to_string([gtkcolor])
11- tags = self.get_selected_tags()
12- for tname in tags:
13- t = self.req.get_tag(tname)
14- t.set_attribute("color", strcolor)
15-
16 def on_colorchooser_activate(self, widget):
17 #TODO: Color chooser should be refactorized in its own class. Well, in
18 #fact we should have a TagPropertiesEditor (like for project) Also,
19@@ -681,11 +673,9 @@
20 self.set_target_cursor()
21 color_dialog = gtk.ColorSelectionDialog('Choose color')
22 colorsel = color_dialog.colorsel
23- colorsel.connect("color_changed", self.on_color_changed)
24
25 # Get previous color
26 tags= self.get_selected_tags()
27- init_color = None
28 if len(tags) == 1:
29 ta = self.req.get_tag(tags[0])
30 color = ta.get_attribute("color")
31@@ -693,13 +683,15 @@
32 colorspec = gtk.gdk.color_parse(color)
33 colorsel.set_previous_color(colorspec)
34 colorsel.set_current_color(colorspec)
35- init_color = colorsel.get_current_color()
36 response = color_dialog.run()
37- # Check response and set color if required
38- if response != gtk.RESPONSE_OK and init_color:
39- strcolor = gtk.color_selection_palette_to_string([init_color])
40+ new_color = colorsel.get_current_color()
41+
42+ # Check response_id and set color if required
43+ if response == gtk.RESPONSE_OK and new_color:
44+ strcolor = gtk.color_selection_palette_to_string([new_color])
45 tags = self.get_selected_tags()
46- for t in tags:
47+ for tname in tags:
48+ t = self.req.get_tag(tname)
49 t.set_attribute("color", strcolor)
50 self.reset_cursor()
51 color_dialog.destroy()
52
53=== modified file 'GTG/gtk/editor/taskview.py'
54--- GTG/gtk/editor/taskview.py 2012-03-28 08:28:42 +0000
55+++ GTG/gtk/editor/taskview.py 2012-03-28 17:36:22 +0000
56@@ -40,7 +40,7 @@
57 from GTG.gtk.editor import taskviewserial
58 from GTG.tools import urlregex
59
60-separators = [' ', ',', '\n', '\t', '!', '?', ';', '\0']
61+separators = [' ', ',', '\n', '\t', '!', '?', ';', '\0','(',')']
62 #those separators are only separators if followed by a space. Else, they
63 #are part of the word
64 specials_separators = ['.','/']

Subscribers

People subscribed via source and target branches

to status/vote changes: