This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Is there any documentation about add item in context menu?

Tags: dolphin, documentation, actions, service dolphin, documentation, actions, service dolphin, documentation, actions, service
(comma "," separated)
User avatar
juansimon
Registered Member
Posts
8
Karma
0
OS
I'm new using KDE 5 and I would like to add custom actions to Dolphin but I don't find any documentation about this. ???
User avatar
raphaelra
Registered Member
Posts
209
Karma
0
OS
User avatar
juansimon
Registered Member
Posts
8
Karma
0
OS
raphaelra wrote:You don't have to look far... >:D


That isn't a tutorial nor documentation about create .desktop service files.
User avatar
raphaelra
Registered Member
Posts
209
Karma
0
OS
It contains enough info about how to add an menu entry (which was your question). There is also an outdated article on KDE-Techbase, but it may be helpfull as well.

For creating desktop entries/files, you may consult the specification or choose one description/article found on google.
User avatar
juansimon
Registered Member
Posts
8
Karma
0
OS
It would be a good idea that someone updates the documentation to KF5 and Dolphin.
Another problem is that in that documentation it only talks about one of the X-KDE-... entries (not included in the standard).
I have found this but there is outdated too. :'(

ok, thanks. If that's all there is, I'll try to deal with it.
User avatar
juansimon
Registered Member
Posts
8
Karma
0
OS
"X-KDE-RequiredNumberOfUrls" serves to specify an exact number of selected files for the submenu to be displayed.
But what if I want to indicate a minimum but not a maximum?

I have created this Bug #418492.
User avatar
raphaelra
Registered Member
Posts
209
Karma
0
OS
Here some info about using X-KDE-Priority and X-KDE-Submenu.

UPDATE

I did some digging in the Dolphin source code and found out that there is an API that collects the service actions for a file/directory and can add them to the menu. It can be also used in other apps supporting browsing in files/directories (Kate, Gwenview, ...).

If you are familiar with C++, you can take a look at methods addServiceActionsTo() and addPluginActionsTo(). You will find there, which X-KDE-* entries are utilized and how ... I didn't know for example that the service actions could also be defined in the .directory file 8-)
airdrik
Registered Member
Posts
1854
Karma
5
OS
To comment on "out-of-date" documentation, the specifications at play haven't really changed much if at all since KDE 4 (or earlier), so even if some of it still refers to KDE 4 (or the need to update to KDE/plasma 5), the information in them should still be relevant.

(though i will note that one difference you may run into is wrt file locations for some of this stuff which moved from ~/.kde(4) to ~/.config or ~/.local/share, employing various XDG_*_DIR(s) environment variables)


airdrik, proud to be a member of KDE forums since 2008-Dec.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]