From kde-devel Wed Mar 03 12:18:42 2004 From: James Marsh Date: Wed, 03 Mar 2004 12:18:42 +0000 To: kde-devel Subject: Re: Is there a Konqueror mimetype drop handler? Message-Id: <20040303121842.GA10835 () jamesmarsh ! net> X-MARC-Message: https://marc.info/?l=kde-devel&m=107831635119400 * James Marsh [26-Feb-2004 02:38]: >> What I should like to be able to do is have a new mimetype >> representing a "destination host" execute a submission program when >> "job description" files are dropped on it. The host file then also >> needs to be able to be opened in a graphical viewer/editor by >> clicking on it to change the various parameters. * Aaron J. Seigo [03-Mar-2004 01:38]: > i think what you want are .desktop files... for instance, for your > "Destination Host" files, something like this should work (or some > variation, i'm not testing this ;) : > > [Desktop Entry] > Comment=Globus Destination Host > Name=Globus: somehost.com > Encoding=UTF-8 > Exec=globus --host=somehost.com > Icon=globus > > for the graphical viewer/editor you just need to add a Mimetype= > entry with the proper "mimetype" in your app's .desktop file and then > add a mimetype .desktop file to the share/mimelnk/ hierarchy ... Thanks, Aaron. That's a nice solution if the "destination" icons only need work on KDE; unfortunately I'd like to be able to freely pass them between the KDE and Windows version of the software. How would I associate my "destination host editor" with this desktop file (so that the user can easily change the "--host=somehost.com" bit and test that the host is actually reachable etc)? I suppose I could pop up the editor if there are no arguments passed, but I wouldn't know which .desktop file to then change. What I'd really like is for an arbitrary filetype to have some executable associated with dropping icons on it. I've been looking through the sourcecode for Konqueror and was wondering about whether to create a patch for kdebase-3.2.0/libkonq/konq_operations.cc which adds a "X-KDE-DropExec" entry that describes what to execute when an icon is dropped on a file. This could be useful, say, for adding files to an archive without directly opening it: [Desktop Entry] Encoding=UTF-8 MimeType=application/x-gzip;application/x-lha;application/x-tar; [...] GenericName=Archiving Tool Name=Ark Exec=ark -caption "%c" %i %m %U Icon=ark DocPath=ark/index.html Type=Application Terminal=0 BinaryPattern=ark; X-DCOP-ServiceType=Unique Categories=Qt;KDE;Utility X-KDE-DropExec=ark -caption "%c" %i %m --add-to %d %U X-KDE-DropConfirm="Add files to archive" This would need a %d placeholder adding in order to specify the destination that was dropped upon. What do you think? James >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<