GTG

Merge lp:~kmhpfoss/gtg/bug-fix- into lp:~gtg/gtg/old-trunk

Proposed by Codee
Status: Merged
Merged at revision: 1251
Proposed branch: lp:~kmhpfoss/gtg/bug-fix-
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 27 lines (+5/-0)
1 file modified
GTG/gtk/editor/editor.py (+5/-0)
To merge this branch: bzr merge lp:~kmhpfoss/gtg/bug-fix-
Reviewer Review Type Date Requested Status
Izidor Matušov code, run Approve
Review via email: mp+135490@code.launchpad.net

Description of the change

Fixed the bug related to changing date manually mentioned in https://bugs.launchpad.net/gtg/+bug/1047753
Included event handlers for entry focus lost event and enter key pressed event

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

Hi codee,

I am going to nitpick about your code, don't take it personally :)

8 +
9 + ###################################Newly added bug fixes#############################
10 +
11 + self.duedate_widget = self.builder.get_object("duedate_entry")
12 + self.startdate_widget = self.builder.get_object("startdate_entry")
13 + self.closeddate_widget = self.builder.get_object("closeddate_entry")
14 +
15 + #############################End this section - go to next###########################

Why did you move that block of the code and add extra comments around it? It is not needed, put it please back.

As I was playing with your solution, I found out that we were missing refresh_editor() call after the date_changed() was called. You can solve this bug by just one additional line. Call refresh_editor() method within date_changed().

In the end it would result in much more cleaner and simplier solution for this bug -- only one line change! If you have any questions, feel free to ask; either on IRC or here in comments.

review: Needs Fixing (code, run)
Revision history for this message
Codee (kmhpfoss) wrote :

Hi Izidor,

I've done the necessary code changes mentioned above.

And I've been assigned to this bug fix(#1047753), but I can't commit it as I don't have committer rights.

Revision history for this message
Izidor Matušov (izidor) wrote :

Codee: please remove date_changed_manually and registering callbacks for it. You don't need that :)

review: Needs Fixing (code)
Revision history for this message
Izidor Matušov (izidor) wrote :

You should call self.refresh_editor() only then when the date is valid. Otherwise, you can't delete any character of the date and writing the date manually is not possible. Please, fix it.

review: Needs Fixing (code, run)
Revision history for this message
Izidor Matušov (izidor) wrote :

Thank you for your fix, it looks great now.

review: Approve (code, run)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/gtk/editor/editor.py'
2--- GTG/gtk/editor/editor.py 2012-11-25 19:19:44 +0000
3+++ GTG/gtk/editor/editor.py 2012-11-27 16:59:29 +0000
4@@ -68,6 +68,7 @@
5 self.subtask_button.set_tooltip_text(GnomeConfig.SUBTASK_TOOLTIP)
6 self.inserttag_button = self.builder.get_object("inserttag")
7 self.inserttag_button.set_tooltip_text(GnomeConfig.TAG_TOOLTIP)
8+
9 #Create our dictionary and connect it
10 dic = {
11 "mark_as_done_clicked": self.change_status,
12@@ -371,11 +372,15 @@
13 self.task.set_due_date(datetoset)
14 elif data == "closed":
15 self.task.set_closed_date(datetoset)
16+ self.refresh_editor()
17+
18 else:
19 #We should write in red in the entry if the date is not valid
20 widget.modify_text(gtk.STATE_NORMAL, gtk.gdk.color_parse("#F00"))
21 widget.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse("#F88"))
22
23+
24+
25 def on_date_pressed(self, widget, date_kind):
26 """Called when a date-changing button is clicked."""
27 if date_kind == GTGCalendar.DATE_KIND_DUE:

Subscribers

People subscribed via source and target branches

to status/vote changes: