Blame platform-overview/zh_CN/dev-launching-mime.page
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<page xmlns="http://projectmallard.org/1.0/" xmlns:its="http://www.w3.org/2005/11/its" type="topic" style="task" id="dev-launching-mime" xml:lang="zh-CN">
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<info>
|
|
Packit |
1470ea |
<revision version="0.1" date="2014-01-28" status="draft"/>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<credit type="author">
|
|
Packit |
1470ea |
<name>David King</name>
|
|
Packit |
1470ea |
<email its:translate="no">davidk@gnome.org</email>
|
|
Packit |
1470ea |
<years>2014</years>
|
|
Packit |
1470ea |
</credit>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<include xmlns="http://www.w3.org/2001/XInclude" href="cc-by-sa-3-0.xml"/>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
</info>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<title>Associate MIME types</title>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<links type="series" style="floatend">
|
|
Packit |
1470ea |
<title>Launch your application</title>
|
|
Packit |
1470ea |
</links>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
Associate files with your application, using MIME types.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
If your application opens files of a certain type, such as PNG images, you
|
|
Packit |
1470ea |
can add an association with the MIME type of the file. This is added to the
|
|
Packit |
1470ea |
desktop file.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<example>
|
|
Packit |
1470ea |
<listing>
|
|
Packit |
1470ea |
<title><file>myapplication.desktop</file></title>
|
|
Packit |
1470ea |
[Desktop Entry]
|
|
Packit |
1470ea |
Name=My Application
|
|
Packit |
1470ea |
Exec=myapplication
|
|
Packit |
1470ea |
Type=Application
|
|
Packit |
1470ea |
MimeType=image/png
|
|
Packit |
1470ea |
</listing>
|
|
Packit |
1470ea |
</example>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
For this hypothetical application, image/png is listed as the
|
|
Packit |
1470ea |
supported MIME type.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
Custom MIME types can be added to the system-wide MIME database, but this
|
|
Packit |
1470ea |
is outside the scope of this guide. The
|
|
Packit |
1470ea |
<link href="http://standards.freedesktop.org/shared-mime-info-spec/latest/">Shared
|
|
Packit |
1470ea |
MIME-Info Database</link> specification for more details.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
</page>
|