KFM Manual - Applications

## Integrating an application step by step

In this chapter I will show you how to register XV in the K Desktop Environment. After following these steps XV will be registered for various image data types and will be able to load and save images from the web... you did not expect that `:-)`. So, here we go.

## Opening a KFM super user window

I assume that you know from the previous lesson how to open a KFM super user window. Now open the menu `Edit` and select `Applications`. You will now be shown a window like this one:

1. Here you can see the directory we are visiting right now. This directory tree contains all informations about registered apps in your KDE.
2. Now click on this folder, since we want to install XV in the graphics section.

If you are logged in as super user you will find an option to edit the global application config files, too

Please distinguish exactly between applications config files and application config files. The first one stores configurations written by an application during run time, while the second ones ( these are the ones we are talking about here ) contain informations about installed applications. These config files are created during installation of an application and dont change usually afterwards.

## Creating a new application file

From the menu `File` open the submenu `New` and select `Program`. You will now be prompted by a new window:

1. You must enter the applications name here followed by the extension `.kdelnk`. The name you use does not need to be the name of the binary. It may be any name but it has to be a unique name for the app.
2. Now press OK.

## Opening the properties

You will now see a new icon in the window. Press the right mosue button to open the properties menu. Now you have to fill out a form like this one:

1. Select `Execute` to see this form.
2. Enter the command line which starts the app. This is the same you would enter in a terminal session, but instead of the data files, you must place a `%f` here. In the hackers section of the previous chapter you will find more information on this place holders.
3. In seldom cases one needs to define a working directory for an application. Usually this line is empty.
4. Choose an icon for the application.
5. Select this checkbox if the app must run in a terminal. This is the case for pine for example.
6. You may enter special special command line aarguments here which will ba passed to the terminal ( usually kvt ).

## The second form

The last step is to fill out the second form:

1. Click on `Application` to reach this page.
2. You may enter the names of binaries here. Multiple binaries have to be separated by `;`. This causes every binary of this name to become the applications icon, too. So this line is for better look & feel only.
3. Enter a small comment in your language here. Developers must take care that there is at least a default english comment provided at the end.
4. This list contains all mime types that this app can handle.
5. Use this buttons to move mime types between the two lists.
6. This list contains all registered mime types which are not handled by the application.
7. Press Ok

That is the end of the show, your application is registered now. KFM has updated its bindings automatically, only KPanel will need to be restarted ( System menu of kpanel ). XV should now appear in the list of applications once you hit the right mouse button over an image file containing one of the selected data types. If the image is not located on your local hard disk, KFM will download it and run XV afterwards. If the file is modified by XV, KFM will ask you wether it should be uploaded. It is now time for a coffee or two.