You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, December 2nd 2003, 9:31pm

konqueror -- adding new menus

Would someone point me to an example of adding a menu and/or a toolbar entry to run a shell command for Konqueror? I'd like to avoid attempting to (re)compile but would like some quick commands to be available on the menubar, etc. A more detailed example that included context sensitve menus for specific file types would also be appreciated.

Examples:
1) Add new menubar entry "New" to run shell command "xterm &".
2) Add new toolbar entry <icon> to run shell command "xterm &".
3) Add new context menu over types directory to run shell command "xterm &"

"xterm &" is used here as an example command to be run in background.

Kind regards,
Tom

2

Tuesday, December 2nd 2003, 11:32pm

There's an example on the KDE developer site of a plugin which does the sort of thing you want:

http://developer.kde.org/documentation/tutorials/dot/writing-plugins.html

You'll need to compile some code, but presumably the source archive (linked to from that page) contains a reasonable framework for doing that. There's also another example which might be relevant:

http://developer.kde.org/documentation/tutorials/dot/servicemenus.html

Have fun,

David

3

Wednesday, December 3rd 2003, 8:26pm

Thanks for the pointers. I had looked at both of those tutorials already.

Largely through trial and error, I figured out that creating a ~/.kde/share/apps/konqueror/konqueror.rc file, I can add new menu entries. However, I can't figure out how to add new actions.

I can create a new service, as the tutorial describes, but then can't seem to reference it as an action for the new menu entry.

Anyone have any suggestions?

4

Wednesday, December 3rd 2003, 11:01pm

Context menus vs. menubar

I suppose that, at first glance, you can't reference actions mentioned in service menus because they depend on a particular file, or set of files, being selected. Still, I'd have thought that it would be possible to select your files then use the menubar to trigger your action, although it doesn't look like that is possible with Konqueror in KDE 3.1.

I would expect some way of specifying your new menubar entries as a separate .rc file which can be referenced in the desktop file for your service menu. The trouble is that it would seem to only become "active" when the context menu is opened.

A plugin might be the only way you can achieve this. It would be interesting to discover otherwise.