GTG

Multiple selection support (r480) breaks plugin API and Hamster plugin

Bug #497966 reported by Kevin Mehall
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GTG
Fix Released
Medium
Luca Invernizzi

Bug Description

The plugin api's get_selected_task() method uses a function that doesn't work when the treeview is set to allow multiple selection.

The answer is to have the function call the browser's get_selected_task() method instead. We should probably also expose get_selected_tasks() so plugins can take advantage of multiple selection (though it's not useful for hamster).

I thought it was that simple, but ...
Is there a reason the PluginAPI doesn't hold a reference to the browser object, just to a bunch of its components? I wonder what other plugin API methods are already implemented in the browser or could be simplified by being able to use browser methods.

Traceback (most recent call last):
  File "/home/km/temporary/gtg/trunk/GTG/plugins/hamster/hamster.py", line 199, in browser_cb
    self.sendTask(plugin_api.get_selected_task())
  File "/home/km/temporary/gtg/trunk/GTG/core/plugins/api.py", line 312, in get_selected_task
    model, iter = selected.get_selected()
TypeError: GtkTreeSelection.get_selected can not be used when selection mode is gtk.SELECTION_MULTIPLE

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

The problem is now fixed.
I agree with you that it doesn't make much sense to duplicate the code. You should open another bug for that.

Changed in gtg:
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Luca Invernizzi (invernizzi)
milestone: none → 0.3
Changed in gtg:
milestone: 0.3 → 0.2.1
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.