GTG

pluginAPI's selection "changed" signal works only for last enabled plugin

Bug #1228013 reported by Parin Porecha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTG
Fix Released
High
Parin Porecha

Bug Description

steps to reproduce the bug in pluginAPI -

Please get this branch https://code.launchpad.net/~parinporecha/gtg/pluginAPI_bug_test

I’ve created a clone plugin of ‘Not today’ called ‘Yes today’. This plugin sets start date of selected tasks as ‘Today’. All of the code is same. Just button name, icon and details in .gtg-plugin file are different.
- Enable ‘Not today’ plugin
- You’ll see a button ‘Do it tomorrow’ in toolbar
- Now, select any no. of arbitrary tasks. You’ll see that the button gets enabled. On clicking it the start date gets set correctly. - On clicking elsewhere, the button gets disabled. So, click elsewhere to disable the button.

- Now enable ‘Yes today’ plugin
- You’ll see a button ‘Do it today’ in toolbar after the previous button
- Now select any no. of arbitrary tasks. Now what you’ll see is that ‘Do it today’ button gets enabled. But, ‘Do it tomorrow’ does not.
- Now disable the plugin ‘Yes today’
- Select any task/s. You’ll get an error message about the button of ‘Yes today’

This is just one way of reproducing this bug. Disabling one plugin, enabling the other to change button positions and then repeating the process gives same result. Either the other button does not work, or you get an error message.

Related branches

Revision history for this message
Parin Porecha (parinporecha) wrote :
Revision history for this message
Nimit Shah (nimit-svnit) wrote :

Is this the traceback that you are getting on disabling the "Not Today" plugin and clicking on any task?

Traceback (most recent call last):
  File "/home/nimit/project/gtg/plugin_bug/GTG/core/plugins/api.py", line 68, in __selection_changed
    self.selection_changed_callback(selection)
  File "/home/nimit/project/gtg/plugin_bug/GTG/plugins/yes_today/yes_today.py", line 47, in selection_changed
    self.tb_button.set_sensitive(True)
AttributeError: 'bool' object has no attribute 'set_sensitive'

Changed in gtg:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Parin Porecha (parinporecha)
status: Confirmed → In Progress
milestone: none → 0.3.1
Revision history for this message
Parin Porecha (parinporecha) wrote :

Yes

When you disabled the plugin, it's function 'selection changed' did not get removed from pluginAPI. Hence on changing selection, it was called. But as the plugin was disabled, it could not find the button, and hence gave the error.

There are still more ways to reproduce this bug. Enable 'Not today', then enable 'Yes today'. You'll find that 'Not today' has stopped responding to selection changes.

Izidor Matušov (izidor)
Changed in gtg:
status: In Progress → Fix Committed
Nimit Shah (nimit-svnit)
Changed in gtg:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.