GTG

Merge lp:~jonathan-barnoud/gtg/spellcheck into lp:~gtg/gtg/old-trunk

Proposed by Pititjo
Status: Rejected
Rejected by: Luca Invernizzi
Proposed branch: lp:~jonathan-barnoud/gtg/spellcheck
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: None lines
To merge this branch: bzr merge lp:~jonathan-barnoud/gtg/spellcheck
Reviewer Review Type Date Requested Status
Luca Invernizzi (community) Disapprove
Bertrand Rousseau (community) Needs Resubmitting
Review via email: mp+4468@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Hello Jonathan,

I've reviewed your work and I'm impressed by your work. It's really
good, thanks you a lot for this :-)

I still have a few comments and stuffs I would prefer to see fixed
before merging your code.

0) It's a general rule we will apply to everybody submitting patches :
please be in sync with the tree before submitting your branch.
It means that you have to merge the trunk into your branch before asking
for a merge. It's more pain for you but less for us and we might have
multiple merge requests.
To be done : in your branch, type "bzr merge lp;gtg" and see it's still
working fine (fixe conflicts if any)

1) I don't like passing too much options when building the TaskEditor.
It's not your fault and you had no choice but I want to say that
publicly ;-)
To be done : nothing

2) As you stated in your statement, manually removing the
<gtk-misspelled> is ugly and I don't want that.
The right way of doing that is to ignore this specifics tag in
taskviewserial, around line 127.
if tag.props.name = gtk-misspelled :
(we still add the text in the tag)
parent.appendChild(doc.createTextNode(text))
You will see that in the new revision, unknown tags are automatically
dismissed (or should be). Maybe you will not have anything to do
To be done :
- remove the 2 ugly lines
- test extensively and add an exception if needed

3) The button. I'm not convinced about a button to enable/disable spell
check as you don't do it often. I think that a right clic would be more
appropriate. I'm not sure and this is not a blocking point for the
merge.
To be done : nothing really. Maybe investigate the right clic option for
later but I will merge your work anyway.

Don't get me wrong : your work is really really good. The fact that you
contributed to taskview.py makes you a superhero :-)

Do you plan to continue contributing to GTG after that ? Have you
anything you would want to do ?

Also, is there anything you think we can improve in the development
process ? We are beginner so don't hesitate to tell us about anything,
any suggestion you might have for the small GTG community.

Thanks Jonathan :-)

Lionel

Le vendredi 13 mars 2009 à 21:25 +0000, Pititjo a écrit :
> Pititjo has proposed merging lp:~jonathan-barnoud/gtg/spellcheck into lp:gtg.
>
> Requested reviews:
> Gtg developers (gtg)

lp:~jonathan-barnoud/gtg/spellcheck updated
192. By Lionel Dricot

fixes two small and rare bugs

Revision history for this message
Pititjo (jonathan-barnoud) wrote :

Le vendredi 13 mars 2009 à 22:15 +0000, Lionel Dricot a écrit :
> Hello Jonathan,
>
> I've reviewed your work and I'm impressed by your work. It's really
> good, thanks you a lot for this :-)
>
> I still have a few comments and stuffs I would prefer to see fixed
> before merging your code.
>

I will work on what you ask. I agree whith the button and I understand a
part of the serializer.

>
> Don't get me wrong : your work is really really good. The fact that you
> contributed to taskview.py makes you a superhero :-)
>
> Do you plan to continue contributing to GTG after that ? Have you
> anything you would want to do ?

I plan to continue contributing to GTG but I don't know how. Perhaps in
the integration with Gnome and other applications.

>
> Also, is there anything you think we can improve in the development
> process ? We are beginner so don't hesitate to tell us about anything,
> any suggestion you might have for the small GTG community.

Documentation would be great. But that will come.

I'm a beginner too. It's my first contribution in a software. I love to
be a superhero ^^.
>
> Thanks Jonathan :-)

Mais de rien.

>
>
> Lionel
>

Jonathan

lp:~jonathan-barnoud/gtg/spellcheck updated
193. By Lionel Dricot

Ctrl+N and Ctrl+Shift+N (fixes bug #341549 ).
Patch by Antons Rebguns. Thanks Antons, you rock :-)

194. By Lionel Dricot

Refactorized the serializer to better handle recursion.

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

