Standardizing Context Menu Actions

Seb Ruiz ruiz at kde.org
Mon Nov 3 02:22:11 CET 2008


2008/11/3 Alejandro Wainzinger <aikawarazuni at gmail.com>:
> 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.

There's not much more for me to say - you've pretty much covered it
all. It makes sense to have a Collection or CollectionLocation
Capability for actions which need to span multiple Meta objects.


-- 
Seb Ruiz

http://www.sebruiz.net/
http://amarok.kde.org/


More information about the Amarok-devel mailing list