[Gambas-user] File extensions

Benoît Minisini gambas at ...1...
Fri May 17 01:18:41 CEST 2013


Le 16/05/2013 17:39, Willy Raets a écrit :
> Hi all,
>
> I'm trying to achieve something but have no idea even where to start
> looking.
>
> Let's say I have a gambas3 application named MyFileMaker
>
> The application MyFileMaker saves files with extension .myfile
>
> What I want to achieve is when double clicking a .myfile for application
> MyFileMaker to open with the double clicked .myfile
>
> 1. How does my application know it is opened because a .myfile was
> double clicked instead of opened from menu as usual as it has to act
> differently?
> 2. How does the system know that a .myfile needs to be opened with
> MyFileMaker?
> 3. How do I give the .myfile their own icon, meaning how does the system
> know that when there is a .myfile it has to use an icon I provided?
>
> This all needs to work when a end user installs MyFileMaker, so:
>
> 4. What do I need to do when making a package. Are there any options
> that need to be set in the packaging wizard and how do they need to be
> set?
>
> Any hint or link to more information would be welcome.
>

The 6th step of the wizard packager allows you to define which mimetypes 
are associated with your program.

Alas, there is nothing to define a new mimetype, which is needed to make 
the system aware of the *.myfile extension.

All the information is there:

http://freedesktop.org/wiki/Specifications/shared-mime-info-spec

A new mime type can be defined by running the 'xdg-mime install xxx.xml' 
command where 'xxx.xml' is an XML file that defines how to identify the 
mime type.

The syntax of that xml file is defined there:

http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-0.18.html#id2604543

Regards,

-- 
Benoît Minisini




More information about the User mailing list