On Fri, Mar 13, 2009 at 11:14 PM, Lionel Dricot <email address hidden> wrote:
> Hello Jonathan,
>
> I've reviewed your work and I'm impressed by your work. It's really
> good, thanks you a lot for this :-)
>
> I still have a few comments and stuffs I would prefer to see fixed
> before merging your code.
>
> 0) It's a general rule we will apply to everybody submitting patches :
> please be in sync with the tree before submitting your branch.
> It means that you have to merge the trunk into your branch before asking
> for a merge. It's more pain for you but less for us and we might have
> multiple merge requests.
> To be done : in your branch, type "bzr merge lp;gtg" and see it's still
> working fine (fixe conflicts if any)
>
> 1) I don't like passing too much options when building the TaskEditor.
> It's not your fault and you had no choice but I want to say that
> publicly ;-)
> To be done : nothing
>
> 2) As you stated in your statement, manually removing the
> <gtk-misspelled> is ugly and I don't want that.
> The right way of doing that is to ignore this specifics tag in
> taskviewserial, around line 127.
> if tag.props.name = gtk-misspelled :
> (we still add the text in the tag)
> parent.appendChild(doc.createTextNode(text))
> You will see that in the new revision, unknown tags are automatically
> dismissed (or should be). Maybe you will not have anything to do
> To be done :
> - remove the 2 ugly lines
> - test extensively and add an exception if needed
>
> 3) The button. I'm not convinced about a button to enable/disable spell
> check as you don't do it often. I think that a right clic would be more
> appropriate. I'm not sure and this is not a blocking point for the
> merge.
> To be done : nothing really. Maybe investigate the right clic option for
> later but I will merge your work anyway.

Yes, I too think that this button is useless. Many apps
have this kind of settings in their "Preferences". I guess we should
do this too. I'll open a bug about this. When the preferences editor
will OK, then this button should be removed and an option placed
there.

>
> Don't get me wrong : your work is really really good. The fact that you
> contributed to taskview.py makes you a superhero :-)

I confirm ;-), thanks a lot for your work!

> Do you plan to continue contributing to GTG after that ? Have you
> anything you would want to do ?
>
> Also, is there anything you think we can improve in the development
> process ? We are beginner so don't hesitate to tell us about anything,
> any suggestion you might have for the small GTG community.
>
> Thanks Jonathan :-)
>
>
> Lionel
>
> Le vendredi 13 mars 2009 à 21:25 +0000, Pititjo a écrit :
>> Pititjo has proposed merging lp:~jonathan-barnoud/gtg/spellcheck into lp:gtg.
>>
>> Requested reviews:
>>     Gtg developers (gtg)
>
>

--
Bertrand Rousseau
Place communale 1, 1450 Chastre, Belgium
e-mail : <email address hidden>
tel : +32 485 96 69 86

lp:~jonathan-barnoud/gtg/spellcheck updated
195. By Pititjo

Refactoring taswviewserial.Serializer.parse_buffer

196. By Pititjo

Provide spell check with gtkspell

197. By Pititjo

Prepare merge with trunk in pre-replacing test/xdg

198. By Pititjo

Merge with trunk

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

This branch needs to be fixed regarding the remarks in the comments. It should probably be updated as well with the latest changes in the trunk.

review: Needs Fixing
Revision history for this message
Pititjo (jonathan-barnoud) wrote :

Le jeudi 30 juillet 2009 à 09:02 +0000, Bertrand Rousseau a écrit :
> Review: Needs Fixing
> This branch needs to be fixed regarding the remarks in the comments. It should probably be updated as well with the latest changes in the trunk.

Arrghh !

I haven't test this branch for a while ! I don't know how it works with
new revision of GTG. I don't know if it's a good idea to merge it now.

Pititjo

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

> Le jeudi 30 juillet 2009 à 09:02 +0000, Bertrand Rousseau a écrit :
> > Review: Needs Fixing
> > This branch needs to be fixed regarding the remarks in the comments. It
> should probably be updated as well with the latest changes in the trunk.
>
> Arrghh !
>
> I haven't test this branch for a while ! I don't know how it works with
> new revision of GTG. I don't know if it's a good idea to merge it now.
>
> Pititjo

Fortunately, the editor hasn't changed much. However browser.py has (and will even more soon). SO I guess it's still possible to update it. As you want.

I'll mark this as "Resubmit" since it's actually more just some small fixes. This will give you the time to work on this on your own pace.

Bertrand

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

Is there still activity on this branch? Otherwise someone could take it over, or we could just drop the merge request.

Revision history for this message
Pititjo (jonathan-barnoud) wrote :

Le 02/02/2010 22:52, Luca Invernizzi a écrit :
> Is there still activity on this branch? Otherwise someone could take it over, or we could just drop the merge request.
>
I will drop the whole branch.

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

Ok. This branch is free for anyone to fork from. Closing merge request.

review: Disapprove

Unmerged revisions

198. By Pititjo

Merge with trunk

