Extending Icons and Context Menus

Mikolaj Machowski mikmach at wp.pl
Thu Apr 15 20:50:53 BST 2004


Dnia czw 15. kwietnia 2004 17:47, Calvin Gaisford napisaƂ:
> I am investigating developing a "Windows Explorer Shell Extension" type
> plugin for Konqueror and am having trouble locating the information I
> need.  Basically I need to add items to the context menus when users
> right click on specific documents or folders.  I also need to customize
> the icons displayed for specific folders by providing an overlay graphic
> of some type (like can be done with the Windows Explorer).
>
> Are there interfaces to build this type of plugin and if so, where can I
> find information about it?  All of the information I can find is about
> writing viewers and specific document handlers.  This will need to work
> across all documents plus folders.

You need to write a bunch of .desktop files. Here is an example for 
images:
#
# Servicemenu image converter, by Jens Benecke <jens-kde at spamfreemail.de>.
# Released under the same license as the KDE core distribution (GPL 2.0).
#
[Desktop Entry]
ServiceTypes=image/*
Actions=convToJPEG;convToPNG;convToGIF;convToTIF
X-KDE-Submenu=Convert To

[Desktop Action convToJPEG]
Name=JPEG
Name[xx]=xxJPEGxx
Icon=image
Exec=convert %f "`echo %f | perl -pe 's/\.[^.]+$//'`.jpg"

[Desktop Action convToPNG]
Name=PNG
Name[xx]=xxPNGxx
Icon=image
Exec=convert %f "`echo %f | perl -pe 's/\.[^.]+$//'`.png"

[Desktop Action convToTIF]
Name=TIF
Name[xx]=xxTIFxx
Icon=image
Exec=convert %f "`echo %f | perl -pe 's/\.[^.]+$//'`.tif"

[Desktop Action convToGIF]
Name=GIF
Name[xx]=xxGIFxx
Icon=image
Exec=convert %f "`echo %f | perl -pe 's/\.[^.]+$//'`.gif"

Specification for .desktop format is... Hmm. I don't know where exactly 
this is - look for desktop specs at fd.o. I don't know where is 
description of KDE extensions.

m.
-- 
LaTeX + Vim = http://vim-latex.sourceforge.net/
Learn Touch Typing with Vim? Oui. Ja. Yes. Tak:
  http://vim.sourceforge.net/script.php?script_id=461
vim.pl - http://skawina.eu.org/mikolaj/





More information about the kfm-devel mailing list