Standardizing Context Menu Actions

Casey Link unnamedrambler at gmail.com
Mon Nov 3 02:02:54 CET 2008


On Sun, Nov 2, 2008 at 7:57 PM, Alejandro Wainzinger
<aikawarazuni at gmail.com> wrote:
> 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.


I'm all for this. It would also make adding the same actions to tracks
in different browsers and views very easy. I've duplicated the
Copy/Move action code in the CB, the SB, and the FB. I wanted to
duplicate it in the Playlist, but adding complicated context actions
without using a capability makes it impossible.

Casey


More information about the Amarok-devel mailing list