Standardizing Context Menu Actions
Alejandro Wainzinger
aikawarazuni at gmail.com
Mon Nov 3 01:57:04 CET 2008
The CollectionTreeView currently makes special cases of: editing tags
(EditCapability), Copy To Collection, Move To Collection,
CustomActionsCapability, etc. But they all have the same idea in
mind: get a list of Meta::Track, and perform some actions on them.
What's desired is to refactor this so that the Collections, that the
selected tracks belong to, get tested for certain Capabilities, and
these Capabilities are all built in one go. This also means making
certain Capabilities for Collection, instead of Track.
In Practice:
- some amount of tracks are selected in the collection browser
- the context menu goes through all selected tracks, checks their
collection's capabilities
- for all capabilities found to be supported, generate a
PopupDropperAction for it (e.g. Delete, Copy to Collection, Move to
Collection)
- the action will then call a method in the Collection that is capable
of performing a particular action (e.g. Delete) on a list of tracks
- the collection view is updated
This would make adding future Capabilities a lot easier, and make the
TreeView code a lot easier to read. In addition, it would finally let
us implement deletion of multiple tracks from media devices in one go
(yes I have a vested interest in this, haha).
Seb, please comment more on this.
More information about the Amarok-devel
mailing list