* renamed gtk-glade => gtk
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Wed, 5 Jul 2006 09:39:50 +0000 (09:39 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Wed, 5 Jul 2006 09:39:50 +0000 (09:39 +0000)
pmo-trunk-r351

89 files changed:
src/gtk/Makefile.am [new file with mode: 0644]
src/gtk/glade/qgn_list_gene_attacpap.png [new file with mode: 0644]
src/gtk/glade/qgn_list_gene_bold.png [new file with mode: 0644]
src/gtk/glade/qgn_list_gene_contacts.png [new file with mode: 0644]
src/gtk/glade/qgn_list_gene_italic.png [new file with mode: 0644]
src/gtk/glade/qgn_list_messagin_mail.png [new file with mode: 0644]
src/gtk/glade/qgn_list_messagin_mail_unread.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_bullets.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_delete.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_fontcolor.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_forward.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_moveto.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_new.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_next.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_previous.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_reply.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_replytoall.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_saveattachment.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_send.png [new file with mode: 0644]
src/gtk/glade/qgn_toolb_messagin_sendreceive.png [new file with mode: 0644]
src/gtk/modest-icon-names.h [new file with mode: 0644]
src/gtk/modest-ui-account-setup.c [new file with mode: 0644]
src/gtk/modest-ui-account-setup.h [new file with mode: 0644]
src/gtk/modest-ui-glade.h [new file with mode: 0644]
src/gtk/modest-ui-main-view.c [new file with mode: 0644]
src/gtk/modest-ui-main-view.h [new file with mode: 0644]
src/gtk/modest-ui-message-editor.c [new file with mode: 0644]
src/gtk/modest-ui-message-editor.h [new file with mode: 0644]
src/gtk/modest-ui-message-viewer.c [new file with mode: 0644]
src/gtk/modest-ui-message-viewer.h [new file with mode: 0644]
src/gtk/modest-ui-wizard.c [new file with mode: 0644]
src/gtk/modest-ui-wizard.h [new file with mode: 0644]
src/gtk/modest-ui.c [new file with mode: 0644]
src/gtk/modest.glade [new file with mode: 0644]
src/gtk/modest.gladep [new file with mode: 0644]
src/gtk/pixmaps/qgn_addr_icon_user_group.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_gene_attacpap.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_gene_fldr_clp.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_gene_fldr_cls.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_gene_fldr_exp.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_gene_fldr_opn.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_drafts.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_editor.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_encrypted.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_encrypted_high.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_encrypted_low.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_high.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_high_unread.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_low.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_low_unread.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_signed.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_signed_high.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_signed_low.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_unread.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_unread_encrypted.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_unread_encrypted_high.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_unread_encrypted_low.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_unread_signed.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_unread_signed_high.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_hdr_unread_signed_low.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_inbox.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_deleted.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_encrypted_read.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_encrypted_read_high.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_encrypted_read_low.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_encrypted_unread.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_encrypted_unread_high.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_encrypted_unread_low.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_high.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_high_unread.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_low.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_low_unread.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_signed_read.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_signed_read_high.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_signed_read_low.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_signed_unread.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_signed_unread_high.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_signed_unread_low.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_mail_unread.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_outbox.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_sent.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messagin_viewer.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messaging_high.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_list_messaging_low.png [new file with mode: 0644]
src/gtk/pixmaps/qgn_widg_datedit.png [new file with mode: 0644]

diff --git a/src/gtk/Makefile.am b/src/gtk/Makefile.am
new file mode 100644 (file)
index 0000000..a53db65
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# Makefile.am
+# Time-stamp: <2006-06-06 14:27:48 (djcb)>
+#
+#
+# use Automake 'trick' ==> convenience static libraries, which
+# won't be installed, just for linking
+#
+INCLUDES=\
+       $(MODEST_GSTUFF_CFLAGS) \
+       $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_CFLAGS) \
+       -DPREFIX=\"@prefix@\" \
+       -Wall
+
+noinst_LTLIBRARIES=\
+       libmodest-ui.la
+
+GLADE_FILES=\
+       modest.glade\
+       glade/*.png
+
+PIXMAP_FILES=\
+       pixmaps/*.png
+
+libmodest_ui_la_SOURCES=\
+       modest-ui.c\
+       modest-ui-glade.h\
+       modest-icon-names.h\
+       modest-ui-main-view.c\
+       modest-ui-main-view.h\
+       modest-ui-message-editor.c\
+       modest-ui-message-editor.h\
+       modest-ui-message-viewer.c\
+       modest-ui-message-viewer.h\
+       modest-ui-wizard.h\
+       modest-ui-wizard.c\
+       modest-ui-account-setup.h\
+       modest-ui-account-setup.c
+
+LDADD = \
+       $(MODEST_GSTUFF_LIBS) \
+       $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_LIBS)
+
+EXTRA_DIST=pixmaps/* glade/* modest.glade modest.gladep
+
+gladedir = $(prefix)/share/modest/glade
+glade_DATA = $(GLADE_FILES)
+
+pixmapdir = $(prefix)/share/modest/pixmaps
+pixmap_DATA = $(PIXMAP_FILES)
diff --git a/src/gtk/glade/qgn_list_gene_attacpap.png b/src/gtk/glade/qgn_list_gene_attacpap.png
new file mode 100644 (file)
index 0000000..0448a7d
Binary files /dev/null and b/src/gtk/glade/qgn_list_gene_attacpap.png differ
diff --git a/src/gtk/glade/qgn_list_gene_bold.png b/src/gtk/glade/qgn_list_gene_bold.png
new file mode 100644 (file)
index 0000000..5d10d3f
Binary files /dev/null and b/src/gtk/glade/qgn_list_gene_bold.png differ
diff --git a/src/gtk/glade/qgn_list_gene_contacts.png b/src/gtk/glade/qgn_list_gene_contacts.png
new file mode 100644 (file)
index 0000000..350271d
Binary files /dev/null and b/src/gtk/glade/qgn_list_gene_contacts.png differ
diff --git a/src/gtk/glade/qgn_list_gene_italic.png b/src/gtk/glade/qgn_list_gene_italic.png
new file mode 100644 (file)
index 0000000..638fa90
Binary files /dev/null and b/src/gtk/glade/qgn_list_gene_italic.png differ
diff --git a/src/gtk/glade/qgn_list_messagin_mail.png b/src/gtk/glade/qgn_list_messagin_mail.png
new file mode 100644 (file)
index 0000000..4038776
Binary files /dev/null and b/src/gtk/glade/qgn_list_messagin_mail.png differ
diff --git a/src/gtk/glade/qgn_list_messagin_mail_unread.png b/src/gtk/glade/qgn_list_messagin_mail_unread.png
new file mode 100644 (file)
index 0000000..3d15a38
Binary files /dev/null and b/src/gtk/glade/qgn_list_messagin_mail_unread.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin.png b/src/gtk/glade/qgn_toolb_messagin.png
new file mode 100644 (file)
index 0000000..4c4899b
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_bullets.png b/src/gtk/glade/qgn_toolb_messagin_bullets.png
new file mode 100644 (file)
index 0000000..aee5a70
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_bullets.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_delete.png b/src/gtk/glade/qgn_toolb_messagin_delete.png
new file mode 100644 (file)
index 0000000..0f31b07
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_delete.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_fontcolor.png b/src/gtk/glade/qgn_toolb_messagin_fontcolor.png
new file mode 100644 (file)
index 0000000..49304cd
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_fontcolor.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_forward.png b/src/gtk/glade/qgn_toolb_messagin_forward.png
new file mode 100644 (file)
index 0000000..b286238
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_forward.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_moveto.png b/src/gtk/glade/qgn_toolb_messagin_moveto.png
new file mode 100644 (file)
index 0000000..3497a2a
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_moveto.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_new.png b/src/gtk/glade/qgn_toolb_messagin_new.png
new file mode 100644 (file)
index 0000000..b93921e
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_new.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_next.png b/src/gtk/glade/qgn_toolb_messagin_next.png
new file mode 100644 (file)
index 0000000..6d70431
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_next.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_previous.png b/src/gtk/glade/qgn_toolb_messagin_previous.png
new file mode 100644 (file)
index 0000000..184e319
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_previous.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_reply.png b/src/gtk/glade/qgn_toolb_messagin_reply.png
new file mode 100644 (file)
index 0000000..5cdd7c2
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_reply.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_replytoall.png b/src/gtk/glade/qgn_toolb_messagin_replytoall.png
new file mode 100644 (file)
index 0000000..78cde69
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_replytoall.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_saveattachment.png b/src/gtk/glade/qgn_toolb_messagin_saveattachment.png
new file mode 100644 (file)
index 0000000..02d7eb1
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_saveattachment.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_send.png b/src/gtk/glade/qgn_toolb_messagin_send.png
new file mode 100644 (file)
index 0000000..84a3420
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_send.png differ
diff --git a/src/gtk/glade/qgn_toolb_messagin_sendreceive.png b/src/gtk/glade/qgn_toolb_messagin_sendreceive.png
new file mode 100644 (file)
index 0000000..0b794cd
Binary files /dev/null and b/src/gtk/glade/qgn_toolb_messagin_sendreceive.png differ
diff --git a/src/gtk/modest-icon-names.h b/src/gtk/modest-icon-names.h
new file mode 100644 (file)
index 0000000..35745bd
--- /dev/null
@@ -0,0 +1,34 @@
+/* modest-tny-icon-names.h */
+/* FIXME: this should go the front-end dirs,
+ * with specific icons */
+
+#ifndef __MODEST_TNY_ICON_NAMES_H__
+#define __MODEST_TNY_ICON_NAMES_H__
+
+#define PIXMAP_PREFIX PREFIX "/share/modest/pixmaps/"
+
+/* icons */
+
+#define MODEST_HEADER_ICON_READ                        PIXMAP_PREFIX "qgn_list_messagin_mail.png"
+#define MODEST_HEADER_ICON_UNREAD              PIXMAP_PREFIX "qgn_list_messagin_mail_unread.png"
+#define MODEST_HEADER_ICON_DELETED             PIXMAP_PREFIX "qgn_list_messagin_mail_deleted.png"
+#define MODEST_HEADER_ICON_ATTACH              PIXMAP_PREFIX "qgn_list_gene_attacpap.png"
+
+#define MODEST_FOLDER_ICON_OPEN                        PIXMAP_PREFIX "qgn_list_gene_fldr_opn.png"
+#define MODEST_FOLDER_ICON_CLOSED              PIXMAP_PREFIX "qgn_list_gene_fldr_cls.png"
+
+#define MODEST_FOLDER_ICON_INBOX               PIXMAP_PREFIX "qgn_list_messagin_inbox.png"
+#define MODEST_FOLDER_ICON_OUTBOX              PIXMAP_PREFIX "qgn_list_messagin_outbox.png"
+#define MODEST_FOLDER_ICON_SENT                        PIXMAP_PREFIX "qgn_list_messagin_sent.png"
+#define MODEST_FOLDER_ICON_TRASH               PIXMAP_PREFIX "qgn_list_messagin_mail_deleted.png"
+#define MODEST_FOLDER_ICON_JUNK                        PIXMAP_PREFIX "qgn_list_messagin_mail_deleted.png"
+#define MODEST_FOLDER_ICON_DRAFTS              PIXMAP_PREFIX "qgn_list_messagin_drafts.png"
+#define MODEST_FOLDER_ICON_NORMAL              PIXMAP_PREFIX "qgn_list_gene_fldr_cls.png"
+
+#define MODEST_FOLDER_ICON_CONTACTS            PIXMAP_PREFIX "qgn_addr_icon_user_group.png"
+#define MODEST_FOLDER_ICON_NOTES               PIXMAP_PREFIX "qgn_list_messagin_viewer.png"
+#define MODEST_FOLDER_ICON_CALENDAR            PIXMAP_PREFIX "qgn_widg_datedit.png"
+
+
+
+#endif  /*__MODEST_TNY_ICON_NAMES_H__*/
diff --git a/src/gtk/modest-ui-account-setup.c b/src/gtk/modest-ui-account-setup.c
new file mode 100644 (file)
index 0000000..b13f5b7
--- /dev/null
@@ -0,0 +1,1114 @@
+/* modest-ui-wizard.c */
+
+/* insert (c)/licensing information) */
+
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+#include <glib/gi18n.h>
+#include <string.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /*HAVE_CONFIG_H*/
+
+#include "../modest-account-mgr.h"
+#include "../modest-identity-mgr.h"
+
+#include "modest-ui-glade.h"
+#include "modest-ui-account-setup.h"
+
+enum {
+       IDENTITY_NAME,
+       IDENTITY_ADDRESS,
+       IDENTITY_VIA,
+       IDENTITY_COLUMNS
+};
+
+enum {
+       ACCOUNT_NAME,
+       ACCOUNT_HOST,
+       ACCOUNT_PROT,
+       ACCOUNT_COLUMNS
+};
+
+typedef struct _CallbackData CallbackData;
+
+struct _CallbackData {
+       GtkTreeView     *id_tree_view;
+       GtkTreeView     *acc_tree_view;
+       ModestUI        *modest_ui;
+       GladeXML        *glade_xml;
+};
+
+static void
+identity_setup_dialog (ModestUI *, GtkTreeModel *, gchar *);
+
+static void
+account_setup_dialog (ModestUI *, gchar *);
+
+static void
+missing_notification(GtkWindow *, gchar *);
+
+static GtkTreeModel *
+create_identities_model(ModestIdentityMgr *);
+
+static GtkTreeModel *
+create_accounts_model(ModestAccountMgr *);
+
+static void
+refresh_identities(ModestIdentityMgr *,
+                  GladeXML *);
+
+static void
+refresh_accounts(ModestAccountMgr *, GladeXML *glade_xml);
+
+/* CALLBACKS */
+
+static gboolean
+filter_transports (GtkTreeModel *model,
+                  GtkTreeIter *iter,
+                  gpointer userdata) {
+
+       gchar *name;
+       gboolean retval;
+
+       gtk_tree_model_get(model,
+                          iter,
+                          ACCOUNT_PROT, &name,
+                          -1);
+
+       retval = strcasecmp(name, "SMTP")==0;
+       g_free(name);
+       return retval;
+}
+
+
+static void
+account_edit_action(GtkWidget *button,
+                   gpointer userdata) {
+
+       CallbackData *cb_data;
+       GtkTreeModel *acc_liststore;
+       GtkTreeSelection *selection;
+       GtkTreeIter selected_iter;
+       gchar *account_name;
+
+       cb_data = (CallbackData *) userdata;
+       selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(cb_data->acc_tree_view));
+
+       gtk_tree_selection_get_selected(selection,
+                                       &acc_liststore,
+                                       &selected_iter);
+       gtk_tree_model_get(GTK_TREE_MODEL(acc_liststore),
+                          &selected_iter,
+                          ACCOUNT_NAME, &account_name,
+                          -1);
+
+       account_setup_dialog (cb_data->modest_ui, account_name);
+       g_free(account_name);
+}
+
+static void
+account_create_action(GtkWidget *button,
+                     gpointer userdata) {
+       CallbackData *cb_data;
+
+       cb_data = (CallbackData *) userdata;
+
+       account_setup_dialog(cb_data->modest_ui, NULL);
+}
+
+static void
+account_delete_action(GtkWidget *button,
+                     gpointer userdata) {
+       CallbackData *cb_data;
+       GtkTreeSelection *selection;
+       GtkTreeIter selected_iter;
+       GtkTreeModel *acc_liststore;
+       GtkWidget *confirmation_dialog;
+       GtkWidget *confirmation_message;
+       ModestUIPrivate *priv;
+       gchar *account_name;
+       gchar *message;
+       gint result;
+
+       cb_data = (CallbackData *) userdata;
+       priv = MODEST_UI_GET_PRIVATE(cb_data->modest_ui);
+       selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(cb_data->acc_tree_view));
+
+       gtk_tree_selection_get_selected(selection,
+                                       &acc_liststore,
+                                       &selected_iter);
+       gtk_tree_model_get(GTK_TREE_MODEL(acc_liststore),
+                          &selected_iter,
+                          ACCOUNT_NAME, &account_name,
+                          -1);
+
+       confirmation_dialog = gtk_dialog_new_with_buttons ("Confirm removal of account",
+                                                          GTK_WINDOW(gtk_widget_get_toplevel(button)),
+                                                          GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                                          GTK_STOCK_OK,
+                                                          GTK_RESPONSE_OK,
+                                                          GTK_STOCK_CANCEL,
+                                                          GTK_RESPONSE_CANCEL,
+                                                          NULL);
+
+       message = g_strdup_printf("Remove selected account '%s'?", account_name);
+       confirmation_message = gtk_label_new_with_mnemonic (message);
+
+       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(confirmation_dialog)->vbox), confirmation_message, FALSE, FALSE, 10);
+
+       gtk_widget_show_all(confirmation_dialog);
+
+       result=gtk_dialog_run(GTK_DIALOG(confirmation_dialog));
+       if (result==GTK_RESPONSE_OK)
+       {
+               modest_account_mgr_remove_server_account(priv->modest_acc_mgr,
+                                                        account_name,
+                                                        NULL);
+       }
+
+       gtk_widget_destroy(confirmation_dialog);
+       g_free(account_name);
+       g_free(message);
+}
+
+
+static void
+identity_edit_action(GtkWidget *button,
+                    gpointer userdata)
+{
+       CallbackData *cb_data;
+       GtkTreeModel *acc_liststore;
+       GtkTreeModel *id_liststore;
+       GtkTreeSelection *selection;
+       GtkTreeIter selected_iter;
+       gchar *identity_name;
+
+       cb_data = (CallbackData *) userdata;
+       selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(cb_data->id_tree_view));
+
+       gtk_tree_selection_get_selected(selection,
+                                       &id_liststore,
+                                       &selected_iter);
+       gtk_tree_model_get(GTK_TREE_MODEL(id_liststore),
+                          &selected_iter,
+                          IDENTITY_NAME, &identity_name,
+                          -1);
+       /* We use the available tree model from the accounts page to display a selection
+        * of transports in the identities. Since we only want the transport accounts,
+        * we derive a gtk_tree_model_filter and apply filter_transports function.
+        */
+       acc_liststore = gtk_tree_model_filter_new(gtk_tree_view_get_model(cb_data->acc_tree_view),
+                                                 NULL);
+       gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(acc_liststore),
+                                              filter_transports,
+                                              NULL,
+                                              NULL);
+
+       identity_setup_dialog (cb_data->modest_ui, acc_liststore, identity_name);
+       g_free(identity_name);
+}
+
+static void
+identity_create_action(GtkWidget *button,
+                      gpointer userdata)
+{
+       CallbackData *cb_data;
+       GtkTreeModel *acc_liststore;
+
+       cb_data = (CallbackData *) userdata;
+
+       /* Works as in identity_edit_action. */
+       acc_liststore = gtk_tree_model_filter_new(gtk_tree_view_get_model(cb_data->acc_tree_view),
+                                                 NULL);
+       gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(acc_liststore),
+                                              filter_transports,
+                                              NULL,
+                                              NULL);
+
+       identity_setup_dialog(cb_data->modest_ui, acc_liststore, NULL);
+       g_object_unref(acc_liststore);
+}
+
+static void
+identity_delete_action(GtkWidget *button,
+                      gpointer userdata)
+{
+       CallbackData *cb_data;
+       GtkTreeSelection *selection;
+       GtkTreeIter selected_iter;
+       GtkTreeModel *id_liststore;
+       GtkWidget *confirmation_dialog;
+       GtkWidget *confirmation_message;
+       ModestUIPrivate *priv;
+       gchar *identity_name;
+       gchar *message;
+       gint result;
+
+       cb_data = (CallbackData *) userdata;
+       priv = MODEST_UI_GET_PRIVATE(cb_data->modest_ui);
+       selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(cb_data->id_tree_view));
+
+       gtk_tree_selection_get_selected(selection,
+                                       &id_liststore,
+                                       &selected_iter);
+       gtk_tree_model_get(GTK_TREE_MODEL(id_liststore),
+                          &selected_iter,
+                          ACCOUNT_NAME, &identity_name,
+                          -1);
+
+       confirmation_dialog = gtk_dialog_new_with_buttons ("Confirm removal of identity",
+                                                          GTK_WINDOW(gtk_widget_get_toplevel(button)),
+                                                          GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                                          GTK_STOCK_OK,
+                                                          GTK_RESPONSE_OK,
+                                                          GTK_STOCK_CANCEL,
+                                                          GTK_RESPONSE_CANCEL,
+                                                          NULL);
+
+       message = g_strdup_printf("Remove selected identity '%s'?", identity_name);
+       confirmation_message = gtk_label_new_with_mnemonic (message);
+
+       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(confirmation_dialog)->vbox), confirmation_message, FALSE, FALSE, 10);
+
+       gtk_widget_show_all(confirmation_dialog);
+
+       result=gtk_dialog_run(GTK_DIALOG(confirmation_dialog));
+       if (result==GTK_RESPONSE_OK)
+       {
+               modest_identity_mgr_remove_identity(priv->modest_id_mgr,
+                                                   identity_name,
+                                                   NULL);
+       }
+
+       gtk_widget_destroy(confirmation_dialog);
+       g_free(identity_name);
+       g_free(message);
+}
+
+static void
+activate_buttons_on_identity(GtkTreeView *tree_view,
+                            gpointer user_data)
+{
+       GtkWidget *button;
+       GladeXML *glade_xml;
+
+       glade_xml=(GladeXML *) user_data;
+
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "IdentityEditButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), TRUE);
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "IdentityDeleteButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), TRUE);
+}
+
+static void
+activate_buttons_on_account(GtkTreeView *tree_view,
+                           gpointer user_data)
+{
+       GtkWidget *button;
+       GladeXML *glade_xml;
+
+       glade_xml=(GladeXML *) user_data;
+
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "AccountEditButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), TRUE);
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "AccountDeleteButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), TRUE);
+}
+
+static void
+use_sig_toggled(GtkToggleButton *button,
+               gpointer userdata) {
+
+       GtkWidget *awidget;
+       GladeXML *glade_xml = (GladeXML *) userdata;
+
+       awidget=glade_xml_get_widget(glade_xml, "ISSignatureTextView");
+       gtk_widget_set_sensitive(awidget, gtk_toggle_button_get_active(button));
+}
+
+static void
+refresh_accounts_on_add(ModestAccountMgr *modest_acc_mgr,
+                       void *nu1,
+                       gpointer userdata)
+{
+       refresh_accounts(modest_acc_mgr, (GladeXML *) userdata);
+}
+
+static void
+refresh_accounts_on_remove(ModestAccountMgr *modest_acc_mgr,
+                       void *nu1,
+                       gpointer userdata) {
+
+       GladeXML *glade_xml = (GladeXML *) userdata;
+       GtkWidget *button;
+
+       refresh_accounts(modest_acc_mgr, (GladeXML *) userdata);
+       /* Since we loose the selection through the delete operation, we need to
+        * change the buttons sensitivity .
+        */
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "AccountEditButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "AccountDeleteButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
+}
+
+static void
+refresh_accounts_on_change(ModestAccountMgr *modest_acc_mgr,
+                          void *nu1,
+                          void *nu2,
+                          void *nu3,
+                          gpointer userdata)
+{
+       refresh_accounts(modest_acc_mgr, (GladeXML *) userdata);
+}
+
+static void
+refresh_identities_on_add(ModestIdentityMgr *modest_id_mgr,
+                         void *nu1,
+                         gpointer userdata) {
+       refresh_identities(modest_id_mgr, (GladeXML *) userdata);
+}
+
+static void
+refresh_identities_on_remove(ModestIdentityMgr *modest_id_mgr,
+                            void *nu1,
+                            gpointer userdata) {
+
+       GladeXML *glade_xml = (GladeXML *) userdata;
+       GtkWidget *button;
+
+       refresh_identities(modest_id_mgr, glade_xml);
+
+       /* Since we loose the selection through the delete operation, we need to
+        * change the buttons sensitivity .
+        */
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "IdentityEditButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
+       button = glade_xml_get_widget(GLADE_XML(glade_xml), "IdentityDeleteButton");
+       gtk_widget_set_sensitive(GTK_WIDGET(button), FALSE);
+}
+
+static void
+refresh_identities_on_change(ModestIdentityMgr *modest_id_mgr,
+                            void *nu1,
+                            void *nu2,
+                            void *nu3,
+                            gpointer userdata) {
+       refresh_identities(modest_id_mgr, (GladeXML *) userdata);
+}
+
+/* METHODS */
+
+static gboolean
+search_model_column_for_string_advanced(GtkTreeModel *model, GtkTreeIter *iter, gint ColNum, gchar *search, gboolean mcase) {
+
+       gchar *tmptext;
+       gboolean iter_true;
+
+       iter_true = gtk_tree_model_get_iter_first(model, iter);
+       while (iter_true) {
+               gtk_tree_model_get(model,
+                                  iter,
+                                  ColNum, &tmptext,
+                                  -1);
+               if ((mcase && strcasecmp(tmptext, search)==0)
+                   || strcmp(tmptext, search)==0) {
+                       g_free(tmptext);
+                       break;
+               }
+               g_free(tmptext);
+               iter_true = gtk_tree_model_iter_next(model, iter);
+               if (!iter_true) {
+                       break;
+               }
+       }
+       return iter_true;
+}
+
+static gboolean
+search_model_column_for_string(GtkTreeModel *model, GtkTreeIter *iter, gint ColNum, gchar *search) {
+       return search_model_column_for_string_advanced(model, iter, ColNum, search, FALSE);
+}
+
+static gboolean
+case_search_model_column_for_string(GtkTreeModel *model, GtkTreeIter *iter, gint ColNum, gchar *search) {
+       return search_model_column_for_string_advanced(model, iter, ColNum, search, TRUE);
+}
+
+static void
+refresh_identities(ModestIdentityMgr *modest_id_mgr,
+                  GladeXML *glade_xml) {
+
+       GtkTreeModel *id_liststore;
+       GtkTreeView *id_treeview;
+
+       id_treeview = GTK_TREE_VIEW(glade_xml_get_widget(glade_xml, "IdentitiesTreeview"));
+
+       id_liststore=create_identities_model(modest_id_mgr);
+       gtk_tree_view_set_model(GTK_TREE_VIEW(id_treeview), id_liststore);
+}
+
+static void
+refresh_accounts(ModestAccountMgr *modest_acc_mgr,
+                GladeXML *glade_xml) {
+
+       GtkTreeModel *acc_liststore;
+       GtkTreeView *acc_treeview;
+
+       acc_treeview = GTK_TREE_VIEW(glade_xml_get_widget(glade_xml, "AccountsTreeview"));
+
+       acc_liststore=create_accounts_model(modest_acc_mgr);
+       gtk_tree_view_set_model(GTK_TREE_VIEW(acc_treeview), acc_liststore);
+}
+
+static void
+missing_notification(GtkWindow *parent, gchar *info_message) {
+
+       GtkWidget *DenyDialog;
+
+       DenyDialog=gtk_message_dialog_new(parent,
+                                         GTK_DIALOG_MODAL,
+                                         GTK_MESSAGE_INFO,
+                                         GTK_BUTTONS_OK,
+                                         "%s",
+                                         info_message);
+
+       gtk_dialog_run(GTK_DIALOG(DenyDialog));
+
+       gtk_widget_destroy(DenyDialog);
+}
+
+static gboolean
+write_identity(GladeXML *glade_xml, ModestUI *modest_ui, GtkTreeModel *accounts_model, gboolean newidentity) {
+
+       GtkTextBuffer *sigbuff;
+       GtkTextIter start_iter;
+       GtkTextIter end_iter;
+       GtkTreeIter transport_iter;
+       ModestUIPrivate *priv;
+       const gchar *identity;
+       gchar *reply_to;
+       gchar *signature;
+       gchar *transport;
+
+       priv = MODEST_UI_GET_PRIVATE(MODEST_UI(modest_ui));
+
+       reply_to = g_strdup_printf("%s", gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ISReplyToEntry"))));
+
+       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(glade_xml_get_widget(glade_xml, "ISUseSignatureCheckButton"))))
+       {
+               sigbuff = gtk_text_view_get_buffer(GTK_TEXT_VIEW(glade_xml_get_widget(glade_xml, "ISSignatureTextView")));
+               gtk_text_buffer_get_bounds(sigbuff,
+                                          &start_iter,
+                                          &end_iter);
+               signature = gtk_text_buffer_get_text(sigbuff,
+                                                    &start_iter,
+                                                    &end_iter,
+                                                    FALSE);
+       }
+       else
+               signature = NULL;
+
+       if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(glade_xml_get_widget(glade_xml, "ISOutServerComboBox")), &transport_iter)) {
+               gtk_tree_model_get(GTK_TREE_MODEL(accounts_model),
+                                  &transport_iter,
+                                  ACCOUNT_NAME, &transport,
+                                  -1);
+       }
+       else {
+               missing_notification(NULL, "Please select an outgoing server!");
+               return FALSE;
+       }
+
+       identity = gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ISIdentityEntry")));
+
+       if (newidentity) {
+
+               if (modest_identity_mgr_add_identity (priv->modest_id_mgr,
+                                                     identity,
+                                                     NULL,
+                                                     gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ISEMailAddress"))),
+                                                     NULL,
+                                                     NULL,
+                                                     FALSE,
+                                                     NULL,
+                                                     FALSE));
+               else
+                       return FALSE;
+       }
+       if (!modest_identity_mgr_set_identity_string(priv->modest_id_mgr,
+                                                    identity,
+                                                    MODEST_IDENTITY_REALNAME,
+                                                    gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ISNameEntry"))),
+                                                    NULL))
+               return FALSE;
+       if (!modest_identity_mgr_set_identity_string(priv->modest_id_mgr,
+                                                    identity,
+                                                    MODEST_IDENTITY_EMAIL,
+                                                    gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ISEMailAddress"))),
+                                                    NULL))
+               return FALSE;
+       if (!modest_identity_mgr_set_identity_string(priv->modest_id_mgr,
+                                                    identity,
+                                                    MODEST_IDENTITY_REPLYTO,
+                                                    reply_to,
+                                                    NULL))
+               return FALSE;
+       if (!modest_identity_mgr_set_identity_string(priv->modest_id_mgr,
+                                                    identity,
+                                                    MODEST_IDENTITY_SIGNATURE,
+                                                    signature,
+                                                    NULL))
+               return FALSE;
+       if (!modest_identity_mgr_set_identity_bool(priv->modest_id_mgr,
+                                                  identity,
+                                                  MODEST_IDENTITY_USE_SIGNATURE,
+                                                  gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(glade_xml_get_widget(glade_xml,
+                                                                                                                      "ISUseSignatureCheckButton"))),
+                                                  NULL))
+               return FALSE;
+       if (!modest_identity_mgr_set_identity_string(priv->modest_id_mgr,
+                                                    identity,
+                                                    MODEST_IDENTITY_ID_VIA,
+                                                    transport,
+                                                    NULL))
+               return FALSE;
+       if (!modest_identity_mgr_set_identity_bool(priv->modest_id_mgr,
+                                                  identity,
+                                                  MODEST_IDENTITY_USE_ID_VIA,
+                                                  TRUE, /* FIXME: for now */
+                                                  NULL))
+               return FALSE;
+       g_free(transport);
+       return TRUE;
+}
+
+static gboolean
+write_account(GladeXML *glade_xml, ModestUI *modest_ui, gboolean newaccount) {
+
+       ModestUIPrivate *priv;
+       const gchar *account;
+       gchar *protocol;
+       gchar *tmptext;
+       gint retval;
+
+       priv = MODEST_UI_GET_PRIVATE(MODEST_UI(modest_ui));
+
+       account = gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ASDisplaynameEntry")));
+
+       if (newaccount) {
+               tmptext = gtk_combo_box_get_active_text(GTK_COMBO_BOX(glade_xml_get_widget(glade_xml, "ASProtocolComboBox")));
+               protocol = g_utf8_strdown(tmptext, -1);
+               g_free(tmptext);
+
+               retval = modest_account_mgr_add_server_account (priv->modest_acc_mgr,
+                                                               account,
+                                                               gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ASHostnameEntry"))),
+                                                               gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ASUsernameEntry"))),
+                                                               gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ASPasswordEntry"))),
+                                                               protocol);
+               g_free(protocol);
+               return retval;
+       }
+       if (!modest_account_mgr_set_server_account_string(priv->modest_acc_mgr,
+                                                         account,
+                                                         MODEST_ACCOUNT_HOSTNAME,
+                                                         gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ASHostnameEntry"))),
+                                                         NULL))
+               return FALSE;
+       if (!modest_account_mgr_set_server_account_string(priv->modest_acc_mgr,
+                                                         account,
+                                                         MODEST_ACCOUNT_USERNAME,
+                                                         gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ASUsernameEntry"))),
+                                                         NULL))
+               return FALSE;
+       if (!modest_account_mgr_set_server_account_string(priv->modest_acc_mgr,
+                                                         account,
+                                                         MODEST_ACCOUNT_PASSWORD,
+                                                         gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "ASPasswordEntry"))),
+                                                         NULL))
+               return FALSE;
+       return TRUE;
+}
+
+static void
+identity_setup_dialog (ModestUI *modest_ui, GtkTreeModel *accounts_model, gchar *identity)
+{
+
+       GladeXML *glade_xml;
+       GtkWidget *id_dialog;
+       GtkWidget *outgoing_server;
+       GtkWidget *awidget;
+       GtkCellRenderer *renderer;
+       ModestIdentityMgr *id_mgr;
+       GtkTextBuffer *sigbuff;
+       GtkTreeIter out_iter;
+       gchar *outacc_name;
+       gchar *tmptext;
+       gint identity_added_successfully;
+       gint result;
+       gboolean newidentity;
+
+       glade_xml = glade_xml_new(MODEST_GLADE, "IdentitySetupDialog", NULL);
+       id_dialog = glade_xml_get_widget(glade_xml, "IdentitySetupDialog");
+
+       outgoing_server = glade_xml_get_widget(glade_xml, "ISOutServerComboBox");
+       gtk_combo_box_set_model(GTK_COMBO_BOX(outgoing_server), GTK_TREE_MODEL(accounts_model));
+       renderer = gtk_cell_renderer_text_new ();
+       gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (outgoing_server), renderer, TRUE);
+       gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (outgoing_server), renderer,
+                                       "text", 0,
+                                       NULL);
+       awidget=glade_xml_get_widget(glade_xml, "ISUseSignatureCheckButton");
+       g_signal_connect(awidget,
+                        "toggled",
+                        G_CALLBACK(use_sig_toggled),
+                        glade_xml);
+
+       newidentity = identity==NULL;
+       if (!newidentity) {
+               id_mgr = MODEST_UI_GET_PRIVATE(modest_ui)->modest_id_mgr;
+
+               outacc_name = modest_identity_mgr_get_identity_string(id_mgr,
+                                                                     identity,
+                                                                     MODEST_IDENTITY_ID_VIA,
+                                                                     NULL);
+               if (search_model_column_for_string(GTK_TREE_MODEL(accounts_model),
+                                                  &out_iter,
+                                                  ACCOUNT_NAME,
+                                                  outacc_name))
+                       gtk_combo_box_set_active_iter(GTK_COMBO_BOX(outgoing_server), &out_iter);
+
+               awidget=glade_xml_get_widget(glade_xml, "ISIdentityEntry");
+               gtk_widget_set_sensitive(awidget, FALSE);
+               gtk_entry_set_text(GTK_ENTRY(awidget), identity);
+               tmptext = modest_identity_mgr_get_identity_string(id_mgr,
+                                                                 identity,
+                                                                 MODEST_IDENTITY_EMAIL,
+                                                                 NULL);
+               awidget=glade_xml_get_widget(glade_xml, "ISEMailAddress");
+               gtk_entry_set_text(GTK_ENTRY(awidget), tmptext);
+               g_free(tmptext);
+
+               if (modest_identity_mgr_get_identity_bool(id_mgr,
+                                                         identity,
+                                                         MODEST_IDENTITY_USE_SIGNATURE,
+                                                         NULL)) {
+                       awidget=glade_xml_get_widget(glade_xml, "ISUseSignatureCheckButton");
+                       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(awidget), TRUE);
+                       awidget=glade_xml_get_widget(glade_xml, "ISSignatureTextView");
+                       gtk_widget_set_sensitive(awidget, TRUE);
+               }
+
+               sigbuff=gtk_text_buffer_new(NULL);
+               tmptext = modest_identity_mgr_get_identity_string(id_mgr,
+                                                                 identity,
+                                                                 MODEST_IDENTITY_SIGNATURE,
+                                                                 NULL),
+               gtk_text_buffer_set_text(sigbuff, tmptext, -1);
+               gtk_text_view_set_buffer(GTK_TEXT_VIEW(glade_xml_get_widget(glade_xml, "ISSignatureTextView")),
+                                                      sigbuff);
+               g_object_unref(sigbuff);
+               g_free(tmptext);
+
+               tmptext = modest_identity_mgr_get_identity_string(id_mgr,
+                                                                 identity,
+                                                                 MODEST_IDENTITY_EMAIL,
+                                                                 NULL);
+               awidget=glade_xml_get_widget(glade_xml, "ISEMailAddress");
+               gtk_entry_set_text(GTK_ENTRY(awidget), tmptext);
+               g_free(tmptext);
+
+               tmptext = modest_identity_mgr_get_identity_string(id_mgr,
+                                                                 identity,
+                                                                 MODEST_IDENTITY_REALNAME,
+                                                                 NULL);
+               awidget=glade_xml_get_widget(glade_xml, "ISNameEntry");
+               gtk_entry_set_text(GTK_ENTRY(awidget), tmptext);
+               g_free(tmptext);
+
+               tmptext = modest_identity_mgr_get_identity_string(id_mgr,
+                                                                 identity,
+                                                                 MODEST_IDENTITY_REPLYTO,
+                                                                 NULL);
+               awidget=glade_xml_get_widget(glade_xml, "ISReplyToEntry");
+               gtk_entry_set_text(GTK_ENTRY(awidget), tmptext);
+
+               g_free(tmptext);
+               g_free(outacc_name);
+       }
+
+       gtk_widget_show_all(id_dialog);
+
+       do {
+               result=gtk_dialog_run(GTK_DIALOG(id_dialog));
+
+               switch (result) {
+               case GTK_RESPONSE_OK:
+                       identity_added_successfully = write_identity(glade_xml, modest_ui, accounts_model, newidentity);
+                       break;
+               default:
+                       identity_added_successfully = FALSE;
+                       break;
+               }
+       } while(result!=GTK_RESPONSE_DELETE_EVENT && result!=GTK_RESPONSE_CANCEL && identity_added_successfully!=TRUE);
+
+       gtk_widget_destroy(id_dialog);
+       g_object_unref(glade_xml);
+}
+
+static void
+account_setup_dialog (ModestUI *modest_ui, gchar *account) {
+
+       GladeXML *glade_xml;
+       GtkWidget *acc_dialog;
+       GtkWidget *awidget;
+       ModestAccountMgr *acc_mgr;
+       GtkTreeModel *typemodel;
+       GtkTreeIter proto_iter;
+       gchar *tmptext;
+       gint account_added_successfully;
+       gint result;
+       gboolean newaccount;
+
+       glade_xml = glade_xml_new(MODEST_GLADE, "AccountSetupDialog", NULL);
+       acc_dialog = glade_xml_get_widget(glade_xml, "AccountSetupDialog");
+
+       newaccount = account==NULL;
+       if (!newaccount) {
+               acc_mgr = MODEST_UI_GET_PRIVATE(modest_ui)->modest_acc_mgr;
+
+               awidget=glade_xml_get_widget(glade_xml, "ASDisplaynameEntry");
+               gtk_widget_set_sensitive(awidget, FALSE);
+               gtk_entry_set_text(GTK_ENTRY(awidget), account);
+
+               tmptext = modest_account_mgr_get_server_account_string(acc_mgr,
+                                                                      account,
+                                                                      MODEST_ACCOUNT_PROTO,
+                                                                      NULL);
+               awidget=glade_xml_get_widget(glade_xml, "ASProtocolComboBox");
+               gtk_widget_set_sensitive(awidget, FALSE);
+               typemodel = gtk_combo_box_get_model(GTK_COMBO_BOX(awidget));
+               if (case_search_model_column_for_string(typemodel, &proto_iter, 0, tmptext))
+                       gtk_combo_box_set_active_iter(GTK_COMBO_BOX(awidget), &proto_iter);
+
+               g_free(tmptext);
+
+               tmptext = modest_account_mgr_get_server_account_string(acc_mgr,
+                                                               account,
+                                                               MODEST_ACCOUNT_HOSTNAME,
+                                                               NULL);
+               awidget=glade_xml_get_widget(glade_xml, "ASHostnameEntry");
+               gtk_entry_set_text(GTK_ENTRY(awidget), tmptext);
+               g_free(tmptext);
+
+               tmptext = modest_account_mgr_get_server_account_string(acc_mgr,
+                                                               account,
+                                                               MODEST_ACCOUNT_USERNAME,
+                                                               NULL);
+               awidget=glade_xml_get_widget(glade_xml, "ASUsernameEntry");
+               gtk_entry_set_text(GTK_ENTRY(awidget), tmptext);
+               g_free(tmptext);
+
+               tmptext = modest_account_mgr_get_server_account_string(acc_mgr,
+                                                               account,
+                                                               MODEST_ACCOUNT_PASSWORD,
+                                                               NULL);
+               awidget=glade_xml_get_widget(glade_xml, "ASPasswordEntry");
+               gtk_entry_set_text(GTK_ENTRY(awidget), tmptext);
+               g_free(tmptext);
+       }
+
+       gtk_widget_show_all(acc_dialog);
+
+       do {
+               result=gtk_dialog_run(GTK_DIALOG(acc_dialog));
+
+               switch (result) {
+               case GTK_RESPONSE_OK:
+                       account_added_successfully = write_account(glade_xml, modest_ui, newaccount);
+
+                       break;
+               default:
+                       account_added_successfully = FALSE;
+                       break;
+               }
+       } while(result!=GTK_RESPONSE_DELETE_EVENT && result!=GTK_RESPONSE_CANCEL && account_added_successfully!=TRUE);
+
+       gtk_widget_destroy(acc_dialog);
+       g_object_unref(glade_xml);
+}
+
+
+static CallbackData *
+setup_callback_data(GtkTreeView *id_tree_view,
+                   GtkTreeView *acc_tree_view,
+                   ModestUI *modest_ui,
+                   GladeXML *glade_xml)
+{
+       CallbackData *self;
+       self = g_malloc(sizeof(CallbackData));
+       self->modest_ui=modest_ui;
+       self->id_tree_view=id_tree_view;
+       self->acc_tree_view=acc_tree_view;
+       self->glade_xml=glade_xml;
+       return self;
+}
+
+static void
+free_callback_data(CallbackData *data)
+{
+       g_free(data);
+}
+
+static GtkTreeModel *
+create_identities_model(ModestIdentityMgr *id_mgr) {
+
+       GSList *id_names_list;
+       GSList *id_names_list_iter;
+       GtkListStore *id_list_store;
+       GtkTreeIter id_list_store_iter;
+       gchar *tmptext1;
+       gchar *tmptext2;
+
+       id_names_list = modest_identity_mgr_identity_names(id_mgr, NULL);
+       id_list_store = gtk_list_store_new(IDENTITY_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+
+       for (id_names_list_iter=id_names_list;
+            id_names_list_iter!=NULL;
+            id_names_list_iter=g_slist_next(id_names_list_iter)) {
+               gtk_list_store_append(id_list_store, &id_list_store_iter);
+               tmptext1=modest_identity_mgr_get_identity_string(id_mgr,
+                                                                id_names_list_iter->data,
+                                                                MODEST_IDENTITY_EMAIL,
+                                                                NULL);
+               tmptext2=modest_identity_mgr_get_identity_string(id_mgr,
+                                                                id_names_list_iter->data,
+                                                                MODEST_IDENTITY_ID_VIA,
+                                                                NULL);
+               gtk_list_store_set(id_list_store, &id_list_store_iter,
+                                  IDENTITY_NAME, id_names_list_iter->data,
+                                  IDENTITY_ADDRESS, tmptext1,
+                                  IDENTITY_VIA, tmptext2,
+                                  -1);
+               g_free(tmptext1);
+               g_free(tmptext2);
+       }
+
+       g_slist_free(id_names_list);
+
+       return GTK_TREE_MODEL(id_list_store);
+}
+
+static GtkTreeModel *
+create_accounts_model(ModestAccountMgr *acc_mgr) {
+
+       GSList *acc_names_list;
+       GSList *acc_names_list_iter;
+       GtkListStore *acc_list_store;
+       GtkTreeIter acc_list_store_iter;
+       gchar *hostname;
+       gchar *protocol;
+
+       acc_names_list = modest_account_mgr_server_account_names(acc_mgr,
+                                                                NULL,
+                                                                MODEST_PROTO_TYPE_ANY,
+                                                                NULL,
+                                                                FALSE);
+       acc_list_store = gtk_list_store_new(ACCOUNT_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+
+       for (acc_names_list_iter=acc_names_list;
+            acc_names_list_iter!=NULL;
+            acc_names_list_iter=g_slist_next(acc_names_list_iter)) {
+               gtk_list_store_append(acc_list_store, &acc_list_store_iter);
+               hostname=modest_account_mgr_get_server_account_string(acc_mgr,
+                                                                     acc_names_list_iter->data,
+                                                                     MODEST_ACCOUNT_HOSTNAME,
+                                                                     NULL);
+               protocol=modest_account_mgr_get_server_account_string(acc_mgr,
+                                                                     acc_names_list_iter->data,
+                                                                     MODEST_ACCOUNT_PROTO,
+                                                                     NULL);
+               gtk_list_store_set(acc_list_store, &acc_list_store_iter,
+                                  ACCOUNT_NAME, acc_names_list_iter->data,
+                                  ACCOUNT_HOST, hostname,
+                                  ACCOUNT_PROT, protocol,
+                                  -1);
+               g_free(hostname);
+               g_free(protocol);
+       }
+
+       g_slist_free(acc_names_list);
+
+       return GTK_TREE_MODEL(acc_list_store);
+}
+
+
+static void
+accounts_and_identities_dialog (gpointer user_data)
+{
+       GladeXML *glade_xml;
+       GtkWidget *main_dialog;
+       GtkTreeView *identities_tree_view;
+       GtkTreeView *accounts_tree_view;
+       ModestUI *modest_ui;
+       ModestUIPrivate *priv;
+       gint sig_coll[6];
+       gint retval;
+       GtkCellRenderer *renderer;
+       GtkTreeViewColumn *column;
+       CallbackData *cb_data;
+       GtkWidget *abutton;
+
+       g_return_if_fail(MODEST_IS_UI(user_data));
+       modest_ui = (ModestUI *) user_data;
+       priv = MODEST_UI_GET_PRIVATE(modest_ui);
+
+       glade_xml = glade_xml_new(MODEST_GLADE, "IdentitiesAndAccountsDialog", NULL);
+       main_dialog = glade_xml_get_widget(glade_xml, "IdentitiesAndAccountsDialog");
+
+       /* Accounts */
+       accounts_tree_view = GTK_TREE_VIEW(glade_xml_get_widget(glade_xml, "AccountsTreeview"));
+       /* Account -> Accountname */
+       renderer = gtk_cell_renderer_text_new ();
+       column = gtk_tree_view_column_new_with_attributes ("Account",
+                                                          renderer,
+                                                          "text", ACCOUNT_NAME,
+                                                          NULL);
+       gtk_tree_view_append_column (accounts_tree_view, column);
+       /* Account -> Hostname */
+       renderer = gtk_cell_renderer_text_new ();
+       column = gtk_tree_view_column_new_with_attributes ("Hostname",
+                                                          renderer,
+                                                          "text", ACCOUNT_HOST,
+                                                          NULL);
+       gtk_tree_view_append_column (accounts_tree_view, column);
+
+       /* Identities */
+       identities_tree_view = GTK_TREE_VIEW(glade_xml_get_widget(glade_xml, "IdentitiesTreeview"));
+
+       /* Identities -> Identityname */
+       renderer = gtk_cell_renderer_text_new ();
+       column = gtk_tree_view_column_new_with_attributes ("Identity",
+                                                          renderer,
+                                                          "text", IDENTITY_NAME,
+                                                          NULL);
+       gtk_tree_view_append_column (identities_tree_view, column);
+
+       /* Identities -> E-mail address */
+       renderer = gtk_cell_renderer_text_new ();
+       column = gtk_tree_view_column_new_with_attributes ("E-mail address",
+                                                          renderer,
+                                                          "text", IDENTITY_ADDRESS,
+                                                          NULL);
+       gtk_tree_view_append_column (identities_tree_view, column);
+
+       /* Identities -> Relay */
+       renderer = gtk_cell_renderer_text_new ();
+       column = gtk_tree_view_column_new_with_attributes ("Transport",
+                                                          renderer,
+                                                          "text", IDENTITY_VIA,
+                                                          NULL);
+       gtk_tree_view_append_column (identities_tree_view, column);
+
+       cb_data=setup_callback_data(identities_tree_view, accounts_tree_view, modest_ui, glade_xml);
+
+       refresh_accounts(priv->modest_acc_mgr,
+                        glade_xml);
+
+       refresh_identities(priv->modest_id_mgr,
+                          glade_xml);
+
+       /* Identities */
+       abutton=glade_xml_get_widget(glade_xml, "IdentityCreateButton");
+       g_signal_connect(abutton,
+                        "clicked",
+                        G_CALLBACK(identity_create_action),
+                        cb_data);
+       abutton=glade_xml_get_widget(glade_xml, "IdentityEditButton");
+       g_signal_connect(abutton,
+                        "clicked",
+                        G_CALLBACK(identity_edit_action),
+                        cb_data);
+       abutton=glade_xml_get_widget(glade_xml, "IdentityDeleteButton");
+       g_signal_connect(abutton,
+                        "clicked",
+                        G_CALLBACK(identity_delete_action),
+                        cb_data);
+
+       /* Accounts */
+       abutton=glade_xml_get_widget(glade_xml, "AccountCreateButton");
+       g_signal_connect(abutton,
+                        "clicked",
+                        G_CALLBACK(account_create_action),
+                        cb_data);
+       abutton=glade_xml_get_widget(glade_xml, "AccountEditButton");
+       g_signal_connect(abutton,
+                        "clicked",
+                        G_CALLBACK(account_edit_action),
+                        cb_data);
+       abutton=glade_xml_get_widget(glade_xml, "AccountDeleteButton");
+       g_signal_connect(abutton,
+                        "clicked",
+                        G_CALLBACK(account_delete_action),
+                        cb_data);
+
+       g_signal_connect(glade_xml_get_widget(glade_xml, "IdentitiesTreeview"),
+                        "cursor-changed",
+                        G_CALLBACK(activate_buttons_on_identity),
+                        glade_xml);
+       g_signal_connect(glade_xml_get_widget(glade_xml, "AccountsTreeview"),
+                        "cursor-changed",
+                        G_CALLBACK(activate_buttons_on_account),
+                        glade_xml);
+
+       sig_coll[0] = g_signal_connect(priv->modest_id_mgr,
+                                      "identity-change",
+                                      G_CALLBACK(refresh_identities_on_change),
+                                      glade_xml);
+       sig_coll[1] = g_signal_connect(priv->modest_id_mgr,
+                                      "identity-add",
+                                      G_CALLBACK(refresh_identities_on_add),
+                                      glade_xml);
+       sig_coll[2] = g_signal_connect(priv->modest_id_mgr,
+                                      "identity-remove",
+                                      G_CALLBACK(refresh_identities_on_remove),
+                                      glade_xml);
+
+       sig_coll[3] = g_signal_connect(priv->modest_acc_mgr,
+                                      "account-change",
+                                      G_CALLBACK(refresh_accounts_on_change),
+                                      glade_xml);
+       sig_coll[4] = g_signal_connect(priv->modest_acc_mgr,
+                                      "account-add",
+                                      G_CALLBACK(refresh_accounts_on_add),
+                                      glade_xml);
+       sig_coll[5] = g_signal_connect(priv->modest_acc_mgr,
+                                      "account-remove",
+                                      G_CALLBACK(refresh_accounts_on_remove),
+                                      glade_xml);
+
+       gtk_widget_show_all(GTK_WIDGET(main_dialog));
+
+       retval=gtk_dialog_run(GTK_DIALOG(main_dialog));
+
+       g_signal_handler_disconnect(priv->modest_id_mgr, sig_coll[0]);
+       g_signal_handler_disconnect(priv->modest_id_mgr, sig_coll[1]);
+       g_signal_handler_disconnect(priv->modest_id_mgr, sig_coll[2]);
+       g_signal_handler_disconnect(priv->modest_acc_mgr, sig_coll[3]);
+       g_signal_handler_disconnect(priv->modest_acc_mgr, sig_coll[4]);
+       g_signal_handler_disconnect(priv->modest_acc_mgr, sig_coll[5]);
+
+       gtk_widget_destroy(GTK_WIDGET(main_dialog));
+       free_callback_data(cb_data);
+       g_object_unref(glade_xml);
+}
+
+void account_settings (GtkWidget *widget,
+                      gpointer user_data)
+{
+       accounts_and_identities_dialog (MODEST_UI(user_data));
+}
+
diff --git a/src/gtk/modest-ui-account-setup.h b/src/gtk/modest-ui-account-setup.h
new file mode 100644 (file)
index 0000000..cb2e80e
--- /dev/null
@@ -0,0 +1,20 @@
+/* modest-ui-account-setup.h */
+/* insert (c)/licensing information) */
+
+#ifndef __MODEST_UI_ACCOUNT_SETUP_H__
+#define __MODEST_UI_ACCOUNT_SETUP_H__
+
+#include "modest-ui-glade.h"
+
+/**
+ * account_settings:
+ * @GtkWidget: The widget by which this CALLBACK is called.
+ * @gpointer: user data set when the signal handler was connected. A
+ * ModestUI is needed here.
+ */
+void
+account_settings (GtkWidget *,
+                  gpointer);
+
+#endif /* __MODEST_UI_ACCOUNT_SETUP_H__ */
+
diff --git a/src/gtk/modest-ui-glade.h b/src/gtk/modest-ui-glade.h
new file mode 100644 (file)
index 0000000..7c66c73
--- /dev/null
@@ -0,0 +1,39 @@
+/* modest-ui-glade.h */
+/* insert (c)/licensing information) */
+
+#ifndef __MODEST_UI_GLADE_H__
+#define __MODEST_UI_GLADE_H__
+
+#include "../modest-ui.h"
+#include "../modest-account-mgr.h"
+#include "../modest-identity-mgr.h"
+#include "../modest-window-mgr.h"
+#include "../modest-tny-account-store.h"
+
+#define MODEST_GLADE          PREFIX "/share/modest/glade/modest.glade"
+#define MODEST_GLADE_MAIN_WIN "main"
+#define MODEST_GLADE_EDIT_WIN "new_mail"
+
+typedef struct _ModestUIPrivate ModestUIPrivate;
+struct _ModestUIPrivate {
+
+       ModestConf           *modest_conf;
+       ModestAccountMgr     *modest_acc_mgr;
+       ModestIdentityMgr    *modest_id_mgr;
+       ModestWindowMgr      *modest_window_mgr;
+       TnyAccountStoreIface *account_store;
+       GtkWidget            *folder_view;
+       GtkWidget            *header_view;
+       GtkWidget            *message_view;
+
+       GtkWindow            *main_window;
+       GladeXML             *glade_xml;
+
+       TnyMsgFolderIface    *current_folder;
+};
+
+#define MODEST_UI_GET_PRIVATE(o)      (G_TYPE_INSTANCE_GET_PRIVATE((o), \
+                                       MODEST_TYPE_UI, \
+                                       ModestUIPrivate))
+
+#endif /* __MODEST_UI_GLADE_H__ */
diff --git a/src/gtk/modest-ui-main-view.c b/src/gtk/modest-ui-main-view.c
new file mode 100644 (file)
index 0000000..631c0cb
--- /dev/null
@@ -0,0 +1,602 @@
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+#include <glib/gi18n.h>
+#include <string.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /*HAVE_CONFIG_H*/
+
+/* TODO: put in auto* */
+#include <tny-text-buffer-stream.h>
+#include <tny-msg-folder.h>
+
+#include "../modest-ui.h"
+#include "../modest-window-mgr.h"
+#include "../modest-account-mgr.h"
+#include "../modest-account-mgr.h"
+#include "../modest-identity-mgr.h"
+
+#include "../modest-tny-account-store.h"
+#include "../modest-tny-folder-tree-view.h"
+#include "../modest-tny-header-tree-view.h"
+#include "../modest-tny-msg-view.h"
+#include "../modest-tny-transport-actions.h"
+#include "../modest-tny-store-actions.h"
+
+#include "../modest-text-utils.h"
+#include "../modest-tny-msg-actions.h"
+
+#include "../modest-editor-window.h"
+
+#include "modest-ui-glade.h"
+#include "modest-ui-wizard.h"
+#include "modest-ui-account-setup.h"
+
+#include "modest-ui-main-view.h"
+#include "modest-ui-message-editor.h"
+#include "modest-ui-message-viewer.h"
+
+
+static GtkWidget* modest_main_window_folder_tree (ModestAccountMgr *modest_acc_mgr,
+                                                 TnyAccountStoreIface *account_store);
+
+static GtkWidget* modest_main_window_header_tree (TnyMsgFolderIface *folder);
+
+static void on_folder_clicked (ModestTnyFolderTreeView *folder_tree,
+                              TnyMsgFolderIface *folder,
+                              gpointer data);
+
+static void on_message_clicked (ModestTnyFolderTreeView *folder_tree,
+                               TnyMsgIface *message,
+                               gpointer data);
+
+static void on_reply_clicked (GtkWidget *widget, gpointer user_data);
+
+static void on_forward_clicked (GtkWidget *widget, gpointer user_data);
+
+static void on_delete_clicked (GtkWidget *widget, gpointer user_data);
+
+static void on_view_attachments_toggled(GtkWidget *widget, gpointer user_data);
+
+static void on_sendreceive_button_clicked (GtkWidget *widget, gpointer user_data);
+
+static void on_forward_attached_activated (GtkWidget *widget, gpointer user_data);
+
+static void on_headers_status_update (GtkWidget *header_view, const gchar *msg, gint status,
+                         gpointer user_data);
+static void on_status_cleanup (gpointer user_data);
+
+static void register_toolbar_callbacks (ModestUI *modest_ui);
+
+
+static void
+modest_ui_main_view_destroy (GtkWidget *win, GdkEvent *event, gpointer data)
+{
+       ModestUIPrivate *priv;
+
+       g_return_if_fail (data);
+       g_return_if_fail(MODEST_IS_UI(data));
+       priv = MODEST_UI_GET_PRIVATE((ModestUI *)data);
+       g_return_if_fail(priv);
+       if (!modest_window_mgr_unregister (priv->modest_window_mgr, G_OBJECT(win)))
+               g_warning ("modest window mgr: failed to unregister %p",
+                          G_OBJECT(win));
+       else
+               gtk_widget_hide(win);
+}
+
+
+gboolean
+modest_ui_show_main_window (ModestUI *modest_ui)
+{
+       GtkWidget       *win;
+       gint              height, width;
+       ModestUIPrivate *priv;
+       GtkWidget     *folder_view, *header_view;
+       GtkWidget     *message_view;
+       GtkWidget     *account_settings_item;
+       GtkWidget     *forward_attached_menu_item;
+       GtkWidget     *delete_item;
+       GtkWidget     *open_item;
+       GtkWidget     *view_attachments_item;
+       GtkWidget     *new_account_item;
+       
+       GtkWidget  *folder_view_holder,
+               *header_view_holder,
+               *mail_paned;
+       gboolean show_attachments_inline;
+
+       priv = MODEST_UI_GET_PRIVATE(modest_ui);
+       
+       height = modest_conf_get_int (priv->modest_conf,
+                                     MODEST_CONF_MAIN_WINDOW_HEIGHT,NULL);
+       width  = modest_conf_get_int (priv->modest_conf,
+                                     MODEST_CONF_MAIN_WINDOW_WIDTH,NULL);
+
+       win = glade_xml_get_widget (priv->glade_xml, "main");
+       if (!win) {
+               g_warning ("could not create main window");
+               return FALSE;
+       }
+
+       folder_view = GTK_WIDGET(modest_main_window_folder_tree(priv->modest_acc_mgr,
+                                                         priv->account_store));
+       priv->folder_view = folder_view;
+       folder_view_holder = glade_xml_get_widget (priv->glade_xml, "folders");
+       if (!folder_view||!folder_view_holder) {
+               g_warning ("failed to create folder tree");
+               return FALSE;
+       }
+       gtk_container_add (GTK_CONTAINER(folder_view_holder), folder_view);
+
+       header_view  =  GTK_WIDGET(modest_main_window_header_tree (NULL));
+       priv->header_view = header_view;
+       header_view_holder = glade_xml_get_widget (priv->glade_xml, "mail_list");
+       if (!header_view) {
+               g_warning ("failed to create header tree");
+               return FALSE;
+       }
+       gtk_container_add (GTK_CONTAINER(header_view_holder), header_view);
+
+       g_signal_connect (G_OBJECT(folder_view), "folder_selected",
+                         G_CALLBACK(on_folder_clicked), modest_ui);
+
+       show_attachments_inline = modest_conf_get_bool(priv->modest_conf,
+                                            MODEST_CONF_MSG_VIEW_SHOW_ATTACHMENTS_INLINE,
+                                            NULL);
+
+       message_view  = GTK_WIDGET(modest_tny_msg_view_new (NULL, show_attachments_inline));
+       priv->message_view = message_view;
+       if (!message_view) {
+               g_warning ("failed to create message view");
+               return FALSE;
+       }
+       g_signal_connect(G_OBJECT(message_view), "on_mailto_clicked",
+                     G_CALLBACK(ui_on_mailto_clicked), modest_ui);
+
+       mail_paned = glade_xml_get_widget (priv->glade_xml, "mail_paned");
+       gtk_paned_add2 (GTK_PANED(mail_paned), message_view);
+
+       g_signal_connect (header_view, "message_selected",
+                         G_CALLBACK(on_message_clicked),
+                          modest_ui);
+
+       g_signal_connect (header_view, "status_update",
+                         G_CALLBACK(on_headers_status_update), modest_ui);
+
+       g_signal_connect (header_view, "row-activated",
+                         G_CALLBACK(on_message_activated),
+                          modest_ui);
+
+       account_settings_item = glade_xml_get_widget (priv->glade_xml, "AccountSettingsMenuItem");
+       if (!account_settings_item) {
+               g_warning ("The account settings item isn't available!\n");
+               return FALSE;
+       }
+
+        g_signal_connect (account_settings_item, "activate",
+                          G_CALLBACK(account_settings), modest_ui);
+
+       new_account_item = glade_xml_get_widget (priv->glade_xml, "NewAccountWizardMenuItem");
+       if (!new_account_item) {
+               g_warning ("The new account item isn't available!\n");
+               return FALSE;
+       }
+
+       g_signal_connect (new_account_item, "activate",
+               G_CALLBACK(new_wizard_account), modest_ui);
+
+       open_item = glade_xml_get_widget (priv->glade_xml, "open1");
+       if (!open_item) {
+               g_warning ("The open item isn't available!\n");
+               return FALSE;
+       }
+       g_signal_connect (open_item, "activate", G_CALLBACK(on_open_message_clicked),
+                         modest_ui);
+
+       delete_item = glade_xml_get_widget (priv->glade_xml, "delete1");
+       if (!delete_item) {
+               g_warning ("The delete item isn't available!\n");
+               return FALSE;
+       }
+       g_signal_connect (delete_item, "activate", G_CALLBACK(on_delete_clicked),
+                         modest_ui);
+
+       view_attachments_item = glade_xml_get_widget (priv->glade_xml, "menu_view_attachments");
+       if (!view_attachments_item) {
+               g_warning ("The view_attachments_item isn't available!");
+               return FALSE;
+       }
+
+       forward_attached_menu_item = glade_xml_get_widget (priv->glade_xml, "forward_attached");
+       if (!forward_attached_menu_item) {
+               g_warning ("The forward_attached_menu_item isn't available!");
+               return FALSE;
+       }
+       g_signal_connect (forward_attached_menu_item, "activate", G_CALLBACK(on_forward_attached_activated),
+                         modest_ui);
+
+       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(view_attachments_item),
+                                       modest_conf_get_bool(priv->modest_conf,
+                                       MODEST_CONF_MSG_VIEW_SHOW_ATTACHMENTS_INLINE,
+                                       NULL));
+
+       g_signal_connect (view_attachments_item, "toggled",
+                               G_CALLBACK(on_view_attachments_toggled), modest_ui);
+
+       register_toolbar_callbacks (modest_ui);
+
+       modest_window_mgr_register (priv->modest_window_mgr,
+                                   G_OBJECT(win), MODEST_MAIN_WINDOW, 0);
+       g_signal_connect (win, "destroy-event", G_CALLBACK(modest_ui_main_view_destroy),
+                         modest_ui);
+       g_signal_connect (win, "delete-event", G_CALLBACK(modest_ui_main_view_destroy),
+                         modest_ui);
+       gtk_widget_set_usize (GTK_WIDGET(win), width, height);
+       gtk_window_set_title (GTK_WINDOW(win), PACKAGE_STRING);
+
+       gtk_widget_show_all (win);
+       return TRUE;
+}
+
+
+static void
+register_toolbar_callbacks (ModestUI *modest_ui)
+{
+       ModestUIPrivate *priv;
+       GtkWidget *button;
+
+       g_return_if_fail (modest_ui);
+
+       priv = MODEST_UI_GET_PRIVATE (modest_ui);
+
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_new_mail");
+       if (button)
+               g_signal_connect (button, "clicked",
+                                 G_CALLBACK(on_new_mail_clicked), modest_ui);
+
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_reply");
+       if (button) {
+               g_signal_connect (button, "clicked",
+                                 G_CALLBACK(on_reply_clicked), modest_ui);
+               gtk_widget_set_sensitive(button, FALSE);
+       }
+
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_reply_all");
+       if (button) {
+               //g_signal_connect (button, "clicked",
+               //                G_CALLBACK(on_reply_all_clicked), modest_ui);
+               gtk_widget_set_sensitive(button, FALSE);
+       }
+
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_forward");
+       if (button) {
+               g_signal_connect (button, "clicked",
+                                 G_CALLBACK(on_forward_clicked), modest_ui);
+               gtk_widget_set_sensitive(button, FALSE);
+       }
+
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_move_to");
+       if (button) {
+               //g_signal_connect (button, "clicked",
+               //                G_CALLBACK(on_move_to_clicked), modest_ui);
+               gtk_widget_set_sensitive(button, FALSE);
+       }
+
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_delete");
+       if (button) {
+               g_signal_connect (button, "clicked",
+                                 G_CALLBACK(on_delete_clicked), modest_ui);
+               gtk_widget_set_sensitive(button, FALSE);
+       }
+
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_send_receive");
+       if (button) {
+               g_signal_connect (button, "clicked",
+                                 G_CALLBACK(on_sendreceive_button_clicked), modest_ui);
+               gtk_widget_set_sensitive(button, TRUE);
+       }
+}
+
+
+static void
+on_folder_clicked (ModestTnyFolderTreeView *folder_tree,
+                  TnyMsgFolderIface *folder,
+                  gpointer data)
+{
+       GtkWidget *win;
+       GtkWidget *button;
+       ModestTnyHeaderTreeView *tree_view;
+       ModestTnyMsgView *msg_view;
+       ModestUIPrivate *priv;
+       GtkWidget *scrollview;
+
+       g_return_if_fail (folder);
+       g_return_if_fail (data);
+
+       priv = MODEST_UI_GET_PRIVATE(data);
+       scrollview = glade_xml_get_widget (priv->glade_xml,"mail_list");
+
+       tree_view = MODEST_TNY_HEADER_TREE_VIEW (priv->header_view);
+
+       win = glade_xml_get_widget (priv->glade_xml, "main");
+       gtk_window_set_title (GTK_WINDOW(win),
+                             tny_msg_folder_iface_get_name(folder));
+
+       modest_tny_header_tree_view_set_folder (tree_view, folder);
+       priv->current_folder = folder;
+
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_reply");
+       if (button) {
+               gtk_widget_set_sensitive(button, FALSE);
+       }
+
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_forward");
+       if (button) {
+               gtk_widget_set_sensitive(button, FALSE);
+       }
+
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_delete");
+       if (button) {
+               gtk_widget_set_sensitive(button, FALSE);
+       }
+
+       msg_view = MODEST_TNY_MSG_VIEW (priv->message_view);
+       g_return_if_fail (msg_view);
+
+       modest_tny_msg_view_set_message  (msg_view, NULL);
+}
+
+
+static void
+on_message_clicked (ModestTnyFolderTreeView *folder_tree,
+                               TnyMsgIface *message,
+                               gpointer data)
+{
+       GtkWidget *button;
+       ModestTnyMsgView *msg_view;
+       ModestUIPrivate *priv;
+
+       g_return_if_fail (data);
+
+       priv = MODEST_UI_GET_PRIVATE (data);
+       msg_view = MODEST_TNY_MSG_VIEW (priv->message_view);
+
+       modest_tny_msg_view_set_message (msg_view, message);
+       
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_reply");
+       if (button) {
+               gtk_widget_set_sensitive(button, TRUE);
+       }
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_forward");
+       if (button) {
+               gtk_widget_set_sensitive(button, TRUE);
+       }
+       button = glade_xml_get_widget (priv->glade_xml, "toolb_delete");
+       if (button) {
+               gtk_widget_set_sensitive(button, TRUE);
+       }
+}
+
+
+static GtkWidget*
+modest_main_window_header_tree (TnyMsgFolderIface *folder)
+{
+       int i;
+       GSList *columns = NULL;
+       GtkWidget *header_tree;
+       ModestTnyHeaderTreeViewColumn cols[] = {
+               MODEST_TNY_HEADER_TREE_VIEW_COLUMN_MSGTYPE,
+               MODEST_TNY_HEADER_TREE_VIEW_COLUMN_ATTACH,
+               MODEST_TNY_HEADER_TREE_VIEW_COLUMN_FROM,
+               MODEST_TNY_HEADER_TREE_VIEW_COLUMN_SUBJECT,
+               MODEST_TNY_HEADER_TREE_VIEW_COLUMN_RECEIVED_DATE
+       };
+
+       for (i = 0 ; i != sizeof(cols) / sizeof(ModestTnyHeaderTreeViewColumn); ++i)
+               columns = g_slist_append (columns, GINT_TO_POINTER(cols[i]));
+
+       header_tree = GTK_WIDGET(modest_tny_header_tree_view_new(folder, columns,
+                                                                MODEST_TNY_HEADER_TREE_VIEW_STYLE_NORMAL));
+       g_slist_free (columns);
+
+       if (!header_tree) {
+               g_warning ("could not create header tree");
+               return NULL;
+       }
+
+       return GTK_WIDGET(header_tree);
+}
+
+
+static GtkWidget*
+modest_main_window_folder_tree (ModestAccountMgr *modest_acc_mgr,
+                               TnyAccountStoreIface *account_store)
+{
+       GtkWidget *folder_tree;
+
+       folder_tree = GTK_WIDGET (modest_tny_folder_tree_view_new (account_store));
+       if (!folder_tree) {
+               g_warning ("could not create folder list");
+               return NULL;
+       }
+
+       return folder_tree;
+}
+
+
+static void
+on_reply_clicked (GtkWidget *widget, gpointer user_data)
+{
+       ModestUI *modest_ui = (ModestUI *)user_data;
+
+       quoted_send_msg (modest_ui, QUOTED_SEND_REPLY);
+}
+
+
+static void
+on_forward_clicked (GtkWidget *widget, gpointer user_data)
+{
+       ModestUI *modest_ui = (ModestUI *)user_data;
+
+       quoted_send_msg (modest_ui, QUOTED_SEND_FORWARD);
+}
+
+
+static void
+on_view_attachments_toggled(GtkWidget *widget, gpointer user_data)
+{
+       ModestUI *modest_ui = (ModestUI *)user_data;
+       GtkWidget *view_attachments_item;
+       ModestTnyMsgView *msg_view;
+       ModestUIPrivate *priv;
+       gboolean view_attachments_inline;
+
+       priv = MODEST_UI_GET_PRIVATE(modest_ui);
+       view_attachments_item = glade_xml_get_widget (priv->glade_xml, "menu_view_attachments");
+       g_return_if_fail(view_attachments_item);
+
+       msg_view = MODEST_TNY_MSG_VIEW(priv->message_view);
+
+       view_attachments_inline = gtk_check_menu_item_get_active(
+                                       GTK_CHECK_MENU_ITEM(view_attachments_item));
+
+       modest_conf_set_bool(priv->modest_conf,
+                            MODEST_CONF_MSG_VIEW_SHOW_ATTACHMENTS_INLINE,
+                            view_attachments_inline,
+                            NULL);
+
+       modest_tny_msg_view_set_show_attachments_inline_flag(msg_view, view_attachments_inline);
+}
+
+
+static void
+on_delete_clicked (GtkWidget *widget, gpointer user_data)
+{
+       ModestUI *modest_ui = (ModestUI *)user_data;
+       GtkTreeSelection *sel;
+       GtkTreeModel *model;
+       GtkTreeIter iter;
+       GtkTreeModel *mymodel;
+
+       ModestTnyHeaderTreeView *header_view;
+       ModestTnyMsgView *msg_view;
+       ModestUIPrivate *priv;
+
+       g_return_if_fail (modest_ui);
+
+       priv = MODEST_UI_GET_PRIVATE(modest_ui);
+
+       msg_view = MODEST_TNY_MSG_VIEW(priv->message_view);
+       g_return_if_fail (msg_view);
+
+       header_view = MODEST_TNY_HEADER_TREE_VIEW(priv->header_view);
+       g_return_if_fail (header_view);
+
+       sel = gtk_tree_view_get_selection (GTK_TREE_VIEW(header_view));
+       g_return_if_fail (sel);
+
+       /* get all selected mails */
+       if (G_LIKELY (gtk_tree_selection_get_selected (sel, &model, &iter))) {
+               TnyMsgHeaderIface *header;
+
+               gtk_tree_model_get (model, &iter, TNY_MSG_HEADER_LIST_MODEL_INSTANCE_COLUMN,
+                       &header, -1);
+
+               if (G_LIKELY (header)) {
+                       TnyMsgFolderIface *folder;
+                       // const TnyMsgIface *msg;
+
+                       if (GTK_IS_TREE_MODEL_SORT (model)) {
+                               mymodel = gtk_tree_model_sort_get_model
+                                       (GTK_TREE_MODEL_SORT (model));
+                       } else
+                               mymodel = model;
+
+                       folder = (TnyMsgFolderIface*)tny_msg_header_iface_get_folder (header);
+
+                       /* this will make the message as deleted */
+                       /*      tny_msg_folder_iface_expunge (folder); will finally delete messages */
+                       if (TNY_IS_MSG_FOLDER (folder))
+                               tny_msg_folder_iface_remove_message (folder, header);
+                       gtk_widget_queue_draw (GTK_WIDGET (header_view));
+               }
+       }
+}
+
+
+static void
+on_sendreceive_button_clicked (GtkWidget *widget, gpointer user_data)
+{
+       ModestUI *modest_ui = (ModestUI *)user_data;
+       ModestUIPrivate *priv;
+       TnyAccountStoreIface *account_store;
+       const GList *store_accounts;
+       const GList *iter;
+
+       g_return_if_fail (modest_ui);
+       priv = MODEST_UI_GET_PRIVATE(modest_ui);
+
+       account_store = priv->account_store;
+       store_accounts =
+               tny_account_store_iface_get_store_accounts (account_store);
+               
+       for (iter = store_accounts; iter; iter = iter->next) {
+               modest_tny_store_actions_update_folders (TNY_STORE_ACCOUNT_IFACE (iter->data));
+
+       }
+       
+       if (priv->header_view && priv->current_folder) {
+                       
+               modest_tny_header_tree_view_set_folder (MODEST_TNY_HEADER_TREE_VIEW(priv->header_view),
+                                                       priv->current_folder);
+               gtk_widget_queue_draw (priv->header_view);
+       }
+}
+static void
+on_forward_attached_activated (GtkWidget *widget, gpointer user_data)
+{
+       ModestUI *modest_ui = (ModestUI *)user_data;
+
+       quoted_send_msg (modest_ui, QUOTED_SEND_FORWARD_ATTACHED);
+}
+
+static void
+on_headers_status_update (GtkWidget *header_view, const gchar *msg, gint status_id,
+                         gpointer user_data)
+{
+       ModestUIPrivate *priv;
+       ModestUI *modest_ui;
+
+       GtkStatusbar *status_bar;
+       GtkProgressBar *progress_bar;
+       GtkWidget    *status_box;
+       
+       modest_ui = MODEST_UI (user_data);
+       priv      = MODEST_UI_GET_PRIVATE(modest_ui);
+
+       progress_bar = GTK_PROGRESS_BAR(glade_xml_get_widget
+                                       (priv->glade_xml, "progressbar"));
+       status_bar   = GTK_STATUSBAR  (glade_xml_get_widget
+                                      (priv->glade_xml, "statusbar"));
+
+       
+       status_box   = glade_xml_get_widget (priv->glade_xml, "statusbox");
+       
+       
+       if (!status_bar || !progress_bar) {
+               g_warning ("failed to find status / progress bar");
+               return;
+       }
+
+       if (msg && status_id) {
+               gtk_widget_show (status_box);
+               gtk_progress_bar_pulse (progress_bar);
+               gtk_statusbar_push (status_bar, status_id, msg);
+       } else {
+               gtk_widget_hide   (status_box);
+               gtk_statusbar_pop (status_bar, status_id);
+       }
+}              
+
diff --git a/src/gtk/modest-ui-main-view.h b/src/gtk/modest-ui-main-view.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/gtk/modest-ui-message-editor.c b/src/gtk/modest-ui-message-editor.c
new file mode 100644 (file)
index 0000000..9a7feab
--- /dev/null
@@ -0,0 +1,553 @@
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+#include <glib/gi18n.h>
+#include <string.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /*HAVE_CONFIG_H*/
+
+/* TODO: put in auto* */
+#include <tny-text-buffer-stream.h>
+#include <tny-msg-folder.h>
+
+#include "../modest-ui.h"
+#include "../modest-window-mgr.h"
+#include "../modest-account-mgr.h"
+#include "../modest-account-mgr.h"
+#include "../modest-identity-mgr.h"
+
+#include "../modest-tny-account-store.h"
+#include "../modest-tny-folder-tree-view.h"
+#include "../modest-tny-header-tree-view.h"
+#include "../modest-tny-msg-view.h"
+#include "../modest-tny-transport-actions.h"
+#include "../modest-tny-store-actions.h"
+
+#include "../modest-text-utils.h"
+#include "../modest-tny-msg-actions.h"
+
+#include "../modest-tny-attachment.h"
+
+#include "../modest-editor-window.h"
+
+#include "modest-ui-glade.h"
+#include "modest-ui-wizard.h"
+
+#include "modest-ui-message-editor.h"
+
+
+static void on_attach_button_clicked (GtkWidget *widget, ModestEditorWindow *modest_editwin);
+
+static void on_send_button_clicked (GtkWidget *widget, ModestEditorWindow *modest_editwin);
+
+
+typedef struct {
+       ModestUI *modest_ui;
+       ModestEditorWindow *edit_win;
+       GladeXML *glade_xml;
+       GList *attachments;
+} EditWinData;
+
+
+static gboolean close_edit_confirm_dialog(ModestEditorWindow *edit_win)
+{
+       GtkWidget *mdialog;
+       gint res;
+
+       mdialog = gtk_message_dialog_new(GTK_WINDOW(edit_win),
+                       GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                       GTK_MESSAGE_QUESTION,
+                       GTK_BUTTONS_YES_NO,
+                       _("Message was modified.\nDiscard Changes?"));
+       gtk_widget_show_all (mdialog);
+
+       res=gtk_dialog_run(GTK_DIALOG(mdialog));
+       gtk_widget_destroy (mdialog);
+       if (res == GTK_RESPONSE_YES)
+               return TRUE;
+       else
+               return FALSE;
+}
+
+static void
+close_edit_window (GtkWidget *win, GdkEvent *event, gpointer data)
+{
+       ModestEditorWindow *edit_win;
+       ModestUIPrivate *priv;
+       EditWinData *win_data;
+
+       edit_win = (ModestEditorWindow *)data;
+       win_data = modest_editor_window_get_data(edit_win);
+       priv = MODEST_UI_GET_PRIVATE(win_data->modest_ui);
+
+       // g_message("window was %s modified", modest_editor_window_get_modified(edit_win) ? "" : "not");
+
+       if (modest_editor_window_get_modified(edit_win)) {
+               if (close_edit_confirm_dialog(edit_win)) {
+                       gtk_widget_hide (GTK_WIDGET(edit_win));
+                       modest_window_mgr_unregister(priv->modest_window_mgr, G_OBJECT(edit_win));
+                       gtk_widget_destroy(GTK_WIDGET(edit_win));
+                       g_message("closing window");
+               } else {
+                       g_message("not closing window");
+               }
+       } else {
+               gtk_widget_hide (GTK_WIDGET(edit_win));
+               modest_window_mgr_unregister(priv->modest_window_mgr, G_OBJECT(edit_win));
+               gtk_widget_destroy(GTK_WIDGET(edit_win));
+               g_message("closing window");
+       }
+}
+
+
+GtkContainer
+*modest_ui_new_editor_window (ModestUI *modest_ui, gpointer *user_data)
+{
+       GtkWidget       *top_container;
+       GladeXML                *glade_xml;
+       EditWinData             *win_data;
+
+       glade_xml = glade_xml_new(MODEST_GLADE, "new_mail_top_container", NULL);
+       if (!glade_xml)
+               return NULL;
+
+       win_data = g_malloc(sizeof(EditWinData));
+       win_data->modest_ui = modest_ui;
+       win_data->glade_xml = glade_xml;
+       win_data->attachments = NULL;
+
+       *user_data = win_data;
+
+       top_container = glade_xml_get_widget(glade_xml, "new_mail_top_container");
+       if (!top_container) {
+               g_object_unref(G_OBJECT(glade_xml));
+               return NULL;
+       }
+       
+       return GTK_CONTAINER(top_container);
+}
+
+
+gboolean
+modest_ui_editor_window_set_to_header(const gchar *to, gpointer window_data)
+{
+       GladeXML *glade_xml;
+       GtkWidget *w;
+       EditWinData *win_data;
+
+       win_data = (EditWinData *)window_data;
+       glade_xml = win_data->glade_xml;
+       w = glade_xml_get_widget(glade_xml, "to_entry");
+       gtk_entry_set_text(GTK_ENTRY(w), to);
+
+       return TRUE;
+}
+
+
+gboolean
+modest_ui_editor_window_set_cc_header(const gchar *cc, gpointer window_data)
+{
+       GladeXML *glade_xml;
+       // GtkWidget *w;
+       EditWinData *win_data;
+
+       win_data = (EditWinData *)window_data;
+       glade_xml = win_data->glade_xml;
+/*
+       w = glade_xml_get_widget(glade_xml, "cc_entry");
+       gtk_entry_set_text(GTK_ENTRY(w), cc);
+*/
+       return TRUE;
+}
+
+
+gboolean
+modest_ui_editor_window_set_bcc_header(const gchar *bcc, gpointer window_data)
+{
+       GladeXML *glade_xml;
+       // GtkWidget *w;
+       EditWinData *win_data;
+
+       win_data = (EditWinData *)window_data;
+       glade_xml = win_data->glade_xml;
+/*
+       w = glade_xml_get_widget(glade_xml, "bcc_entry");
+       gtk_entry_set_text(GTK_ENTRY(w), bcc);
+*/
+       return TRUE;
+}
+
+
+gboolean
+modest_ui_editor_window_set_subject_header(const gchar *subject, gpointer window_data)
+{
+       GladeXML *glade_xml;
+       GtkWidget *w;
+       EditWinData *win_data;
+
+       win_data = (EditWinData *)window_data;
+       glade_xml = win_data->glade_xml;
+
+       w = glade_xml_get_widget(glade_xml, "subject_entry");
+       gtk_entry_set_text(GTK_ENTRY(w), subject);
+
+       return TRUE;
+}
+
+
+gboolean
+modest_ui_editor_window_set_body(const gchar *body, gpointer window_data)
+{
+       GladeXML *glade_xml;
+       GtkWidget *body_view;
+       GtkTextBuffer *buf;
+       EditWinData *win_data;
+
+       win_data = (EditWinData *)window_data;
+       glade_xml = win_data->glade_xml;
+
+       body_view = glade_xml_get_widget(glade_xml, "body_view");
+       buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(body_view));
+
+       gtk_text_buffer_set_text(GTK_TEXT_BUFFER(buf), body, -1);
+
+       return TRUE;
+}
+
+
+gboolean
+modest_ui_editor_window_update_attachments(gpointer window_data)
+{
+       GladeXML *glade_xml;
+       
+       glade_xml = ((EditWinData *) window_data)->glade_xml;
+
+       //body_view = glade_xml_get_widget(glade_xml, "body_view");
+       
+       return TRUE;
+}
+
+
+static
+void on_editor_entry_changed(GtkEditable *editable,
+                                            gpointer     user_data)
+{
+       GtkWidget *edit_win;
+       EditWinData *windata;
+
+       edit_win = (GtkWidget *)user_data;
+       windata = (EditWinData *)modest_editor_window_get_data(MODEST_EDITOR_WINDOW(edit_win));
+
+       modest_editor_window_set_modified(MODEST_EDITOR_WINDOW(edit_win), TRUE);
+}
+
+
+static
+void on_editor_buffer_changed (GtkTextBuffer *textbuffer,
+                                            gpointer       user_data)
+{
+       GtkWidget *edit_win;
+       
+       edit_win = (GtkWidget *)user_data;
+       modest_editor_window_set_modified(MODEST_EDITOR_WINDOW(edit_win), TRUE);
+}
+
+
+static void
+new_editor_with_presets (ModestUI *modest_ui, const gchar *to_header,
+                                                       const gchar *cc_header, const gchar *bcc_header,
+                                                       const gchar *subject_header, const gchar *body,
+                            const GList *attachments)
+{
+       GtkWidget *edit_win;
+       GladeXML *glade_xml;
+       GtkWidget *btn, *w;
+       GtkTextBuffer *buf;
+       EditWinData *windata;
+       ModestUIPrivate *priv;
+       gint height, width;
+
+       g_return_if_fail (modest_ui);
+
+       edit_win = modest_editor_window_new(modest_ui);
+       windata = (EditWinData *)modest_editor_window_get_data(MODEST_EDITOR_WINDOW(edit_win));
+       g_return_if_fail(windata);
+
+       glade_xml = windata->glade_xml;
+       btn = glade_xml_get_widget (glade_xml, "toolb_send");
+       g_signal_connect (btn, "clicked", G_CALLBACK(on_send_button_clicked),
+                         edit_win);
+       btn = glade_xml_get_widget (glade_xml, "toolb_attach");
+       g_signal_connect (btn, "clicked", G_CALLBACK(on_attach_button_clicked),
+                         edit_win);
+
+       w = glade_xml_get_widget (glade_xml, "to_entry");
+       g_signal_connect(w, "changed", G_CALLBACK(on_editor_entry_changed), edit_win);
+       w = glade_xml_get_widget (glade_xml, "subject_entry");
+       g_signal_connect(w, "changed", G_CALLBACK(on_editor_entry_changed), edit_win);
+       w = glade_xml_get_widget (glade_xml, "body_view");
+       buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(w));
+       g_signal_connect(buf, "changed", G_CALLBACK(on_editor_buffer_changed), edit_win);
+
+       g_signal_connect (edit_win, "destroy-event", G_CALLBACK(close_edit_window),
+                         edit_win);
+       g_signal_connect (edit_win, "delete-event", G_CALLBACK(close_edit_window),
+                         edit_win);
+
+       priv = MODEST_UI_GET_PRIVATE(modest_ui);
+       height = modest_conf_get_int (priv->modest_conf,
+                                         MODEST_CONF_EDIT_WINDOW_HEIGHT, NULL);
+       width  = modest_conf_get_int (priv->modest_conf,
+                                         MODEST_CONF_EDIT_WINDOW_WIDTH, NULL);
+
+       // g_message("new editor win@%dx%d", width, height);
+
+       gtk_widget_set_usize (GTK_WIDGET(edit_win), width, height);
+       if (strlen(subject_header) > 0)
+               gtk_window_set_title (GTK_WINDOW(edit_win), subject_header);
+       else
+               gtk_window_set_title (GTK_WINDOW(edit_win), _("Untitled"));
+
+       modest_window_mgr_register(priv->modest_window_mgr, G_OBJECT(edit_win), MODEST_EDIT_WINDOW, 0);
+
+       modest_editor_window_set_to_header(MODEST_EDITOR_WINDOW(edit_win), to_header);
+       modest_editor_window_set_cc_header(MODEST_EDITOR_WINDOW(edit_win), cc_header);
+       modest_editor_window_set_bcc_header(MODEST_EDITOR_WINDOW(edit_win), bcc_header);
+       modest_editor_window_set_subject_header(MODEST_EDITOR_WINDOW(edit_win), subject_header);
+       modest_editor_window_set_body(MODEST_EDITOR_WINDOW(edit_win), body);
+       modest_editor_window_set_attachments(MODEST_EDITOR_WINDOW(edit_win), attachments);
+
+       modest_editor_window_set_modified(MODEST_EDITOR_WINDOW(edit_win), FALSE);
+
+       gtk_widget_show(edit_win);
+}
+
+
+void
+on_new_mail_clicked (GtkWidget *widget, gpointer user_data)
+{
+       ModestUI *modest_ui = (ModestUI *) user_data;
+
+       new_editor_with_presets(modest_ui, "", "", "", "", "", NULL);
+}
+
+void
+ui_on_mailto_clicked (GtkWidget *widget, const gchar *uri, gpointer user_data)
+{
+       ModestUI *modest_ui = (ModestUI *) user_data;
+       
+       new_editor_with_presets(modest_ui, uri, "", "", "", "", NULL);
+}
+
+
+void
+quoted_send_msg (ModestUI *modest_ui, quoted_send_type qstype)
+{
+       GtkTreeSelection *sel;
+       GtkTreeModel *model;
+       GtkTreeIter iter;
+
+       TnyMsgHeaderIface *header;
+
+       ModestTnyHeaderTreeView *header_view;
+       ModestTnyMsgView *msg_view;
+       ModestUIPrivate *priv;
+
+       const TnyMsgIface *msg;
+       const TnyMsgFolderIface *folder;
+       GString *re_sub;
+       const gchar *subject, *from;
+       gchar *unquoted, *quoted;
+       time_t sent_date;
+       gint line_limit = 76;
+       
+       GList *attachments = NULL;
+
+       g_return_if_fail (modest_ui);
+
+       priv = MODEST_UI_GET_PRIVATE(modest_ui);
+
+       msg_view = MODEST_TNY_MSG_VIEW(priv->message_view);
+       g_return_if_fail (msg_view);
+
+       header_view = MODEST_TNY_HEADER_TREE_VIEW(priv->header_view);
+       g_return_if_fail (header_view);
+
+       sel = gtk_tree_view_get_selection (GTK_TREE_VIEW(header_view));
+       g_return_if_fail (sel);
+
+       if (!gtk_tree_selection_get_selected (sel, &model, &iter)) {
+               g_warning("nothing to reply to");
+               return;
+       }
+
+       gtk_tree_model_get (model, &iter,
+                           TNY_MSG_HEADER_LIST_MODEL_INSTANCE_COLUMN,
+                           &header, -1);
+
+       if (!header) {
+               g_warning("no header");
+               return;
+       }
+
+       folder = tny_msg_header_iface_get_folder (TNY_MSG_HEADER_IFACE(header));
+       if (!folder) {
+               g_warning ("cannot find folder");
+               return;
+       }
+
+       msg = tny_msg_folder_iface_get_message (TNY_MSG_FOLDER_IFACE(folder), header);
+       if (!msg) {
+               g_warning ("cannot find msg");
+               return;
+       }
+
+       subject = tny_msg_header_iface_get_subject(header);
+       re_sub = g_string_new(subject);
+       /* FIXME: honor replyto, cc */
+       from = tny_msg_header_iface_get_from(header);
+       sent_date = tny_msg_header_iface_get_date_sent(header);
+
+       unquoted = modest_tny_msg_view_get_selected_text(msg_view);
+       quoted = modest_tny_msg_actions_quote(msg, from, sent_date, line_limit, unquoted);
+
+       switch (qstype) {
+               case QUOTED_SEND_REPLY:
+                       g_string_prepend(re_sub, _("Re: "));
+                       new_editor_with_presets(modest_ui, from, /* cc */ "", /* bcc */ "", re_sub->str, quoted, attachments);
+                       break;
+               case QUOTED_SEND_FORWARD:
+                       attachments = modest_tny_attachment_new_list_from_msg(msg, FALSE);
+                       g_string_prepend(re_sub, _("Fwd: "));
+                       new_editor_with_presets(modest_ui, /* from */ "", /* cc */ "", /* bcc */ "", re_sub->str, quoted, attachments);
+                       break;
+               case QUOTED_SEND_FORWARD_ATTACHED:
+                       attachments = modest_tny_attachment_new_list_from_msg(msg, TRUE);
+                       g_string_prepend(re_sub, _("Fwd: "));
+                       new_editor_with_presets(modest_ui, /* from */ "", /* cc */ "", /* bcc */ "", re_sub->str, "", attachments);
+                       break;
+               default:
+                       break;
+       }
+       g_free(quoted);
+       g_free(unquoted);
+       g_string_free(re_sub, TRUE);
+}
+
+
+static void
+on_attach_button_clicked (GtkWidget *widget, ModestEditorWindow *modest_editwin)
+{
+       /* open file selector */
+       GtkWidget *dialog;
+       ModestTnyAttachment *attachment;
+       gchar *filename = NULL;
+       
+       dialog = gtk_file_chooser_dialog_new ("Open File",
+                                                                                 GTK_WINDOW(modest_editwin),
+                                                                                 GTK_FILE_CHOOSER_ACTION_OPEN,
+                                                                                 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                                                                                 GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+                                                                                 NULL);
+
+       if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
+       {
+
+               filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+               printf ("file:%s\n", filename);
+       }
+       gtk_widget_destroy (dialog);
+      
+       /* check file */
+       if (!filename)
+               return;
+       
+       attachment = modest_tny_attachment_new();
+       modest_tny_attachment_set_filename(attachment, filename);
+       modest_tny_attachment_guess_mime_type(attachment);
+       
+       modest_editor_window_attach_file(modest_editwin, attachment);
+       
+       g_free (filename);
+}
+
+
+static void
+on_send_button_clicked (GtkWidget *widget, ModestEditorWindow *modest_editwin)
+{
+       ModestTnyTransportActions *actions;
+       ModestUI *modest_ui;
+       ModestUIPrivate *priv;
+       GtkWidget *to_entry, *subject_entry, *body_view;
+       const gchar *to, *subject, *email_from;
+       gchar *body;
+       GtkTextIter start, end;
+       GtkTextBuffer *buf;
+       TnyAccountStoreIface *account_store;
+       const GList *transport_accounts;
+       TnyTransportAccountIface *transport_account;
+       ModestIdentityMgr *id_mgr;
+       EditWinData *win_data;
+       GList * attachments;
+
+
+       win_data = modest_editor_window_get_data(modest_editwin);
+       modest_ui = win_data->modest_ui;
+
+       g_return_if_fail (modest_ui);
+
+       actions = MODEST_TNY_TRANSPORT_ACTIONS
+               (modest_tny_transport_actions_new ());
+
+       priv = MODEST_UI_GET_PRIVATE(modest_ui);
+
+       account_store = priv->account_store;
+       transport_accounts =
+               tny_account_store_iface_get_transport_accounts (account_store);
+       if (!transport_accounts) {
+               g_message ("cannot send message: no transport account defined");
+               return;
+       } else /* take the first one! */
+               transport_account =
+                       TNY_TRANSPORT_ACCOUNT_IFACE(transport_accounts->data);
+
+       to_entry      = glade_xml_get_widget (win_data->glade_xml, "to_entry");
+       subject_entry = glade_xml_get_widget (win_data->glade_xml, "subject_entry");
+       body_view     = glade_xml_get_widget (win_data->glade_xml, "body_view");
+
+       to      = gtk_entry_get_text (GTK_ENTRY(to_entry));
+       subject = gtk_entry_get_text (GTK_ENTRY(subject_entry));
+
+       buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(body_view));
+       gtk_text_buffer_get_bounds (buf, &start, &end);
+       body    = gtk_text_buffer_get_text (buf, &start, &end, FALSE);
+
+       id_mgr = priv->modest_id_mgr;
+       email_from = modest_identity_mgr_get_identity_string(id_mgr,
+                                                            MODEST_IDENTITY_DEFAULT_IDENTITY,
+                                                            MODEST_IDENTITY_EMAIL, NULL);
+       attachments = modest_editor_window_get_attachments(modest_editwin);
+       if (!email_from)
+               email_from = "";
+       
+       g_message("sending \"%s\" %s ==> %s", subject, email_from, to);
+
+       modest_tny_transport_actions_send_message (actions,
+                                                  transport_account,
+                                                  email_from,
+                                                  to, "", "", subject,
+                                                  body,
+                                                  attachments);
+
+       modest_editor_window_set_attachments(modest_editwin, NULL); /* This unrefs them, too. */
+       g_free (body);
+       g_object_unref (G_OBJECT(actions));
+
+       gtk_widget_hide (GTK_WIDGET(modest_editwin));
+       modest_window_mgr_unregister(priv->modest_window_mgr, G_OBJECT(modest_editwin));
+       if (GTK_IS_WIDGET(modest_editwin)) {
+               gtk_widget_destroy(GTK_WIDGET(modest_editwin));
+       } else
+               g_warning("editor window has vanished!");
+}
diff --git a/src/gtk/modest-ui-message-editor.h b/src/gtk/modest-ui-message-editor.h
new file mode 100644 (file)
index 0000000..c003927
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef _MODEST_UI_MESSAGE_EDITOR_H
+#define _MODEST_UI_MESSAGE_EDITOR_H
+
+typedef enum {
+       QUOTED_SEND_REPLY,
+       QUOTED_SEND_REPLY_ALL,
+       QUOTED_SEND_FORWARD,
+       QUOTED_SEND_FORWARD_ATTACHED
+} quoted_send_type;
+
+/**
+ * quoted_send_msg:
+ * @modest_ui: a ModestUI instance
+ * @qstype: determines whether to REPLY, REPLY_ALL or FORWARD
+ *
+ * open a new editor window quoting the currently selected message
+ * the quote type determines which parts are to be quoted
+ */
+void quoted_send_msg (ModestUI *modest_ui, quoted_send_type qstype);
+
+/**
+ * on_new_mail_clicked:
+ * @widget: the button widget that received the signal
+ * @user_data: pointer to user-data, here ModestUI
+ *
+ * callback used in main-window
+ * called when user presses the "New Mail" button
+ */
+void on_new_mail_clicked (GtkWidget *widget, gpointer user_data);
+
+void ui_on_mailto_clicked (GtkWidget *widget, const gchar * uri, gpointer user_data);
+#endif /* _MODEST_UI_MESSAGE_EDITOR_H */
diff --git a/src/gtk/modest-ui-message-viewer.c b/src/gtk/modest-ui-message-viewer.c
new file mode 100644 (file)
index 0000000..4a50fbb
--- /dev/null
@@ -0,0 +1,200 @@
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+#include <glib/gi18n.h>
+#include <string.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /*HAVE_CONFIG_H*/
+
+/* TODO: put in auto* */
+#include <tny-text-buffer-stream.h>
+#include <tny-msg-folder.h>
+
+#include "../modest-ui.h"
+#include "../modest-window-mgr.h"
+#include "../modest-account-mgr.h"
+#include "../modest-account-mgr.h"
+#include "../modest-identity-mgr.h"
+
+#include "../modest-tny-account-store.h"
+#include "../modest-tny-folder-tree-view.h"
+#include "../modest-tny-header-tree-view.h"
+#include "../modest-tny-msg-view.h"
+#include "../modest-tny-transport-actions.h"
+#include "../modest-tny-store-actions.h"
+
+#include "../modest-text-utils.h"
+#include "../modest-tny-msg-actions.h"
+
+#include "../modest-viewer-window.h"
+
+#include "modest-ui-glade.h"
+#include "modest-ui-message-viewer.h"
+
+
+
+typedef struct {
+       ModestUI *modest_ui;
+       ModestViewerWindow *viewer_win;
+       GladeXML *glade_xml;
+} ViewerWinData;
+
+
+GtkContainer
+*modest_ui_new_viewer_window (ModestUI *modest_ui, GtkWidget *msg_view, TnyMsgIface *msg, gpointer *user_data)
+{
+       GtkWidget       *top_container;
+       GladeXML        *glade_xml;
+       ViewerWinData   *win_data;
+       GtkWidget       *paned;
+
+       glade_xml = glade_xml_new(MODEST_GLADE, "viewer_top_container", NULL);
+       if (!glade_xml)
+               return NULL;
+
+       win_data = g_malloc(sizeof(ViewerWinData));
+       win_data->modest_ui = modest_ui;
+       win_data->glade_xml = glade_xml;
+
+       *user_data = win_data;
+
+       top_container = glade_xml_get_widget(glade_xml, "viewer_top_container");
+       if (!top_container) {
+               g_object_unref(G_OBJECT(glade_xml));
+               return NULL;
+       }
+
+       if (!GTK_IS_WIDGET(msg_view))
+               return NULL;
+       paned = glade_xml_get_widget(glade_xml, "vpaned3");
+       gtk_paned_add2(GTK_PANED(paned), msg_view);
+       gtk_widget_show_all(msg_view);
+
+       return GTK_CONTAINER(top_container);
+}
+
+
+static void
+close_viewer_window(GtkWidget *win, GdkEvent *event, gpointer data)
+{
+       ModestViewerWindow *viewer_win;
+       ModestUIPrivate *priv;
+       ViewerWinData *win_data;
+
+       viewer_win = (ModestViewerWindow *)data;
+       win_data = modest_viewer_window_get_data(viewer_win);
+       priv = MODEST_UI_GET_PRIVATE(win_data->modest_ui);
+
+       modest_window_mgr_unregister(priv->modest_window_mgr, G_OBJECT(viewer_win));
+       gtk_widget_hide (GTK_WIDGET(viewer_win));
+       gtk_widget_destroy(GTK_WIDGET(viewer_win));
+}
+
+
+static void
+open_message_viewer_window(ModestUI *modest_ui)
+{
+       GtkWidget *viewer_win;
+       ModestUIPrivate *priv;
+       gint width, height;
+       ViewerWinData *windata;
+       GtkWidget *paned;
+       GtkTreeSelection *sel;
+       GtkTreeModel *model;
+       GtkTreeIter iter;
+       GtkScrolledWindow *scroll;
+       ModestTnyHeaderTreeView *header_view;
+       TnyMsgHeaderIface *header;
+       const TnyMsgFolderIface *folder;
+       TnyMsgIface *msg;
+       const gchar *subject, *to, *from;
+       time_t sent_date;
+       gchar date_str[101];
+       GtkWidget *w;
+
+       priv = MODEST_UI_GET_PRIVATE(modest_ui);
+       /* FIXME: maybe use seperate viewer defaults? */
+       height = modest_conf_get_int (priv->modest_conf, MODEST_CONF_EDIT_WINDOW_HEIGHT, NULL);
+       width  = modest_conf_get_int (priv->modest_conf, MODEST_CONF_EDIT_WINDOW_WIDTH, NULL);
+
+       paned = glade_xml_get_widget (priv->glade_xml,"mail_paned");
+       g_return_if_fail (paned);
+
+       scroll = GTK_SCROLLED_WINDOW(gtk_paned_get_child1 (GTK_PANED(paned)));
+        g_return_if_fail (scroll);
+
+       header_view = MODEST_TNY_HEADER_TREE_VIEW(gtk_bin_get_child (GTK_BIN(scroll)));
+       g_return_if_fail (header_view);
+
+       sel = gtk_tree_view_get_selection (GTK_TREE_VIEW(header_view));
+       g_return_if_fail (sel);
+
+       if (!gtk_tree_selection_get_selected (sel, &model, &iter)) {
+               g_warning("nothing to display");
+               return;
+       }
+
+       gtk_tree_model_get (model, &iter,
+               TNY_MSG_HEADER_LIST_MODEL_INSTANCE_COLUMN, &header, -1);
+
+       if (!header) {
+               g_warning("no header");
+               return;
+       }
+
+       folder = tny_msg_header_iface_get_folder (TNY_MSG_HEADER_IFACE(header));
+       if (!folder) {
+               g_warning ("cannot find folder");
+               return;
+       }
+
+       msg = (TnyMsgIface *) tny_msg_folder_iface_get_message (TNY_MSG_FOLDER_IFACE(folder), header);
+       if (!msg) {
+               g_warning ("cannot find msg");
+               return;
+       }
+
+       viewer_win = modest_viewer_window_new(modest_ui, msg);
+       windata = (ViewerWinData *)modest_viewer_window_get_data(MODEST_VIEWER_WINDOW(viewer_win));
+       g_return_if_fail(windata);
+
+       subject = tny_msg_header_iface_get_subject(header);
+       from = tny_msg_header_iface_get_from(header);
+       to = tny_msg_header_iface_get_to(header);
+       sent_date = tny_msg_header_iface_get_date_sent(header);
+       strftime (date_str, 100, "%c", localtime (&sent_date));
+
+       w = glade_xml_get_widget (windata->glade_xml, "from");
+       gtk_label_set_text(GTK_LABEL(w), from);
+       w = glade_xml_get_widget (windata->glade_xml, "to");
+       gtk_label_set_text(GTK_LABEL(w), to);
+       w = glade_xml_get_widget (windata->glade_xml, "subject");
+       gtk_label_set_text(GTK_LABEL(w), subject);
+       w = glade_xml_get_widget (windata->glade_xml, "date");
+       gtk_label_set_text(GTK_LABEL(w), date_str);
+
+       // g_message("new viewer win@%dx%d", width, height);
+       gtk_widget_set_usize (GTK_WIDGET(viewer_win), width, height);
+       gtk_widget_show(viewer_win);
+       modest_window_mgr_register(priv->modest_window_mgr, G_OBJECT(viewer_win), MODEST_VIEW_WINDOW, 0);
+       g_signal_connect (viewer_win, "destroy-event", G_CALLBACK(close_viewer_window), viewer_win);
+       g_signal_connect (viewer_win, "delete-event", G_CALLBACK(close_viewer_window), viewer_win);
+}
+
+
+void
+on_open_message_clicked (GtkWidget *widget, gpointer user_data)
+{
+       ModestUI *modest_ui = (ModestUI *)user_data;
+
+       open_message_viewer_window(modest_ui);
+}
+
+void
+on_message_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
+{
+       ModestUI *modest_ui = (ModestUI *)user_data;
+
+       open_message_viewer_window(modest_ui);
+}
diff --git a/src/gtk/modest-ui-message-viewer.h b/src/gtk/modest-ui-message-viewer.h
new file mode 100644 (file)
index 0000000..447aaf3
--- /dev/null
@@ -0,0 +1,17 @@
+
+#ifndef _MODEST_UI_MESSAGE_VIEWER_H
+#define _MODEST_UI_MESSAGE_VIEWER_H
+
+/*
+ * callback used in main-window
+ * called when the menu-item "Open" is activated
+ */
+void on_open_message_clicked (GtkWidget *widget, gpointer user_data);
+
+/*
+ * callback used in main-window
+ * called when double clicking on a message header
+ */
+void on_message_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data);
+
+#endif /* _MODEST_UI_MESSAGE_VIEWER_H */
diff --git a/src/gtk/modest-ui-wizard.c b/src/gtk/modest-ui-wizard.c
new file mode 100644 (file)
index 0000000..3edf494
--- /dev/null
@@ -0,0 +1,303 @@
+/* modest-ui-wizard.c */
+
+/* insert (c)/licensing information) */
+
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+#include <glib/gi18n.h>
+#include <string.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /*HAVE_CONFIG_H*/
+
+#include "../modest-account-mgr.h"
+#include "../modest-identity-mgr.h"
+
+#include "modest-ui-glade.h"
+#include "modest-ui-wizard.h"
+
+
+static void wizard_incoming_button_toggled(GtkWidget *button,
+                                          gpointer userdata) {
+       GtkWidget *awidget;
+       if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button))==TRUE) {
+               awidget=glade_xml_get_widget(GLADE_XML(userdata), "AWOutUserNameEntry");
+               gtk_widget_set_sensitive(GTK_WIDGET(awidget), FALSE);
+               awidget=glade_xml_get_widget(GLADE_XML(userdata), "AWOutPasswordEntry");
+               gtk_widget_set_sensitive(GTK_WIDGET(awidget), FALSE);
+       }
+       else {
+               awidget=glade_xml_get_widget(GLADE_XML(userdata), "AWOutUserNameEntry");
+               gtk_widget_set_sensitive(GTK_WIDGET(awidget), TRUE);
+               awidget=glade_xml_get_widget(GLADE_XML(userdata), "AWOutPasswordEntry");
+               gtk_widget_set_sensitive(GTK_WIDGET(awidget), TRUE);
+       }
+}
+
+void wizard_missing_notification(GtkWindow *parent, gchar *info_message) {
+        GtkWidget *DenyDialog;
+
+        DenyDialog=gtk_message_dialog_new(parent,
+                                          GTK_DIALOG_MODAL,
+                                          GTK_MESSAGE_INFO,
+                                          GTK_BUTTONS_OK,
+                                          "%s",
+                                          info_message);
+
+        gtk_dialog_run(GTK_DIALOG(DenyDialog));
+
+        gtk_widget_destroy(DenyDialog);
+}
+
+gchar *get_text_from_combobox (GtkWidget *combobox){
+        /* Remember to free the returned variable after usage! */
+
+       GtkTreeModel *model = gtk_combo_box_get_model(GTK_COMBO_BOX(combobox));
+       GtkTreeIter iter;
+
+       gchar *value;
+
+       if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combobox), &iter)) {
+               gtk_tree_model_get(GTK_TREE_MODEL(model),
+                                  &iter,
+                                  0, &value,
+                                  -1);
+       }
+
+        return value;
+}
+
+
+gboolean advance_sanity_check(GladeXML *glade_xml, gint cp) {
+        gchar *tmptext;
+
+       /* FIXME:
+        * all calls to wizard_missing_notification lack the parent window.
+        */
+
+        switch (cp) {
+       case 1:
+               /* Only needed if the "mailbox name" field is used in the first page of the wizard.
+                 * if (strlen(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWMailboxnameEntry"))))==0)
+                 * {
+                 *         wizard_missing_notification(NULL, "Please enter mailbox name");
+                 *         return FALSE;
+                * }
+                */
+               if (strlen(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWEMailAddressEntry"))))==0) {
+                       wizard_missing_notification(NULL, "Please enter the E-Mail address.");
+                       return FALSE;
+               }
+                return TRUE;
+               break;
+       case 2:
+                tmptext=gtk_combo_box_get_active_text(GTK_COMBO_BOX(glade_xml_get_widget(glade_xml, "AWMailboxtypeComboBox")));
+                if (tmptext==NULL) {
+                        wizard_missing_notification(NULL, "Please select mailbox type.");
+                        return FALSE;
+               }
+               g_free(tmptext);
+               if (strlen(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWInServerComboEntry"))))==0) {
+                       wizard_missing_notification(NULL, "Please specify incoming server adress.");
+                       return FALSE;
+               }
+               if (strlen(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWUserNameEntry"))))==0) {
+                       wizard_missing_notification(NULL, "Please enter user name.");
+                       return FALSE;
+               }
+               return TRUE;
+               break;
+       case 3:
+               if (strlen(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWOutServerComboEntry"))))==0) {
+                       wizard_missing_notification(NULL, "Please specify outgoing server address.");
+                       return FALSE;
+               }
+               /* smtp servers may work without a username
+               if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(glade_xml_get_widget(glade_xml, "AWUseIncomingCheckButton")))==FALSE
+                   && strlen(gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWOutUserNameEntry"))))==0) {
+                       wizard_missing_notification(NULL, "Please enter user name.");
+                       return FALSE;
+               } */
+
+               return TRUE;
+               break;
+        }
+
+        return FALSE;
+}
+
+gchar *search_unused_account_or_identity_name(gpointer mgr, gchar *draft) {
+       GString *tmpaccount_name;
+       gint counter;
+
+       tmpaccount_name=g_string_new("");
+       g_string_printf(tmpaccount_name, "%s", draft);
+       if(MODEST_IS_ACCOUNT_MGR(mgr)) {
+               for(counter=0; modest_account_mgr_server_account_exists(mgr, tmpaccount_name->str, NULL); counter++)
+                       g_string_printf(tmpaccount_name, "%s%d", draft, counter);
+       }
+       else
+               for(counter=0;      modest_identity_mgr_identity_exists(mgr, tmpaccount_name->str, NULL); counter++)
+                       g_string_printf(tmpaccount_name, "%s%d", draft, counter);
+
+       return g_string_free(tmpaccount_name, FALSE);
+}
+
+gboolean wizard_account_add(GladeXML *glade_xml, ModestUI *modest_ui)
+{
+       ModestAccountMgr *acc_mgr;
+       ModestIdentityMgr *id_mgr;
+        gchar *store;
+        gchar *transport;
+        gchar *identity;
+       ModestUIPrivate *priv;
+       ModestConf *conf;
+       gchar *tmptext;
+       gchar *tmptext2;
+
+       g_return_val_if_fail (MODEST_IS_UI(modest_ui), FALSE);
+       priv = MODEST_UI_GET_PRIVATE(MODEST_UI(modest_ui));
+       conf = priv->modest_conf;
+
+       acc_mgr = priv->modest_acc_mgr;
+       id_mgr = priv->modest_id_mgr;
+
+       tmptext2=get_text_from_combobox(glade_xml_get_widget(glade_xml, "AWMailboxtypeComboBox"));
+       tmptext=g_utf8_strdown(tmptext2, -1);
+       g_free(tmptext2);
+
+       store=search_unused_account_or_identity_name(acc_mgr, "incoming");
+       modest_account_mgr_add_server_account (acc_mgr,
+                                              store,
+                                              gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWInServerComboEntry"))),
+                                              gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWUserNameEntry"))),
+                                              gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWPasswordEntry"))),
+                                              tmptext);
+       g_free(store);
+       g_free(tmptext);
+
+        transport=search_unused_account_or_identity_name(acc_mgr, "outgoing");
+       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(glade_xml_get_widget(glade_xml, "AWUseIncomingCheckButton")))==TRUE)
+               modest_account_mgr_add_server_account (acc_mgr,
+                                                      transport,
+                                                      gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWOutServerComboEntry"))),
+                                                      gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWUserNameEntry"))),
+                                                      gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWPasswordEntry"))),
+                                                      "smtp");
+       else
+               modest_account_mgr_add_server_account (acc_mgr,
+                                                      transport,
+                                                      gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWOutServerComboEntry"))),
+                                                      gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWOutUserNameEntry"))),
+                                                      gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWOutPasswordEntry"))),
+                                                      "smtp");
+
+       identity=search_unused_account_or_identity_name(id_mgr, MODEST_IDENTITY_DEFAULT_IDENTITY);
+       if (!modest_identity_mgr_add_identity (id_mgr,
+                                               identity,
+                                              gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWRealNameEntry"))),
+                                              gtk_entry_get_text(GTK_ENTRY(glade_xml_get_widget(glade_xml, "AWEMailAddressEntry"))),
+                                              "", "", FALSE, transport, FALSE ))
+               g_warning ("failed to add default identity");
+
+       g_free(transport);
+       g_free(identity);
+       return TRUE;
+}
+
+
+void wizard_account_dialog(ModestUI *modest_ui)
+{
+       GladeXML *glade_xml;
+       GtkWidget *dialog;
+       ModestUIPrivate *priv;
+       GtkWidget *finish_button;
+       GtkWidget *back_button;
+       GtkWidget *next_button;
+       GtkWidget *cancel_button;
+       GtkWidget *notebook;
+       GtkWidget *use_incoming_button;
+       gint cp;
+       gint result;
+       gboolean account_added_successfully=FALSE;
+
+       g_return_if_fail(MODEST_IS_UI(modest_ui));
+       priv = MODEST_UI_GET_PRIVATE(MODEST_UI(modest_ui));
+
+       glade_xml = glade_xml_new(MODEST_GLADE, "account_wizard", NULL);
+
+       dialog = glade_xml_get_widget(glade_xml, "account_wizard");
+
+       gtk_widget_show_all(dialog);
+
+       finish_button=glade_xml_get_widget(glade_xml, "AWFinishButton");
+       back_button=glade_xml_get_widget(glade_xml, "AWBackButton");
+       next_button=glade_xml_get_widget(glade_xml, "AWNextButton");
+       cancel_button=glade_xml_get_widget(glade_xml, "AWCancelButton");
+       notebook=glade_xml_get_widget(glade_xml, "AWNotebook");
+
+       gtk_widget_set_sensitive(finish_button, FALSE);
+
+       use_incoming_button=glade_xml_get_widget(glade_xml, "AWUseIncomingCheckButton");
+       g_signal_connect(use_incoming_button,
+                        "toggled",
+                        G_CALLBACK(wizard_incoming_button_toggled),
+                        glade_xml);
+
+       /* First page not used currently. It's reserved for the account preset. */
+       gtk_notebook_set_current_page (GTK_NOTEBOOK(notebook), 1);
+
+       do {
+               cp=gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook));
+               switch (cp) {
+               case 1:
+                       gtk_widget_set_sensitive(back_button, FALSE);
+                       break;
+               case 2:
+                       gtk_widget_set_sensitive(back_button, TRUE);
+                       break;
+               case 3:
+                       gtk_widget_set_sensitive(finish_button, FALSE);
+                       gtk_widget_set_sensitive(next_button, TRUE);
+                       break;
+               case 4:
+                       gtk_widget_set_sensitive(finish_button, TRUE);
+                       gtk_widget_set_sensitive(next_button, FALSE);
+                       break;
+               default:
+                       g_error("I'm on page %d of notebook AWNotebook, which shouldn't have happened. Pulling emergency breaks.", cp);
+                       break;
+               }
+
+               result=gtk_dialog_run(GTK_DIALOG(dialog));
+
+               switch (result) {
+               case 1:
+                       if (advance_sanity_check(glade_xml, cp)==TRUE)
+                               gtk_notebook_next_page(GTK_NOTEBOOK(notebook));
+                       break;
+               case 2:
+                       gtk_notebook_prev_page(GTK_NOTEBOOK(notebook));
+                       break;
+               case GTK_RESPONSE_ACCEPT:
+                       account_added_successfully=wizard_account_add(glade_xml, modest_ui);
+                       break;
+               default:
+                       account_added_successfully=FALSE;
+                }
+        }
+        while(result!=GTK_RESPONSE_DELETE_EVENT && result!=GTK_RESPONSE_CANCEL && account_added_successfully!=TRUE);
+
+       gtk_widget_destroy(dialog);
+       g_object_unref(glade_xml);
+}
+
+void new_wizard_account (GtkWidget *widget,
+                        gpointer user_data)
+{
+       /* This will probably never be used to modify any existing account. */
+       wizard_account_dialog(MODEST_UI(user_data));
+}
+
+
diff --git a/src/gtk/modest-ui-wizard.h b/src/gtk/modest-ui-wizard.h
new file mode 100644 (file)
index 0000000..c9cdd54
--- /dev/null
@@ -0,0 +1,29 @@
+/* modest-ui-wizard.h */
+/* insert (c)/licensing information) */
+
+#ifndef __MODEST_UI_WIZARD_H__
+#define __MODEST_UI_WIZARD_H__
+
+#include "modest-ui-glade.h"
+
+/**
+ * wizard_account_dialog:
+ * @modest-ui: a ModestUI instance
+ *
+ * Handle the dialog window acting as account wizard. The wizard allows
+ * the creation of identities and server accounts.
+ */
+void
+wizard_account_dialog(ModestUI *modest_ui);
+
+/**
+ * new_wizard_account:
+ * @GtkWidget: The widget by which this CALLBACK is called.
+ * @gpointer: A ModestUI is needed as second argument.
+ */
+void
+new_wizard_account (GtkWidget *,
+                    gpointer);
+
+#endif /* __MODEST_UI_WIZARD_H__ */
+
diff --git a/src/gtk/modest-ui.c b/src/gtk/modest-ui.c
new file mode 100644 (file)
index 0000000..36f4f49
--- /dev/null
@@ -0,0 +1,316 @@
+/* modest-ui.c */
+
+/* insert (c)/licensing information) */
+
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+#include <glib/gi18n.h>
+#include <string.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /*HAVE_CONFIG_H*/
+
+/* TODO: put in auto* */
+#include <tny-text-buffer-stream.h>
+#include <tny-msg-folder.h>
+
+#include "../modest-ui.h"
+#include "../modest-window-mgr.h"
+#include "../modest-account-mgr.h"
+#include "../modest-account-mgr.h"
+#include "../modest-identity-mgr.h"
+
+#include "../modest-tny-account-store.h"
+#include "../modest-tny-folder-tree-view.h"
+#include "../modest-tny-header-tree-view.h"
+#include "../modest-tny-msg-view.h"
+#include "../modest-tny-transport-actions.h"
+#include "../modest-tny-store-actions.h"
+
+#include "../modest-text-utils.h"
+#include "../modest-tny-msg-actions.h"
+
+#include "../modest-editor-window.h"
+
+#include "modest-ui-glade.h"
+#include "modest-ui-wizard.h"
+
+/* 'private'/'protected' functions */
+static void   modest_ui_class_init     (ModestUIClass *klass);
+static void   modest_ui_init           (ModestUI *obj);
+static void   modest_ui_finalize       (GObject *obj);
+
+static void   modest_ui_window_destroy    (GtkWidget *win, GdkEvent *event, gpointer data);
+static void   modest_ui_last_window_closed (GObject *obj, gpointer data);
+
+gchar *on_password_requested (TnyAccountIface *, const gchar *, gboolean *);
+
+/* list my signals */
+enum {
+       /* MY_SIGNAL_1, */
+       /* MY_SIGNAL_2, */
+       LAST_SIGNAL
+};
+
+/* globals */
+static GObjectClass *parent_class = NULL;
+
+
+GType
+modest_ui_get_type (void)
+{
+       static GType my_type = 0;
+       if (!my_type) {
+               static const GTypeInfo my_info = {
+                       sizeof(ModestUIClass),
+                       NULL,           /* base init */
+                       NULL,           /* base finalize */
+                       (GClassInitFunc) modest_ui_class_init,
+                       NULL,           /* class finalize */
+                       NULL,           /* class data */
+                       sizeof(ModestUI),
+                       1,              /* n_preallocs */
+                       (GInstanceInitFunc) modest_ui_init,
+               };
+               my_type = g_type_register_static (G_TYPE_OBJECT,
+                                                 "ModestUI",
+                                                 &my_info, 0);
+       }
+       return my_type;
+}
+
+
+static void
+modest_ui_class_init (ModestUIClass *klass)
+{
+       GObjectClass *gobject_class;
+       gobject_class = (GObjectClass*) klass;
+
+       parent_class            = g_type_class_peek_parent (klass);
+       gobject_class->finalize = modest_ui_finalize;
+
+       g_type_class_add_private (gobject_class, sizeof(ModestUIPrivate));
+
+}
+
+
+static void
+modest_ui_init (ModestUI *obj)
+{
+       ModestUIPrivate *priv = MODEST_UI_GET_PRIVATE(obj);
+
+       priv->modest_acc_mgr    = NULL;
+       priv->modest_id_mgr     = NULL;
+       priv->modest_conf       = NULL;
+       priv->modest_window_mgr = NULL;
+       priv->glade_xml         = NULL;
+       priv->folder_view       = NULL;
+       priv->header_view       = NULL;
+       priv->message_view      = NULL;
+       priv->current_folder    = NULL;
+}
+
+
+static void
+modest_ui_finalize (GObject *obj)
+{
+       ModestUIPrivate *priv = MODEST_UI_GET_PRIVATE(obj);
+
+       if (priv->modest_acc_mgr)
+               g_object_unref (priv->modest_acc_mgr);
+       priv->modest_acc_mgr = NULL;
+
+       if (priv->modest_id_mgr)
+               g_object_unref (priv->modest_id_mgr);
+       priv->modest_id_mgr = NULL;
+
+       if (priv->modest_conf)
+               g_object_unref (priv->modest_conf);
+       priv->modest_conf = NULL;
+
+       if (priv->modest_window_mgr)
+               g_object_unref (priv->modest_window_mgr);
+       priv->modest_window_mgr = NULL;
+}
+
+
+static void
+on_accounts_reloaded (ModestTnyAccountStore *account_store, gpointer user_data)
+{
+       ModestUIPrivate *priv = user_data;
+
+       g_return_if_fail (MODEST_IS_TNY_FOLDER_TREE_VIEW (priv->folder_view));
+       g_return_if_fail (MODEST_IS_TNY_HEADER_TREE_VIEW (priv->header_view));
+
+       modest_tny_header_tree_view_set_folder (priv->header_view, NULL);
+
+       modest_tny_folder_tree_view_update_model(priv->folder_view, account_store);
+}
+
+
+GObject*
+modest_ui_new (ModestConf *modest_conf)
+{
+       GObject *obj;
+       ModestUIPrivate *priv;
+       ModestAccountMgr *modest_acc_mgr;
+       ModestIdentityMgr *modest_id_mgr;
+       TnyAccountStoreIface *account_store_iface;
+       GSList *account_names_list;
+       GSList *identities_list;
+
+       g_return_val_if_fail (modest_conf, NULL);
+
+       obj = g_object_new(MODEST_TYPE_UI, NULL);
+       priv = MODEST_UI_GET_PRIVATE(obj);
+
+       modest_acc_mgr = MODEST_ACCOUNT_MGR(modest_account_mgr_new (modest_conf));
+       if (!modest_acc_mgr) {
+               g_warning ("could not create ModestAccountMgr instance");
+               g_object_unref (obj);
+               return NULL;
+        }
+
+       modest_id_mgr = MODEST_IDENTITY_MGR(modest_identity_mgr_new (modest_conf));
+       if (!modest_id_mgr) {
+               g_warning ("could not create ModestIdentityMgr instance");
+               g_object_unref (obj);
+               return NULL;
+       }
+
+       account_store_iface =
+               TNY_ACCOUNT_STORE_IFACE(modest_tny_account_store_new (modest_acc_mgr));
+       if (!account_store_iface) {
+               g_warning ("could not initialze ModestTnyAccountStore");
+               return NULL;
+        }
+
+        modest_tny_account_store_set_get_pass_func(MODEST_TNY_ACCOUNT_STORE(account_store_iface),
+                                                   on_password_requested);
+
+       g_signal_connect (account_store_iface, "accounts_reloaded",
+                         G_CALLBACK(on_accounts_reloaded), priv);
+
+       glade_init ();
+       priv->glade_xml = glade_xml_new (MODEST_GLADE, NULL, NULL);
+       if (!priv->glade_xml) {
+               g_warning ("failed to do glade stuff");
+               g_object_unref (obj);
+               return NULL;
+       }
+
+       /* FIXME: could be used, but doesn't work atm.
+        * glade_xml_signal_autoconnect(priv->glade_xml);
+        */
+
+       priv->modest_acc_mgr = modest_acc_mgr;
+       priv->modest_id_mgr  = modest_id_mgr;
+       g_object_ref (priv->modest_conf = modest_conf);
+
+       priv->account_store = account_store_iface;
+
+       priv->modest_window_mgr = MODEST_WINDOW_MGR(modest_window_mgr_new());
+       g_signal_connect (priv->modest_window_mgr, "last_window_closed",
+                         G_CALLBACK(modest_ui_last_window_closed),
+                         NULL);
+
+       account_names_list = modest_account_mgr_server_account_names(modest_acc_mgr,
+                                       NULL, MODEST_PROTO_TYPE_ANY, NULL, FALSE);
+       identities_list = modest_identity_mgr_identity_names(modest_id_mgr, NULL);
+       if (!(account_names_list != NULL || identities_list != NULL))
+               wizard_account_dialog(MODEST_UI(obj));
+       g_slist_free(account_names_list);
+       g_slist_free(identities_list);
+
+       return obj;
+}
+
+
+static void
+modest_ui_last_window_closed (GObject *obj, gpointer data)
+{
+       /* FIXME: Other cleanups todo? Finalize Tinymail? */
+       gtk_main_quit ();
+}
+
+
+gchar *
+on_password_requested (TnyAccountIface *account,
+                      const gchar *prompt,
+                      gboolean *cancel) {
+
+       GtkWidget *passdialog;
+       GtkWidget *vbox;
+       GtkWidget *infoscroll;
+       GtkWidget *infolabel;
+       GtkWidget *passentry;
+       GtkTextBuffer *infobuffer;
+       gchar *retval;
+       gint result;
+
+       passdialog = gtk_dialog_new_with_buttons(_("Password"),
+                                                NULL,
+                                                GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
+                                                GTK_STOCK_OK,
+                                                GTK_RESPONSE_ACCEPT,
+                                                GTK_STOCK_CANCEL,
+                                                GTK_RESPONSE_REJECT,
+                                                NULL);
+
+       vbox = gtk_vbox_new(FALSE, 0);
+
+       infobuffer = gtk_text_buffer_new (NULL);
+       gtk_text_buffer_set_text(infobuffer, prompt, -1);
+       infoscroll = gtk_scrolled_window_new(NULL, NULL);
+       infolabel = gtk_text_view_new_with_buffer(infobuffer);
+       gtk_container_add(GTK_CONTAINER(infoscroll), infolabel);
+       passentry = gtk_entry_new();
+       gtk_entry_set_visibility(GTK_ENTRY(passentry), FALSE);
+
+       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(passdialog)->vbox), infoscroll, FALSE, FALSE, 0);
+       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(passdialog)->vbox), passentry, FALSE, FALSE, 0);
+       gtk_widget_show_all(passdialog);
+
+       result = gtk_dialog_run (GTK_DIALOG(passdialog));
+
+       switch (result) {
+       case GTK_RESPONSE_ACCEPT:
+               retval = g_strdup(gtk_entry_get_text(GTK_ENTRY(passentry)));
+               *cancel=FALSE;
+               break;
+       default:
+               retval = g_strdup("");;
+               *cancel=TRUE;
+               break;
+       }
+
+        gtk_widget_hide(passdialog);
+       gtk_widget_destroy(passdialog);
+       while (gtk_events_pending()){
+               gtk_main_iteration();
+       }
+
+       return retval;
+}
+
+
+void
+on_account_selector_selection_changed (GtkWidget *widget, gpointer user_data)
+{
+       GtkTreeModel *model = gtk_combo_box_get_model(GTK_COMBO_BOX(widget));
+       GtkTreeIter iter;
+
+       gchar *account_name;
+
+       if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(widget), &iter)) {
+               gtk_tree_model_get(GTK_TREE_MODEL(model), &iter,
+                                  0, &account_name, -1);
+       } else {
+               account_name="empty";
+       }
+
+       free(account_name);
+}
+
+
diff --git a/src/gtk/modest.glade b/src/gtk/modest.glade
new file mode 100644 (file)
index 0000000..bdf33a2
--- /dev/null
@@ -0,0 +1,4563 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="main">
+  <property name="title" translatable="yes">Modest</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="default_width">800</property>
+  <property name="default_height">600</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="icon">qgn_toolb_messagin.png</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+
+  <child>
+    <widget class="GtkVBox" id="main_top_container">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child>
+       <widget class="GtkMenuBar" id="menubar1">
+         <property name="visible">True</property>
+         <property name="pack_direction">GTK_PACK_DIRECTION_LTR</property>
+         <property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property>
+
+         <child>
+           <widget class="GtkMenuItem" id="MessageMenuItem">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Message</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="MessageMenuItem_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="new_e-mail1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">New e-mail</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_new_e-mail1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                     <accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="open1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Open</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_open1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                     <accelerator key="O" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator1">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="reply1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Reply</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_reply1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="reply_to_all1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Reply to all</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_reply_to_all1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="forward1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Forward</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_forward1_activate" last_modification_time="Fri, 28 Apr 2006 12:05:09 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="forward_attached">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Forward attached</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_forward_attached_activate" last_modification_time="Tue, 13 Jun 2006 16:41:33 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator2">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="delete1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Delete</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_delete1_activate" last_modification_time="Fri, 28 Apr 2006 12:05:09 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator3">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="details1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Details</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_details1_activate" last_modification_time="Fri, 28 Apr 2006 12:05:09 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="EditMenuItem">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Edit</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="EditMenuItem_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="undo1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Undo</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_undo1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator4">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="cut1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Cut</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_cut1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="copy1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Copy</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_copy1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="paste1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Paste</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_paste1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="select1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">_Select</property>
+                     <property name="use_underline">True</property>
+
+                     <child>
+                       <widget class="GtkMenu" id="select1_menu">
+
+                         <child>
+                           <widget class="GtkMenuItem" id="mark_all1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Mark all</property>
+                             <property name="use_underline">True</property>
+                             <signal name="activate" handler="on_mark_all1_activate" last_modification_time="Fri, 28 Apr 2006 12:10:20 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkMenuItem" id="unmark_all1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Unmark all</property>
+                             <property name="use_underline">True</property>
+                             <signal name="activate" handler="on_unmark_all1_activate" last_modification_time="Fri, 28 Apr 2006 12:10:20 GMT"/>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator6">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="move_to1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Move to...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_move_to1_activate" last_modification_time="Fri, 28 Apr 2006 12:12:30 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="FoldersMenuItem">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Folders</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="FoldersMenuItem_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="new_folder1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">New folder...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_new_folder1_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="manage_folders1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Manage folders</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_manage_folders1_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator7">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="details2">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Details</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_details2_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="folder_settings1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Folder settings...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_folder_settings1_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator8">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkRadioMenuItem" id="inbox1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Inbox</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">True</property>
+                     <signal name="activate" handler="on_inbox1_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkRadioMenuItem" id="outbox1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Outbox</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">True</property>
+                     <property name="group">inbox1</property>
+                     <signal name="activate" handler="on_outbox1_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkRadioMenuItem" id="drafts1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Drafts</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">True</property>
+                     <property name="group">inbox1</property>
+                     <signal name="activate" handler="on_drafts1_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkRadioMenuItem" id="sent1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Sent</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">True</property>
+                     <property name="group">inbox1</property>
+                     <signal name="activate" handler="on_sent1_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkRadioMenuItem" id="archive1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Archive</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">True</property>
+                     <property name="group">inbox1</property>
+                     <signal name="activate" handler="on_archive1_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="ViewMenuItem">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_View</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="ViewMenuItem_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="sort1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Sort...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_sort1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator9">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="show_toolbar1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">_Show toolbar</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_show_toolbar1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+
+                     <child>
+                       <widget class="GtkMenu" id="show_toolbar1_menu">
+
+                         <child>
+                           <widget class="GtkCheckMenuItem" id="normal_screen1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Normal screen</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_normal_screen1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkCheckMenuItem" id="full_screen2">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Full screen</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_full_screen2_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkCheckMenuItem" id="folders1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Folders</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">True</property>
+                     <signal name="activate" handler="on_folders1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkCheckMenuItem" id="menu_view_attachments">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Attachments</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">True</property>
+                     <signal name="toggled" handler="on_view_attachments_toggled" last_modification_time="Fri, 09 Jun 2006 14:17:29 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkCheckMenuItem" id="full_screen1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Full screen</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">False</property>
+                     <signal name="activate" handler="on_full_screen1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="EMailMenuItem">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">E-m_ail</property>
+             <property name="use_underline">True</property>
+             <signal name="activate" handler="on_e-mail1_activate" last_modification_time="Fri, 28 Apr 2006 12:12:02 GMT"/>
+
+             <child>
+               <widget class="GtkMenu" id="EMailMenuItem_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="send_&amp;_receive1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Send &amp; receive</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_send_&amp;_receive1_activate" last_modification_time="Fri, 28 Apr 2006 12:21:50 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="retrieve_e-mail_contents1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Retrieve e-mail contents</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_retrieve_e-mail_contents1_activate" last_modification_time="Fri, 28 Apr 2006 12:21:50 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="purge_attacments1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Purge attacments</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_purge_attacments1_activate" last_modification_time="Fri, 28 Apr 2006 12:21:50 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="ToolsMenuItem">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Tools</property>
+             <property name="use_underline">True</property>
+             <signal name="activate" handler="on_tools1_activate" last_modification_time="Fri, 28 Apr 2006 12:12:02 GMT"/>
+
+             <child>
+               <widget class="GtkMenu" id="ToolsMenuItem_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="OpenContactsMenuItem">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Open contacts...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_open_contacts1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator11">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="NewAccountWizardMenuItem">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">New Identity</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_new_account1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="AccountSettingsMenuItem">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Identities and accounts</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_account_settings1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="OptionsMenuItem">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Options</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_options1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator10">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="SearchEMailsMenuItem">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Search e-mails...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_search_e-mails1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator12">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="HelpMenuItem">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Help</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_help1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="CloseMenuItem">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Close</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="CloseMenuItem_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="about1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Close window</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_about1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="close_all_windows1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Close all windows</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_close_all_windows1_activate" last_modification_time="Fri, 28 Apr 2006 12:24:02 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">False</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkToolbar" id="toolbar1">
+         <property name="visible">True</property>
+         <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
+         <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
+         <property name="tooltips">True</property>
+         <property name="show_arrow">True</property>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_new_mail">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Compose new e-mail message</property>
+             <property name="label" translatable="yes">New e-mail</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_new.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_reply">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Reply</property>
+             <property name="label" translatable="yes">Reply</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_reply.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_reply_all">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Reply all</property>
+             <property name="label" translatable="yes">Reply all</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_replytoall.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_forward">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Forward</property>
+             <property name="label" translatable="yes">Forward</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_forward.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_move_to">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Move message to other location</property>
+             <property name="label" translatable="yes">Move to...</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_moveto.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_delete">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Delete message</property>
+             <property name="label" translatable="yes">Delete</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_delete.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_send_receive">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Send and receive</property>
+             <property name="label" translatable="yes">Send &amp; receive</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_sendreceive.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">False</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkHPaned" id="hpaned1">
+         <property name="visible">True</property>
+         <property name="can_focus">True</property>
+         <property name="position">170</property>
+
+         <child>
+           <widget class="GtkScrolledWindow" id="folders">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+             <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+             <property name="shadow_type">GTK_SHADOW_NONE</property>
+             <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+             <child>
+               <placeholder/>
+             </child>
+           </widget>
+           <packing>
+             <property name="shrink">True</property>
+             <property name="resize">False</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkVPaned" id="mail_paned">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="position">150</property>
+
+             <child>
+               <widget class="GtkScrolledWindow" id="mail_list">
+                 <property name="visible">True</property>
+                 <property name="can_focus">True</property>
+                 <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+                 <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                 <property name="shadow_type">GTK_SHADOW_NONE</property>
+                 <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+                 <child>
+                   <placeholder/>
+                 </child>
+               </widget>
+               <packing>
+                 <property name="shrink">True</property>
+                 <property name="resize">False</property>
+               </packing>
+             </child>
+
+             <child>
+               <placeholder/>
+             </child>
+           </widget>
+           <packing>
+             <property name="shrink">True</property>
+             <property name="resize">True</property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">True</property>
+         <property name="fill">True</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkHBox" id="statusbox">
+         <property name="homogeneous">True</property>
+         <property name="spacing">0</property>
+
+         <child>
+           <widget class="GtkProgressBar" id="progressbar">
+             <property name="visible">True</property>
+             <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property>
+             <property name="fraction">0</property>
+             <property name="pulse_step">0.10000000149</property>
+             <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+           </widget>
+           <packing>
+             <property name="padding">0</property>
+             <property name="expand">False</property>
+             <property name="fill">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkStatusbar" id="statusbar">
+             <property name="visible">True</property>
+             <property name="has_resize_grip">True</property>
+           </widget>
+           <packing>
+             <property name="padding">0</property>
+             <property name="expand">False</property>
+             <property name="fill">True</property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">False</property>
+       </packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkWindow" id="new_mail">
+  <property name="title" translatable="yes">Modest - New message</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="default_width">800</property>
+  <property name="default_height">600</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="icon">qgn_toolb_messagin.png</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+
+  <child>
+    <widget class="GtkVBox" id="new_mail_top_container">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child>
+       <widget class="GtkMenuBar" id="menubar2">
+         <property name="visible">True</property>
+         <property name="pack_direction">GTK_PACK_DIRECTION_LTR</property>
+         <property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem5">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Message</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem5_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem6">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Send</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_new_e-mail1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator13">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem7">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">New e-mail</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_open1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                     <accelerator key="O" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem8">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Delete message</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_reply1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator14">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem9">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Select recipients...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_reply_to_all1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem10">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Check names</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_forward1_activate" last_modification_time="Fri, 28 Apr 2006 12:05:09 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem13">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Edit</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem13_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem14">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Undo</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_undo1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separatormenuitem4">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem15">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Cut</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_cut1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem16">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Copy</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_copy1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem17">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Paste</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_paste1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem18">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Select all</property>
+                     <property name="use_underline">True</property>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem22">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Attachments</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem22_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem23">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Attach file...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_new_folder1_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem24">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Insert inline image</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_manage_folders1_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator15">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem25">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Remove attachment</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_details2_activate" last_modification_time="Fri, 28 Apr 2006 12:15:47 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem27">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_View</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem27_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem28">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">_Zoom</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_sort1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+
+                     <child>
+                       <widget class="GtkMenu" id="menuitem28_menu">
+
+                         <child>
+                           <widget class="GtkRadioMenuItem" id="50%1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">50%</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_50%1_activate" last_modification_time="Fri, 28 Apr 2006 13:25:43 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkRadioMenuItem" id="100%1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">100%</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <property name="group">50%1</property>
+                             <signal name="activate" handler="on_100%1_activate" last_modification_time="Fri, 28 Apr 2006 13:25:43 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkRadioMenuItem" id="150%1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">150%</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <property name="group">50%1</property>
+                             <signal name="activate" handler="on_150%1_activate" last_modification_time="Fri, 28 Apr 2006 13:25:43 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkRadioMenuItem" id="200%1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">200%</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <property name="group">50%1</property>
+                             <signal name="activate" handler="on_200%1_activate" last_modification_time="Fri, 28 Apr 2006 13:25:43 GMT"/>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem29">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Show toolbar</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_show_toolbar1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+
+                     <child>
+                       <widget class="GtkMenu" id="menuitem29_menu">
+
+                         <child>
+                           <widget class="GtkCheckMenuItem" id="checkmenuitem1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Normal screen</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_normal_screen1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkCheckMenuItem" id="checkmenuitem2">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Full screen</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_full_screen2_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkCheckMenuItem" id="checkmenuitem4">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Full screen</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">False</property>
+                     <signal name="activate" handler="on_full_screen1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator16">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkCheckMenuItem" id="show_cc1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Show Cc</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">False</property>
+                     <signal name="activate" handler="on_show_cc1_activate" last_modification_time="Fri, 28 Apr 2006 13:25:43 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkCheckMenuItem" id="show_bcc1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Show Bcc</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">False</property>
+                     <signal name="activate" handler="on_show_bcc1_activate" last_modification_time="Fri, 28 Apr 2006 13:25:43 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem30">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Format</property>
+             <property name="use_underline">True</property>
+             <signal name="activate" handler="on_e-mail1_activate" last_modification_time="Fri, 28 Apr 2006 12:12:02 GMT"/>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem30_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem31">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Font...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_send_&amp;_receive1_activate" last_modification_time="Fri, 28 Apr 2006 12:21:50 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem32">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Bullets</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_retrieve_e-mail_contents1_activate" last_modification_time="Fri, 28 Apr 2006 12:21:50 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem33">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Numbers</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_purge_attacments1_activate" last_modification_time="Fri, 28 Apr 2006 12:21:50 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="alignment1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Alignment</property>
+                     <property name="use_underline">True</property>
+
+                     <child>
+                       <widget class="GtkMenu" id="alignment1_menu">
+
+                         <child>
+                           <widget class="GtkRadioMenuItem" id="left1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Left</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_left1_activate" last_modification_time="Fri, 28 Apr 2006 13:28:18 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkRadioMenuItem" id="center1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Center</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <property name="group">left1</property>
+                             <signal name="activate" handler="on_center1_activate" last_modification_time="Fri, 28 Apr 2006 13:28:18 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkRadioMenuItem" id="right1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Right</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <property name="group">left1</property>
+                             <signal name="activate" handler="on_right1_activate" last_modification_time="Fri, 28 Apr 2006 13:28:18 GMT"/>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="background_colour1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Background colour</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_background_colour1_activate" last_modification_time="Fri, 28 Apr 2006 13:28:54 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem34">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Tools</property>
+             <property name="use_underline">True</property>
+             <signal name="activate" handler="on_tools1_activate" last_modification_time="Fri, 28 Apr 2006 12:12:02 GMT"/>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem34_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem35">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Sending options...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_open_contacts1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separatormenuitem9">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem36">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Find on page...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_new_account1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem39">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Search e-mails...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_search_e-mails1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separatormenuitem11">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem40">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Help</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_help1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="security1">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Security</property>
+             <property name="use_underline">True</property>
+             <signal name="activate" handler="on_security1_activate" last_modification_time="Fri, 28 Apr 2006 13:30:35 GMT"/>
+
+             <child>
+               <widget class="GtkMenu" id="security1_menu">
+
+                 <child>
+                   <widget class="GtkRadioMenuItem" id="none1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">None</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">True</property>
+                     <signal name="activate" handler="on_none1_activate" last_modification_time="Fri, 28 Apr 2006 13:32:29 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkRadioMenuItem" id="encrypt1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Encrypt</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">False</property>
+                     <property name="group">none1</property>
+                     <signal name="activate" handler="on_encrypt1_activate" last_modification_time="Fri, 28 Apr 2006 13:32:29 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkRadioMenuItem" id="digitally_sign1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Digitally sign</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">False</property>
+                     <property name="group">none1</property>
+                     <signal name="activate" handler="on_digitally_sign1_activate" last_modification_time="Fri, 28 Apr 2006 13:32:29 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkRadioMenuItem" id="digitally_sign_and_encrypt1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Digitally sign and encrypt</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">False</property>
+                     <property name="group">none1</property>
+                     <signal name="activate" handler="on_digitally_sign_and_encrypt1_activate" last_modification_time="Fri, 28 Apr 2006 13:32:29 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem41">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Close</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem41_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem42">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Close window</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_about1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem43">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Close all windows</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_close_all_windows1_activate" last_modification_time="Fri, 28 Apr 2006 12:24:02 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">False</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkToolbar" id="toolbar2">
+         <property name="visible">True</property>
+         <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
+         <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
+         <property name="tooltips">True</property>
+         <property name="show_arrow">True</property>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_send">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Send message</property>
+             <property name="label" translatable="yes">Send</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_send.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_attach">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Add attachment</property>
+             <property name="label" translatable="yes">Attach</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_list_gene_attacpap.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolb_recipients">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Add reipients</property>
+             <property name="label" translatable="yes">Recipients</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_list_gene_contacts.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">False</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkVPaned" id="vpaned2">
+         <property name="visible">True</property>
+         <property name="can_focus">True</property>
+         <property name="position">65</property>
+
+         <child>
+           <widget class="GtkTable" id="table1">
+             <property name="border_width">10</property>
+             <property name="visible">True</property>
+             <property name="n_rows">2</property>
+             <property name="n_columns">2</property>
+             <property name="homogeneous">False</property>
+             <property name="row_spacing">10</property>
+             <property name="column_spacing">10</property>
+
+             <child>
+               <widget class="GtkLabel" id="label1">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">&lt;b&gt;To:&lt;/b&gt;</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">True</property>
+                 <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">0</property>
+                 <property name="bottom_attach">1</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="label2">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">&lt;b&gt;Subject:&lt;/b&gt;</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">True</property>
+                 <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">1</property>
+                 <property name="bottom_attach">2</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkEntry" id="to_entry">
+                 <property name="visible">True</property>
+                 <property name="can_focus">True</property>
+                 <property name="editable">True</property>
+                 <property name="visibility">True</property>
+                 <property name="max_length">0</property>
+                 <property name="text" translatable="yes"></property>
+                 <property name="has_frame">True</property>
+                 <property name="invisible_char">*</property>
+                 <property name="activates_default">False</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">2</property>
+                 <property name="top_attach">0</property>
+                 <property name="bottom_attach">1</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkEntry" id="subject_entry">
+                 <property name="visible">True</property>
+                 <property name="can_focus">True</property>
+                 <property name="editable">True</property>
+                 <property name="visibility">True</property>
+                 <property name="max_length">0</property>
+                 <property name="text" translatable="yes"></property>
+                 <property name="has_frame">True</property>
+                 <property name="invisible_char">*</property>
+                 <property name="activates_default">False</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">2</property>
+                 <property name="top_attach">1</property>
+                 <property name="bottom_attach">2</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+           </widget>
+           <packing>
+             <property name="shrink">False</property>
+             <property name="resize">False</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkScrolledWindow" id="scrolledwindow9">
+             <property name="visible">True</property>
+             <property name="can_focus">True</property>
+             <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+             <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+             <property name="shadow_type">GTK_SHADOW_IN</property>
+             <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+             <child>
+               <widget class="GtkTextView" id="body_view">
+                 <property name="visible">True</property>
+                 <property name="can_focus">True</property>
+                 <property name="editable">True</property>
+                 <property name="overwrite">False</property>
+                 <property name="accepts_tab">True</property>
+                 <property name="justification">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap_mode">GTK_WRAP_NONE</property>
+                 <property name="cursor_visible">True</property>
+                 <property name="pixels_above_lines">0</property>
+                 <property name="pixels_below_lines">0</property>
+                 <property name="pixels_inside_wrap">0</property>
+                 <property name="left_margin">0</property>
+                 <property name="right_margin">0</property>
+                 <property name="indent">0</property>
+                 <property name="text" translatable="yes">     </property>
+               </widget>
+             </child>
+           </widget>
+           <packing>
+             <property name="shrink">True</property>
+             <property name="resize">True</property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">True</property>
+         <property name="fill">True</property>
+       </packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkWindow" id="viewer">
+  <property name="title" translatable="yes">Modest - Message viewer</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="default_width">800</property>
+  <property name="default_height">600</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="icon">qgn_toolb_messagin.png</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+
+  <child>
+    <widget class="GtkVBox" id="viewer_top_container">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child>
+       <widget class="GtkMenuBar" id="menubar3">
+         <property name="visible">True</property>
+         <property name="pack_direction">GTK_PACK_DIRECTION_LTR</property>
+         <property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem44">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Message</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem44_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="reply">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Reply</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_new_reply_activate" last_modification_time="Wed, 03 May 2006 12:23:21 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="reply_to_all2">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Reply to all</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_reply_to_all_activate" last_modification_time="Wed, 03 May 2006 12:23:21 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="forward2">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Forward</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_forward2_activate" last_modification_time="Wed, 03 May 2006 12:16:14 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separatormenuitem12">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem46">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">New e-mail</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_open1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                     <accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separatormenuitem13">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem47">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Delete</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_delete_activate" last_modification_time="Wed, 03 May 2006 12:16:14 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem50">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Edit</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem50_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem52">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Cut</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_cut1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem53">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Copy</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_copy1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem54">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Paste</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_paste1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem55">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Select all</property>
+                     <property name="use_underline">True</property>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem56">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Attachments</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem56_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="view_attacments">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">View</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_view_attachments_activate" last_modification_time="Wed, 03 May 2006 12:20:03 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="save_attachments">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Save attachments...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_save_attachments_activate" last_modification_time="Wed, 03 May 2006 12:20:03 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="purge_attachments">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Purge attachments</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_purge_attachments_activate" last_modification_time="Wed, 03 May 2006 12:20:03 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem60">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_View</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem60_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem61">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Zoom</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_sort1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+
+                     <child>
+                       <widget class="GtkMenu" id="menuitem61_menu">
+
+                         <child>
+                           <widget class="GtkRadioMenuItem" id="radiomenuitem1">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">50%</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_50%1_activate" last_modification_time="Fri, 28 Apr 2006 13:25:43 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkRadioMenuItem" id="radiomenuitem2">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">100%</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_100%1_activate" last_modification_time="Fri, 28 Apr 2006 13:25:43 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkRadioMenuItem" id="radiomenuitem3">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">150%</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_150%1_activate" last_modification_time="Fri, 28 Apr 2006 13:25:43 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkRadioMenuItem" id="radiomenuitem4">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">200%</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_200%1_activate" last_modification_time="Fri, 28 Apr 2006 13:25:43 GMT"/>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem62">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Show toolbar</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_show_toolbar1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+
+                     <child>
+                       <widget class="GtkMenu" id="menuitem62_menu">
+
+                         <child>
+                           <widget class="GtkCheckMenuItem" id="checkmenuitem5">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Normal screen</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_normal_screen1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+                           </widget>
+                         </child>
+
+                         <child>
+                           <widget class="GtkCheckMenuItem" id="checkmenuitem6">
+                             <property name="visible">True</property>
+                             <property name="label" translatable="yes">Full screen</property>
+                             <property name="use_underline">True</property>
+                             <property name="active">True</property>
+                             <signal name="activate" handler="on_full_screen2_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+                           </widget>
+                         </child>
+                       </widget>
+                     </child>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkCheckMenuItem" id="checkmenuitem7">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Full screen</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">False</property>
+                     <signal name="activate" handler="on_full_screen1_activate" last_modification_time="Fri, 28 Apr 2006 12:17:29 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separatormenuitem17">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkCheckMenuItem" id="checkmenuitem8">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Next message</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">False</property>
+                     <signal name="activate" handler="on_show_next_message_activate" last_modification_time="Wed, 03 May 2006 09:44:13 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkCheckMenuItem" id="checkmenuitem9">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Previous message</property>
+                     <property name="use_underline">True</property>
+                     <property name="active">False</property>
+                     <signal name="activate" handler="on_show_previous_message_activate" last_modification_time="Wed, 03 May 2006 09:44:13 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem69">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Tools</property>
+             <property name="use_underline">True</property>
+             <signal name="activate" handler="on_tools1_activate" last_modification_time="Fri, 28 Apr 2006 12:12:02 GMT"/>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem69_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="add_contact">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Add contact...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_add_contact_activate" last_modification_time="Wed, 03 May 2006 12:22:42 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separatormenuitem18">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="font_settings1">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Font settings...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_font_settings1_activate" last_modification_time="Wed, 03 May 2006 12:22:42 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separator17">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem71">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Find on page...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_new_account1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem72">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Search e-mails...</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_search_e-mails1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkSeparatorMenuItem" id="separatormenuitem19">
+                     <property name="visible">True</property>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem73">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Help</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_help1_activate" last_modification_time="Fri, 28 Apr 2006 12:23:17 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem74">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Security</property>
+             <property name="use_underline">True</property>
+             <signal name="activate" handler="on_security1_activate" last_modification_time="Fri, 28 Apr 2006 13:30:35 GMT"/>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem74_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="details">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Details</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_details_activate" last_modification_time="Wed, 03 May 2006 12:22:42 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menuitem75">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Close</property>
+             <property name="use_underline">True</property>
+
+             <child>
+               <widget class="GtkMenu" id="menuitem75_menu">
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem76">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Close window</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_about1_activate" last_modification_time="Fri, 28 Apr 2006 11:10:18 GMT"/>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkMenuItem" id="menuitem77">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">Close all windows</property>
+                     <property name="use_underline">True</property>
+                     <signal name="activate" handler="on_close_all_windows1_activate" last_modification_time="Fri, 28 Apr 2006 12:24:02 GMT"/>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">False</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkToolbar" id="toolbar3">
+         <property name="visible">True</property>
+         <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
+         <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
+         <property name="tooltips">True</property>
+         <property name="show_arrow">True</property>
+
+         <child>
+           <widget class="GtkToolButton" id="reply">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Reply</property>
+             <property name="label" translatable="yes">Reply</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_reply.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="reply all">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Reply all</property>
+             <property name="label" translatable="yes">Reply all</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_replytoall.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="forward">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Forward</property>
+             <property name="label" translatable="yes">Forward</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_forward.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="save_attacment">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Save attached files</property>
+             <property name="label" translatable="yes">Save Attacments...</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_saveattachment.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="move_to">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">Move message to other location</property>
+             <property name="label" translatable="yes">Move to...</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_moveto.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolbutton12">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">View previous message</property>
+             <property name="label" translatable="yes">Previous</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_previous.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkToolButton" id="toolbutton13">
+             <property name="visible">True</property>
+             <property name="tooltip" translatable="yes">View next message</property>
+             <property name="label" translatable="yes">Next</property>
+             <property name="use_underline">True</property>
+             <property name="icon">qgn_toolb_messagin_next.png</property>
+             <property name="visible_horizontal">True</property>
+             <property name="visible_vertical">True</property>
+             <property name="is_important">False</property>
+           </widget>
+           <packing>
+             <property name="expand">False</property>
+             <property name="homogeneous">True</property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">False</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkVPaned" id="vpaned3">
+         <property name="visible">True</property>
+         <property name="can_focus">True</property>
+         <property name="position">100</property>
+
+         <child>
+           <widget class="GtkTable" id="table2">
+             <property name="border_width">10</property>
+             <property name="visible">True</property>
+             <property name="n_rows">4</property>
+             <property name="n_columns">2</property>
+             <property name="homogeneous">False</property>
+             <property name="row_spacing">10</property>
+             <property name="column_spacing">10</property>
+
+             <child>
+               <widget class="GtkLabel" id="label_from">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">&lt;b&gt;From:&lt;/b&gt;</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">True</property>
+                 <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">0</property>
+                 <property name="bottom_attach">1</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="label_subject">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">&lt;b&gt;Subject:&lt;/b&gt;</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">True</property>
+                 <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">2</property>
+                 <property name="bottom_attach">3</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="label_date">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">&lt;b&gt;Date:&lt;/b&gt;</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">True</property>
+                 <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">3</property>
+                 <property name="bottom_attach">4</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="from">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes"></property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">2</property>
+                 <property name="top_attach">0</property>
+                 <property name="bottom_attach">1</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="to">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes"></property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">2</property>
+                 <property name="top_attach">1</property>
+                 <property name="bottom_attach">2</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="subject">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes"></property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">2</property>
+                 <property name="top_attach">2</property>
+                 <property name="bottom_attach">3</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="date">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes"></property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">2</property>
+                 <property name="top_attach">3</property>
+                 <property name="bottom_attach">4</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="label_to">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes">&lt;b&gt;To:&lt;/b&gt;</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">True</property>
+                 <property name="justify">GTK_JUSTIFY_RIGHT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">1</property>
+                 <property name="bottom_attach">2</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+           </widget>
+           <packing>
+             <property name="shrink">False</property>
+             <property name="resize">False</property>
+           </packing>
+         </child>
+
+         <child>
+           <placeholder/>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">True</property>
+         <property name="fill">True</property>
+       </packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+<widget class="GtkDialog" id="account_wizard">
+  <property name="border_width">10</property>
+  <property name="title" translatable="yes">Account Setup</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="default_width">500</property>
+  <property name="default_height">400</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="account_wizzard_top_container">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+       <widget class="GtkHButtonBox" id="dialog1-action_area">
+         <property name="visible">True</property>
+         <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+         <child>
+           <widget class="GtkButton" id="AWFinishButton">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes" context="yes">Finish</property>
+             <property name="use_underline">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="focus_on_click">True</property>
+             <property name="response_id">-3</property>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkButton" id="AWBackButton">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes" context="yes">Back</property>
+             <property name="use_underline">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="focus_on_click">True</property>
+             <property name="response_id">2</property>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkButton" id="AWNextButton">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes" context="yes">Next</property>
+             <property name="use_underline">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="focus_on_click">True</property>
+             <property name="response_id">1</property>
+           </widget>
+         </child>
+
+         <child>
+           <widget class="GtkButton" id="AWCancelButton">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes" context="yes">Cancel</property>
+             <property name="use_underline">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="focus_on_click">True</property>
+             <property name="response_id">-6</property>
+           </widget>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">True</property>
+         <property name="pack_type">GTK_PACK_END</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkNotebook" id="AWNotebook">
+         <property name="visible">True</property>
+         <property name="show_tabs">False</property>
+         <property name="show_border">False</property>
+         <property name="tab_pos">GTK_POS_TOP</property>
+         <property name="scrollable">False</property>
+         <property name="enable_popup">False</property>
+
+         <child>
+           <widget class="GtkVBox" id="PresetPage">
+             <property name="visible">True</property>
+             <property name="homogeneous">False</property>
+             <property name="spacing">10</property>
+
+             <child>
+               <widget class="GtkHBox" id="hbox17">
+                 <property name="visible">True</property>
+                 <property name="homogeneous">False</property>
+                 <property name="spacing">0</property>
+
+                 <child>
+                   <widget class="GtkLabel" id="label53">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes" context="yes">Mailbox setup wizard allows you to define mailboxes for use on your device.</property>
+                     <property name="use_underline">False</property>
+                     <property name="use_markup">False</property>
+                     <property name="justify">GTK_JUSTIFY_LEFT</property>
+                     <property name="wrap">False</property>
+                     <property name="selectable">False</property>
+                     <property name="xalign">0.5</property>
+                     <property name="yalign">0.5</property>
+                     <property name="xpad">0</property>
+                     <property name="ypad">10</property>
+                     <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                     <property name="width_chars">-1</property>
+                     <property name="single_line_mode">False</property>
+                     <property name="angle">0</property>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">False</property>
+                     <property name="fill">False</property>
+                   </packing>
+                 </child>
+               </widget>
+               <packing>
+                 <property name="padding">0</property>
+                 <property name="expand">False</property>
+                 <property name="fill">False</property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkHSeparator" id="hseparator6">
+                 <property name="visible">True</property>
+               </widget>
+               <packing>
+                 <property name="padding">0</property>
+                 <property name="expand">False</property>
+                 <property name="fill">True</property>
+               </packing>
+             </child>
+           </widget>
+           <packing>
+             <property name="tab_expand">False</property>
+             <property name="tab_fill">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label57">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes"></property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0.5</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+             <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+             <property name="width_chars">-1</property>
+             <property name="single_line_mode">False</property>
+             <property name="angle">0</property>
+           </widget>
+           <packing>
+             <property name="type">tab</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkTable" id="EMailAdressPage">
+             <property name="visible">True</property>
+             <property name="n_rows">2</property>
+             <property name="n_columns">2</property>
+             <property name="homogeneous">False</property>
+             <property name="row_spacing">10</property>
+             <property name="column_spacing">10</property>
+
+             <child>
+               <widget class="GtkLabel" id="AWEMailAddressLabel">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes" context="yes">E-mail address:</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">0</property>
+                 <property name="bottom_attach">1</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkEntry" id="AWEMailAddressEntry">
+                 <property name="visible">True</property>
+                 <property name="editable">True</property>
+                 <property name="visibility">True</property>
+                 <property name="max_length">0</property>
+                 <property name="text" translatable="yes"></property>
+                 <property name="has_frame">True</property>
+                 <property name="invisible_char">*</property>
+                 <property name="activates_default">False</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">2</property>
+                 <property name="top_attach">0</property>
+                 <property name="bottom_attach">1</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="AWRealNameLabel">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes" context="yes">Your name:</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">1</property>
+                 <property name="bottom_attach">2</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkEntry" id="AWRealNameEntry">
+                 <property name="visible">True</property>
+                 <property name="editable">True</property>
+                 <property name="visibility">True</property>
+                 <property name="max_length">0</property>
+                 <property name="text" translatable="yes"></property>
+                 <property name="has_frame">True</property>
+                 <property name="invisible_char">*</property>
+                 <property name="activates_default">False</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">2</property>
+                 <property name="top_attach">1</property>
+                 <property name="bottom_attach">2</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+           </widget>
+           <packing>
+             <property name="tab_expand">False</property>
+             <property name="tab_fill">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label64">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes"></property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0.5</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+             <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+             <property name="width_chars">-1</property>
+             <property name="single_line_mode">False</property>
+             <property name="angle">0</property>
+           </widget>
+           <packing>
+             <property name="type">tab</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkTable" id="IncomingPage">
+             <property name="visible">True</property>
+             <property name="n_rows">5</property>
+             <property name="n_columns">3</property>
+             <property name="homogeneous">False</property>
+             <property name="row_spacing">10</property>
+             <property name="column_spacing">10</property>
+
+             <child>
+               <widget class="GtkLabel" id="AWPasswordLabel">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes" context="yes">Password:</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">4</property>
+                 <property name="bottom_attach">5</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="AWUserNameLabel">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes" context="yes">User name:</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">3</property>
+                 <property name="bottom_attach">4</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="AWInServerLabel">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes" context="yes">Incoming server:</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">2</property>
+                 <property name="bottom_attach">3</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="label15">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes" context="yes">Mailbox type:</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">0</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">0</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">1</property>
+                 <property name="top_attach">0</property>
+                 <property name="bottom_attach">1</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkEntry" id="AWInServerComboEntry">
+                 <property name="visible">True</property>
+                 <property name="editable">True</property>
+                 <property name="visibility">True</property>
+                 <property name="max_length">0</property>
+                 <property name="text" translatable="yes"></property>
+                 <property name="has_frame">True</property>
+                 <property name="invisible_char">*</property>
+                 <property name="activates_default">False</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">2</property>
+                 <property name="top_attach">2</property>
+                 <property name="bottom_attach">3</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkComboBox" id="AWMailboxtypeComboBox">
+                 <property name="visible">True</property>
+                 <property name="items" translatable="yes" context="yes">IMAP
+POP
+LOCAL</property>
+                 <property name="add_tearoffs">False</property>
+                 <property name="focus_on_click">True</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">3</property>
+                 <property name="top_attach">0</property>
+                 <property name="bottom_attach">1</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options">fill</property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkCheckButton" id="AWInSSLCheckButton">
+                 <property name="visible">True</property>
+                 <property name="sensitive">False</property>
+                 <property name="can_focus">True</property>
+                 <property name="label" translatable="yes">Use SSL</property>
+                 <property name="use_underline">True</property>
+                 <property name="relief">GTK_RELIEF_NORMAL</property>
+                 <property name="focus_on_click">True</property>
+                 <property name="active">False</property>
+                 <property name="inconsistent">False</property>
+                 <property name="draw_indicator">True</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">2</property>
+                 <property name="right_attach">3</property>
+                 <property name="top_attach">2</property>
+                 <property name="bottom_attach">3</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkLabel" id="MailboxTypeNoteLabel">
+                 <property name="visible">True</property>
+                 <property name="label" translatable="yes" context="yes">Note: You cannot edit mailbox type once setup is complete!</property>
+                 <property name="use_underline">False</property>
+                 <property name="use_markup">False</property>
+                 <property name="justify">GTK_JUSTIFY_LEFT</property>
+                 <property name="wrap">False</property>
+                 <property name="selectable">False</property>
+                 <property name="xalign">1</property>
+                 <property name="yalign">0.5</property>
+                 <property name="xpad">0</property>
+                 <property name="ypad">10</property>
+                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                 <property name="width_chars">-1</property>
+                 <property name="single_line_mode">False</property>
+                 <property name="angle">0</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">0</property>
+                 <property name="right_attach">3</property>
+                 <property name="top_attach">1</property>
+                 <property name="bottom_attach">2</property>
+                 <property name="x_options">fill</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkEntry" id="AWUserNameEntry">
+                 <property name="visible">True</property>
+                 <property name="editable">True</property>
+                 <property name="visibility">True</property>
+                 <property name="max_length">0</property>
+                 <property name="text" translatable="yes"></property>
+                 <property name="has_frame">True</property>
+                 <property name="invisible_char">*</property>
+                 <property name="activates_default">False</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">3</property>
+                 <property name="top_attach">3</property>
+                 <property name="bottom_attach">4</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+
+             <child>
+               <widget class="GtkEntry" id="AWPasswordEntry">
+                 <property name="visible">True</property>
+                 <property name="editable">True</property>
+                 <property name="visibility">False</property>
+                 <property name="max_length">0</property>
+                 <property name="text" translatable="yes"></property>
+                 <property name="has_frame">True</property>
+                 <property name="invisible_char">*</property>
+                 <property name="activates_default">False</property>
+               </widget>
+               <packing>
+                 <property name="left_attach">1</property>
+                 <property name="right_attach">3</property>
+                 <property name="top_attach">4</property>
+                 <property name="bottom_attach">5</property>
+                 <property name="y_options"></property>
+               </packing>
+             </child>
+           </widget>
+           <packing>
+             <property name="tab_expand">False</property>
+             <property name="tab_fill">True</property>
+           </packing>
+         </child>
+
+         <child>
+           <widget class="GtkLabel" id="label65">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes"></property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0.5</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+             <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+             <property name="width_chars">-1</property>
+             <property name="single_line_mode">False</property>
+             <property name="angle">0</property>
+           </widget>
+           <packing>
+             <property name="type">tab</property>
+           </packing>
+         </child>
+
+&n