D-Bus Interface

| ## D-Bus Interface |

The D-Bus interface is very simple at the moment. FatRat's interface name is `info.dolezel.fatrat` and the path used to access its methods is `/`. The simplest way to access its method could look like this:

    qdbus info.dolezel.fatrat / methodName "argument1" "argument2"

`qdbus` is a tool shipped with Qt. The first method we'll have a look at is `addTransfers`. It accepts only one argument - a string containing links separated by an end-of-line. The user will be presented with a New transfers dialog. An example:

    qdbus info.dolezel.fatrat / addTransfers "http://link1"

To get a list of queues, you can use the `getQueues` method. The call will return a list of strings.

    qdbus info.dolezel.fatrat / getQueues

One can also need to add transfers without showing any dialogs. This is when `addTransfersNonInteractive` comes in handy.

    qdbus info.dolezel.fatrat / addTransfersNonInteractive "links" "target" "className" "queueID"

- `links` - a list of links separated by a newline character
- `target` - the destination directory / URL
- `className` - the transfer type; refer to the Jabber documentation to find out classes' names
- `queueID` - an integer specifying the index of the queue, where the transfer(s) should be added. For the first queue use 0 (zero)

Copyright © 2006-2008 Luboš Doležel