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

Limit service menu to one selected item?

Tags: None
(comma "," separated)
rku
Registered Member
Posts
9
Karma
0
Is it possible to make service menu available when only one item is selected in dolphin? Ideally it should not show up if more than one item is selected.

And since im already writing - is there anywhere docs of available keys/values of kde service menus? Somehow i could not find. All i could find was one old tutorial that is not that helpful..
User avatar
Rog131
Registered Member
Posts
828
Karma
10
rku wrote:Is it possible to make service menu available when only one item is selected in dolphin? Ideally it should not show up if more than one item is selected.


Maybe with the KAbstractFileItemActionPlugin - it tells:
Please try to use servicemenus first, if you simply need to add actions to the popup menu for one or more mimetypes.

However if you need some dynamic logic, like "only show this item if two files are selected", or "show a submenu with a variable number of actions", then you have to implement a KAbstractFileItemActionPlugin subclass.


KDE4: http://api.kde.org/4.x-api/kdelibs-apid ... lugin.html
KF5: http://api.kde.org/frameworks-api/frame ... lugin.html

And since im already writing - is there anywhere docs of available keys/values of kde service menus? Somehow i could not find. All i could find was one old tutorial that is not that helpful..


Do you mean : https://techbase.kde.org/Development/Tu ... vice_Menus ?

The KDE service menus are using desktop files: https://techbase.kde.org/Development/Tu ... sktop_File -> https://specifications.freedesktop.org/ ... ec/latest/ .

There are:
- Recognized desktop entry keys: https://specifications.freedesktop.org/ ... 01s05.html
- The Exec key: https://specifications.freedesktop.org/ ... 01s06.html

More by looking existing desktop files:
X-KDE-Priority=TopLevel
InitialPreference=8
...etc.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], rockscient, Yahoo [Bot]