LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   adding program name to right-click menu (http://www.linuxquestions.org/questions/programming-9/adding-program-name-to-right-click-menu-713983/)

linuxsavar 03-24-2009 02:29 AM

adding program name to right-click menu
 
hi all
I wrote a program in linux.i built this file whit name ds3.xml for mime type:
Code:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
  <mime-type type="application/x-ds">
    <comment>ds3 file</comment>
    <glob pattern="*.ds"/>
  </mime-type>
</mime-info>

and ds3.desktop:
Code:

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=DS
Exec=/home/john/code/ds3/bin/Debug/ds3 %F
Icon=ds3.png
Terminal=true
X-MultipleArgs=false
Type=Application
Categories=Application;Network;
StartupNotify=true
MimeType=application/x-ds;

i want when i right-click on one file with ds extension "open with DS" appeared in menu.
what should i do.
thanks.

ta0kira 03-24-2009 09:31 PM

I assume this is KDE? Did you make sure the file type shows up in KInfoCenter under "Protocols"? If not, add it in KControlCenter. Once that's done, you can either add the action to the right-click menu in KControlCenter or by viewing properties of a file of that type and clicking on the tool button next to the type. I don't know exactly how to automate this, however. You might take a look at the desktop integration RPMs for OpenOffice and see how they register the file types. Also, you might have to add something to the file-magic system (man magic) so it doesn't mistake your program's files for e.g. a web page (even with the extension.)
Kevin Barry

linuxsavar 07-28-2011 03:19 PM

sudo update-desktop-database


All times are GMT -5. The time now is 04:52 AM.