Two small mistakes in the code samples in part 2 of the tutorial

Bug #1069077 reported by Marten Gorodetsky on 2012-10-20
This bug affects 2 people
Affects Status Importance Assigned to Milestone

Bug Description

quickly --version
Quickly 12.08.1

Problem 1:

The line
    def save_file(self, widget, data=None):
should be:
    def on_mnu_save_activate(self, widget, data=None):

Problem 2:

The line
    return rows[0]['Name']
should be:
    return rows[0]['File']

I've attached a patch that fixes these two problems using bzr diff -p1 in the trunk of quickly. I've never done this before so I hope this was the right way to do it.

Marten Gorodetsky (askmarten) wrote :
Marten Gorodetsky (askmarten) wrote :

I noticed three more mistakes on the same tutorial page. I attached a new patch that fixes all five problems.

The three new mistakes I noticed are:

1) When the text entry is removed, the reader isn't told to remove the code in the on_mnu_new_activate handler which sets the text of the text entry.

2) To set the title of the window, the tutorial suggests to use the self.set_text method which does not exist. It should be self.set_title instead.

3) To make the files in the Open dialog react to double clicks, the tutorial suggests to connect the select-cursor-row signal. This signal doesn't handle double clicks, the row-activated signal should be used instead.

tags: added: patch
William Ranvaud (wiranvaud) wrote :

Beginners tutorials with wrong code makes noobs go crazy. Fixing this is important. Thx for the patch Marten.

Changed in quickly:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers