Actions extensions in File Managers - Draft 0.10
pwieser at trychlos.org
Tue Apr 13 07:07:07 PDT 2010
----- "PCMan" <pcman.tw at gmail.com> a écrit :
> 1. Action is an installed desktop entry file. It can contain a group
> of different profiles.
> 2. Profiles are basically condition/exec pairs used to decide what
> command should be executed when what criteria are met.
> 3. menus? How to define this?
Menu is just another type of desktop entry file. It contains the menu
definition, and the list of subitems.
> 1. It's unnatural to call a set of profiles an 'Action'. This can
> cause confusion. For example, in GTK+, when you refer to an action
> (GtkAction), you usually associate it with a single visual component
> which can be activated. So, when you call a set of profiles 'an'
> action, it's a little bit unnatural.
> 2. I'd suggest we borrow the naming from gtk+. Rename 'Action' to
> 'Action group' since it actually contains a 'group' of profiles, not
> single action.
> 3. Rename profile to 'Action' instead. When people heard an 'action',
> it's quite natural to think that it's associated with some command,
> just like GtkAction is associated with callback functions perform
> associated tasks. It's naturally to think that an action is associate
> with an Exec key.
The action, as currently defined in the spec, _is_ a single visual
component which can be activated, just as a GtkAction. It has a label,
a tooltip, an icon.
However, the exact command which will be executed depends on the
exact profile which has been selected, regarding the current selection.
Say I define an action 'Edit the document' to open a picture.
I'll define a profile, which runs 'gimp' when selection only contains
Now, say I'd wish extend this action to also deal with videos.
I'll define a second profile, which runs 'vlc' when the selection
only contains 'video/*' files.
At runtime, depending of the current selection, only _one_ profile
will be used in the action.
But the user doesn't see this: he's only seeing the 'Edit the document'
action, which now is able to deal both with images and videos.
> BTW, would you please provide a full example demonstrating how to
> define menus and others?
I'll add an example of a menus in the next version of draft
More information about the xdg