197. By Pititjo

Prepare merge with trunk in pre-replacing test/xdg

196. By Pititjo

Provide spell check with gtkspell

195. By Pititjo

Refactoring taswviewserial.Serializer.parse_buffer

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/taskbrowser/browser.py'
2--- GTG/taskbrowser/browser.py 2009-03-10 21:10:55 +0000
3+++ GTG/taskbrowser/browser.py 2009-03-13 21:18:10 +0000
4@@ -49,6 +49,7 @@
5 QUICKADD_PANE = True
6
7 EXPERIMENTAL_NOTES = False
8+EXPERIMENTAL_SPELL = False
9
10 class TaskBrowser:
11
12@@ -62,6 +63,7 @@
13 # Set the configuration dictionary
14 self.config = config
15 self.notes = EXPERIMENTAL_NOTES
16+ self.spell = EXPERIMENTAL_SPELL
17
18 # Setup default values for view
19 self.priv["collapsed_tid"] = []
20@@ -236,7 +238,7 @@
21 self.req.connect("refresh",self.do_refresh)
22
23 def __restore_state_from_conf(self):
24-
25+
26 # Extract state from configuration dictionary
27 if not self.config.has_key("browser"): return
28
29@@ -314,7 +316,30 @@
30 else :
31 self.note_toggle.hide()
32 self.new_note_button.hide()
33-
34+
35+ #Read the config about spell checking
36+ self.spell_check = False
37+ self.spell_language = None
38+ if "spell" in self.config :
39+ #Must we display the spell checking button ?
40+ if "experimental_spell" in self.config["spell"] :
41+ if self.config["spell"]["experimental_spell"] == "True" :
42+ self.spell = True
43+ else :
44+ self.spell = False
45+ #Must the check run ?
46+ if "spell_check" in self.config["spell"] and\
47+ self.config["spell"]["spell_check"] == "True" :
48+ self.spell_check = True
49+ else :
50+ self.spell_check = False
51+ #Is a language defined ?
52+ if "spell_language" in self.config["spell"] :
53+ self.spell_language = self.config["spell"]["spell_language"]
54+ else :
55+ self.spell_language = None
56+ #TODO : control the validity of the language argument.
57+ #If language is None, gtkspell use the system language define in $LANG
58
59 def on_move(self, widget, data): #pylint: disable-msg=W0613
60 xpos, ypos = self.window.get_position()
61@@ -868,7 +893,9 @@
62 else :
63 tv = TaskEditor(self.req,t,self.do_refresh,self.on_delete_task,
64 self.close_task,self.open_task,self.get_tasktitle,
65- notes=self.notes)
66+ notes=self.notes,
67+ spell=self.spell, spell_check=self.spell_check,
68+ spell_language=self.spell_language)
69 #registering as opened
70 self.opened_task[uid] = tv
71
72
73=== modified file 'GTG/taskeditor/editor.py'
74--- GTG/taskeditor/editor.py 2009-03-08 19:08:30 +0000
75+++ GTG/taskeditor/editor.py 2009-03-12 21:26:06 +0000
76@@ -44,7 +44,7 @@
77 class TaskEditor :
78 def __init__(self, requester, task, refresh_callback=None,delete_callback=None,
79 close_callback=None,opentask_callback=None, tasktitle_callback=None,
80- notes=False) :
81+ notes=False, spell=False, spell_check=None, spell_language=None) :
82 self.req = requester
83 self.time = time.time()
84 self.gladefile = GnomeConfig.GLADE_FILE
85@@ -65,6 +65,7 @@
86 "duedate_changed" : (self.date_changed,"due"),
87 "on_insert_subtask_clicked" : self.insert_subtask,
88 "on_inserttag_clicked" : self.inserttag_clicked,
89+ "on_checkspell_toggled" : self.spell_toggle,
90 }
91 self.wTree.signal_autoconnect(dic)
92 cal_dic = {
93@@ -99,10 +100,22 @@
94 self.inserttag_button = self.wTree.get_widget("inserttag")
95 self.tasksidebar = self.wTree.get_widget("tasksidebar")
96 self.keepnote_button = self.wTree.get_widget("keepnote")
97+ self.checkspell_button = self.wTree.get_widget("checkspell")
98+
99 if not notes :
100 self.keepnote_button.hide()
101 separator = self.wTree.get_widget("separator_note")
102 separator.hide()
103+ if not spell :
104+ self.checkspell_button.hide()
105+ separator_spell = self.wTree.get_widget("separator_note")
106+ separator_spell.hide()
107+ else :
108+ self.spell_language = spell_language
109+ if spell_check :
110+ self.checkspell_button.set_active(True)
111+ self.textview.spell_start(self.spell_language)
112+
113 #We will keep the name of the opened calendar
114 #Empty means that no calendar is opened
115 self.__opened_date = ''
116@@ -409,6 +422,10 @@
117 #Save should be also called when buffer is modified
118 self.save()
119 self.closing(self.task.get_id())
120+
121+ def spell_toggle(self, widget) :
122+ """Toggle the spell check status in the TextView"""
123+ self.textview.spell_toggle(self.spell_language)
124
125
126 ############# Private functions #################
127
128=== modified file 'GTG/taskeditor/taskeditor.glade'
129--- GTG/taskeditor/taskeditor.glade 2009-02-27 13:32:21 +0000
130+++ GTG/taskeditor/taskeditor.glade 2009-03-12 16:03:25 +0000
131@@ -1,6 +1,6 @@
132 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
133 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
134-<!--Generated with glade3 3.4.5 on Fri Feb 27 14:30:40 2009 -->
135+<!--Generated with glade3 3.4.5 on Thu Mar 12 16:59:07 2009 -->
136 <glade-interface>
137 <widget class="GtkWindow" id="TaskEditor">
138 <property name="title" translatable="yes">Task</property>
139@@ -99,6 +99,24 @@
140 <property name="homogeneous">True</property>
141 </packing>
142 </child>
143+ <child>
144+ <widget class="GtkSeparatorToolItem" id="separator_spell">
145+ <property name="visible">True</property>
146+ </widget>
147+ <packing>
148+ <property name="homogeneous">True</property>
149+ </packing>
150+ </child>
151+ <child>
152+ <widget class="GtkToggleToolButton" id="checkspell">
153+ <property name="visible">True</property>
154+ <property name="stock_id">gtk-spell-check</property>
155+ <signal name="toggled" handler="on_checkspell_toggled"/>
156+ </widget>
157+ <packing>
158+ <property name="homogeneous">True</property>
159+ </packing>
160+ </child>
161 </widget>
162 <packing>
163 <property name="expand">False</property>
164
165=== modified file 'GTG/taskeditor/taskview.py'
166--- GTG/taskeditor/taskview.py 2009-03-01 14:09:12 +0000
167+++ GTG/taskeditor/taskview.py 2009-03-12 23:35:38 +0000
168@@ -32,6 +32,9 @@
169 import gobject
170 import pango
171
172+#For spell checking. Need python-gnome2-extra.
173+import gtkspell
174+
175 from GTG.taskeditor import taskviewserial
176
177 separators = [' ','.',',','/','\n','\t','!','?',';']
178@@ -136,8 +139,12 @@
179 self.modified_sigid = self.buff.connect("changed" , self.modified)
180 self.connect("backspace",self.backspace)
181 self.tobe_refreshed = False
182-
183-
184+
185+ #Spell checking :
186+ #self.spell is None if we don't check spell.
187+ #Else it is a gtkspell.Spell object.
188+ self.spell = None
189+
190 #This function is called to refresh the editor
191 #Specially when we change the title
192 def refresh(self,title) :
193@@ -338,6 +345,12 @@
194 end = self.buff.get_end_iter()
195 texte = self.buff.serialize(self.buff, self.mime_type, start, end)
196
197+ #Remove the gtkspell tags wich cause bugs.
198+ #They must not be store.
199+ #There is perhaps an better place to di this.
200+ texte = texte.replace("<gtkspell-misspelled>", "")
201+ texte = texte.replace("</gtkspell-misspelled>", "")
202+
203 return texte
204 #Get the title of the task (aka the first line of the buffer)
205 def get_title(self) :
206@@ -754,7 +767,23 @@
207 indenttag = self.create_indent_tag(buff,level)
208 self.__apply_tag_to_mark(start,end,tag=indenttag)
209 return end
210-
211+
212+ #About spell checking
213+ def spell_start(self, language=None) :
214+ if self.spell is None :
215+ #Loading spell checking with system default local ($LANG)
216+ self.spell = gtkspell.Spell(self, language)
217+ def spell_stop(self) :
218+ if not self.spell is None :
219+ self.spell.detach()
220+ self.spell = None
221+ def spell_toggle(self, language=None) :
222+ if self.spell is None :
223+ self.spell_start(language)
224+ else :
225+ self.spell_stop()
226+ def spell_set_language(self, local) :
227+ self.spell.set_language(local)
228
229 def __apply_tag_to_mark(self,start,end,tag=None,name=None) :
230 start_i = self.buff.get_iter_at_mark(start)

Subscribers

People subscribed via source and target branches

to status/vote changes: