Quantcast
Channel: Maemo Nokia N900 » filenames
Viewing all articles
Browse latest Browse all 2

Send files to your contacts on your N900

$
0
0

You can share files on your N900 via Bluetooth, E-Mail and web services (Flickr and Facebook) thanks to libsharing-dialog. But there is no file transfers to a contact through instant messaging.

722300e555share.png Send files to your contacts on your N900
The sharing dialog with Bluetooth, E-Mail and web services features

But look, the sharing dialog is obviously missing a fourth button named “Share via IM”!

Jonny Lamb wrote Monorail, a file transfer application for the N900. Monorail is a standalone application using the Telepathy framework but so far it does not integrate with libsharing-dialog. Libsharing-dialog is supposed to be extensible by plugins (see the Sharing Plug-in documentation). Unfortunately the API is more suitable for web services than for file transfers through instant messenging so it makes the work more difficult.

So I implemented that fourth button with some hacks to workaround the limitations of the libsharing-dialog API:

  • The Monorail package dpkg-diverts libsharingdialog.so into /var/lib/funsharing/
  • Monorail implements a new library (aka libfunsharing) replacing libsharingdialog.so with the same ABI
  • Libfunsharing calls dlopen() on the real libsharingdialog.so
  • It also patches the class GtkTable in memory (see struct GObjectClass->constructed) just before calling the real function from libsharingdialog.so, and restore it after the call. I use this hack to get a reference to the GtkDialog and the GtkTable containing the three buttons (the libsharing-dialog API does not give us any reference to these objects)
  • In the constructed function of GtkTable, it adds a 4th button “Share via IM” which sends the filenames to share via D-Bus to Monorail
  • Monorail receives the filenames from libfunsharing via D-Bus, shows the contact selector and send the files as usual.

4f9cca1b13norail.png Send files to your contacts on your N900
The sharing dialog after installing Monorail 0.3

It works fine in the file manager and the image viewer. Do you know any other application with a file sharing feature?

The address book can share contact cards via SMS, Bluetooth and E-Mail but it does not use libsharing-dialog, so Monorail does not automatically add my “Share via IM” button.

a80ae8f77eShare.png Send files to your contacts on your N900
Send a contact card from the address book

But since PR1.2, the address book has a new plugin API and it automatically links to your plugins installed in /usr/lib/osso-addressbook/plugins.  The plugin API is designed for menu extensions and does not have helper functions for the sharing dialog. But with Marco’s help, I replaced OssoABookSendContactsDialog’s constructed function to add the fourth button:

24e25eea23ith IM.png Send files to your contacts on your N900
Send a contact card from the address book after installing Monorail 0.3

Monorail 0.3 is available in maemo extras-devel.

2010-07-30 12:47 UTC with score 2

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images