Foster parents for Tinymail

I have found myself foster parents for Tinymail.

One of the difficult jobs of a maintainer is delegating tasks to the right people. In my opinion a good project leader is someone who motivates people by giving out responsibilities.

This is why Igalia is doing Tinymail’s 0.0.8 pre-release this time.

Microsoft goes open?!

Microsoft promises to expand interoperability: the register, Microsoft’s PR site.

Don’t ask me, I’m still finding out what this is all about.

Making it look nice

Wouldn’t it be nice if the code for your E-mail client would look like this?

private void GetHeadersCallback (Tny.Folder folder, bool cancel, Tny.List model, IntPtr user_data)
{
  if (!cancel)
    this.headers_treeview.Model = (Gtk.TreeModel) model;
}

private void StatusCallback (GLib.Object sender, Tny.Status status)
{
  this.progressbar.Fraction = status.Fraction;
}

private void GetMsgCallBack (Tny.Folder folder, bool cancel, Tny.Msg msg, IntPtr user_data)
{
  if (msg != null && !cancel)
    this.msg_view.Msg = msg;
}

private void OnMailSelected (object o, EventArgs args)
{
  Tny.Ui.GTK.HeaderListModel model = (o as Gtk.TreeSelection).TreeView.Model
          as Tny.Ui.GTK.HeaderListModel;
  Tny.Header header = model.GetHeader (o as Gtk.TreeSelection);
  if (header != null) {
    Console.WriteLine ("Message selected: " + header.From);
    this.cur_folder.GetMsgAsync (header, GetMsgCallBack, StatusCallback);
  }
}

private void OnFolderChanged (object o, EventArgs args)
{
  Tny.Ui.GTK.FolderStoreTreeModel model = (o as Gtk.TreeSelection).TreeView.Model
          as Tny.Ui.GTK.FolderStoreTreeModel;
  Tny.Folder folder = model.GetFolder (o as Gtk.TreeSelection);
  if (folder != null) {
    Tny.Ui.GTK.HeaderListModel headers_model = new Tny.Ui.GTK.HeaderListModel();
    Console.WriteLine ("Folder selected: " + folder.Name);
    this.cur_folder = folder;
    folder.GetHeadersAsync (headers_model, true, GetHeadersCallback, StatusCallback);
  }
}

It would

The mandatory screenshot

I just finished making Tinymail‘s .NET bindings actually usable. To test whether the binding works I wrote a small demo user interface in C#.

I added minimal documentation too.

Because Tinymail does quite a bit more with the GTypeInterface GType than Gtk+, Mike’s GtkSharp code generator for this had a few problems. I expected it to fail a lot worse, though. Without any improvements it did already get pretty far by itself! Mike and me have been pushing its code to support even the most crazy kind of things that Tinymail is doing with interfaces in GObject-C. There is still a lot of room for improvement for both Tinymail’s resulting binding itself and GtkSharp‘s Gapi parser and code generator.

With current trunk of GtkSharp and after applying two patches for its generator, it’ll make you a quite nice .NET API now. I’m of course working with Mike on getting proper solutions for what I had to patch upstream in GtkSharp’s Gapi.

I would like to thank Mike for his patience and help while I was making this binding work. I hope other library maintainers will use Tinymail’s one as knowhow-offset to get their own bindings working in .NET too.

TnySharp

There are still a few rough edges, but I’m confident that I’ll soon have those fixed. Other than that, here it is: the first in C# programmed E-mail client that uses Tinymail.

Took me around two minutes to throw the UI together and connect a few signal handlers to the treeviews with MonoDevelop.