fix CID 1596595: Resource leaks, and CID 1596594: (CHECKED_RETURN)
[claws.git] / src / wizard.c
index 1686affca2642a4e6b1931c0f96fbae1bc283724..d37f624c4f4cf657939929f8c7fbd26ad4fa08f2 100644 (file)
@@ -1,7 +1,6 @@
 /*
- * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 Colin Leroy <colin@colino.net> 
- * and the Claws Mail team
+ * Claws Mail -- a GTK based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2022 the Claws Mail team and Colin Leroy
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -15,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * 
  */
 
 #ifdef HAVE_CONFIG_H
@@ -35,6 +33,7 @@
 #include <string.h>
 #include <ctype.h>
 
+#include "file-utils.h"
 #include "utils.h"
 #include "gtk/menu.h"
 #include "plugin.h"
@@ -51,6 +50,7 @@
 #endif
 #include "prefs_common.h"
 #include "combobox.h"
+#include "passwordstore.h"
 
 typedef enum
 {
@@ -112,7 +112,7 @@ typedef struct
        GtkWidget *smtp_cert_table;
        GtkWidget *recv_cert_table;
 #endif
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
        GtkWidget *auto_configure_lbl;
        GtkWidget *auto_configure_btn;
        GtkWidget *auto_configure_cancel_btn;
@@ -167,8 +167,8 @@ static PrefParam template_params[] = {
         &tmpl.smtpuser, P_STRING, NULL, NULL, NULL},
        {"smtppass", "",
         &tmpl.smtppass, P_STRING, NULL, NULL, NULL},
-       {"recvtype", A_POP3,
-        &tmpl.recvtype, P_INT, NULL, NULL, NULL},
+       {"recvtype", "0",
+        &tmpl.recvtype, P_ENUM, NULL, NULL, NULL},
        {"recvserver", "pop.$DOMAIN",
         &tmpl.recvserver, P_STRING, NULL, NULL, NULL},
        {"recvuser", "$LOGIN",
@@ -238,8 +238,8 @@ static gchar *accountrc_tmpl =
        "\n"
        "#recvtype can be:\n"
        "#0 for pop3\n"
-       "#3  for imap\n"
-       "#5  for a local mbox file\n"
+       "#1  for imap\n"
+       "#3  for a local mbox file\n"
        "#recvtype=\n"
        "\n"
        "#you can use $DOMAIN here \n"
@@ -271,27 +271,27 @@ static gchar *accountrc_tmpl =
        "#default is \"Mail\"\n"
        "#mailbox=\n"
        "\n"
-       "#whether to use ssl on smtp connections\n"
-       "#default is 0, 1 is ssl, 2 is starttls\n"
+       "#whether to use encryption on SMTP connections\n"
+       "#default is 0, 1 is TLS, 2 is STARTTLS\n"
        "#smtpssl=\n"
        "\n"
-       "#whether to use ssl on pop or imap connections\n"
-       "#default is 0, 1 is ssl, 2 is starttls\n"
+       "#whether to use encryption on POP3 or IMAP connections\n"
+       "#default is 0, 1 is TLS, 2 is STARTTLS\n"
        "#recvssl=\n"
        "\n"
-       "#SSL client certificate path for SMTP\n"
+       "#TLS client certificate path for SMTP\n"
        "#default is empty (no certificate)\n"
        "#smtpssl_cert=\n"
        "\n"
-       "#SSL client certificate path for POP/IMAP\n"
+       "#TLS client certificate path for POP/IMAP\n"
        "#default is empty (no certificate)\n"
        "#recvssl_cert=\n"
        "\n"
-       "#SSL client certificate password for SMTP\n"
+       "#TLS client certificate password for SMTP\n"
        "#default is empty (no password)\n"
        "#smtpssl_cert_pass=\n"
        "\n"
-       "#SSL client certificate password for POP/IMAP\n"
+       "#TLS client certificate password for POP/IMAP\n"
        "#default is empty (no password)\n"
        "#recvssl_cert_pass=\n"
        ;
@@ -328,9 +328,8 @@ static gchar *get_name_for_mail(void)
 #define PARSE_DEFAULT(str) {   \
        gchar *tmp = NULL, *new = NULL; \
        if (str != NULL) {      \
-               tmp = g_strdup(str);    \
                if (strstr(str, "$USERNAME")) { \
-                       tmp = g_strdup(str);    \
+                       tmp = g_strdup(str); \
                        *strstr(tmp, "$USERNAME") = '\0';       \
                        new = g_strconcat(tmp, g_get_real_name(),       \
                                strstr(str, "$USERNAME")+strlen("$USERNAME"),   \
@@ -341,7 +340,7 @@ static gchar *get_name_for_mail(void)
                        new = NULL;     \
                }       \
                if (strstr(str, "$LOGIN")) {    \
-                       tmp = g_strdup(str);    \
+                       tmp = g_strdup(str); \
                        *strstr(tmp, "$LOGIN") = '\0';  \
                        new = g_strconcat(tmp, g_get_user_name(),       \
                                strstr(str, "$LOGIN")+strlen("$LOGIN"),         \
@@ -352,7 +351,7 @@ static gchar *get_name_for_mail(void)
                        new = NULL;     \
                }       \
                if (strstr(str, "$EMAIL")) {    \
-                       tmp = g_strdup(str);    \
+                       tmp = g_strdup(str); \
                        *strstr(tmp, "$EMAIL") = '\0';  \
                        new = g_strconcat(tmp, tmpl.email,      \
                                strstr(str, "$EMAIL")+strlen("$EMAIL"),         \
@@ -363,7 +362,7 @@ static gchar *get_name_for_mail(void)
                        new = NULL;     \
                }       \
                if (strstr(str, "$NAME_MAIL")) {        \
-                       tmp = g_strdup(str);    \
+                       tmp = g_strdup(str); \
                        *strstr(tmp, "$NAME_MAIL") = '\0';      \
                        new = g_strconcat(tmp, get_name_for_mail(),     \
                                strstr(str, "$NAME_MAIL")+strlen("$NAME_MAIL"),         \
@@ -374,7 +373,7 @@ static gchar *get_name_for_mail(void)
                        new = NULL;     \
                }       \
                if (strstr(str, "$DEFAULTDOMAIN")) {    \
-                       tmp = g_strdup(str);    \
+                       tmp = g_strdup(str); \
                        *strstr(tmp, "$DEFAULTDOMAIN") = '\0';  \
                        new = g_strconcat(tmp, wizard_get_default_domain_name(),        \
                                strstr(str, "$DEFAULTDOMAIN")+strlen("$DEFAULTDOMAIN"),         \
@@ -385,7 +384,7 @@ static gchar *get_name_for_mail(void)
                        new = NULL;     \
                }       \
                if (strstr(str, "$DOMAIN")) {   \
-                       tmp = g_strdup(str);    \
+                       tmp = g_strdup(str); \
                        *strstr(tmp, "$DOMAIN") = '\0'; \
                        new = g_strconcat(tmp, tmpl.domain,     \
                                strstr(str, "$DOMAIN")+strlen("$DOMAIN"),       \
@@ -403,7 +402,7 @@ static void wizard_read_defaults(void)
 
        rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, "accountrc.tmpl", NULL);
        if (!is_file_exist(rcpath)) {
-               str_write_to_file(accountrc_tmpl, rcpath);
+               str_write_to_file(accountrc_tmpl, rcpath, TRUE);
        }
 
        prefs_read_config(template_params, "AccountTemplate", rcpath, NULL);
@@ -440,7 +439,8 @@ static void initialize_fonts(WizardWindow *wizard)
        gchar *tmp, *new;
 #ifdef G_OS_WIN32
        PangoFontDescription *bold_desc;
-       gchar *curfont = pango_font_description_to_string(widget->style->font_desc);
+       gchar *curfont = pango_font_description_to_string(
+                       gtk_widget_get_style(widget)->font_desc);
        g_free(prefs_common.smallfont);
        g_free(prefs_common.normalfont);
        g_free(prefs_common.boldfont);
@@ -506,7 +506,7 @@ static void initialize_fonts(WizardWindow *wizard)
 
 static void write_welcome_email(WizardWindow *wizard)
 {
-       gchar buf_date[64];
+       gchar date[RFC822_DATE_BUFFSIZE];
        gchar *head=NULL;
        gchar *body=NULL;
        gchar *msg=NULL;
@@ -516,7 +516,7 @@ static void write_welcome_email(WizardWindow *wizard)
        gchar *file = get_tmp_file();
        gchar enc_from_name[BUFFSIZE], enc_to_name[BUFFSIZE], enc_subject[BUFFSIZE];
        
-       get_rfc822_date(buf_date, sizeof(buf_date));
+       get_rfc822_date(date, sizeof(date));
 
        conv_encode_header_full(enc_subject, sizeof(enc_subject), 
                        C_("Welcome Mail Subject", "Welcome to Claws Mail"),
@@ -537,10 +537,10 @@ static void write_welcome_email(WizardWindow *wizard)
                "Face: %s\n"
                "Content-Type: text/plain; charset=UTF-8\n",
                enc_from_name,
-               USERS_ML_ADDR,
+               WELCOME_MSG_ADDR,
                enc_to_name,
                gtk_entry_get_text(GTK_ENTRY(wizard->email)),
-               buf_date, enc_subject, XFACE, FACE);
+               date, enc_subject, XFACE, FACE);
        body = g_strdup_printf(
                _("\n"
                "Welcome to Claws Mail\n"
@@ -569,7 +569,7 @@ static void write_welcome_email(WizardWindow *wizard)
                "-----------\n"
                "Homepage:      <%s>\n"
                "Manual:        <%s>\n"
-               "FAQ:          <%s>\n"
+               "FAQ:           <%s>\n"
                "Themes:        <%s>\n"
                "Mailing Lists: <%s>\n"
                "\n"
@@ -577,9 +577,8 @@ static void write_welcome_email(WizardWindow *wizard)
                "-------\n"
                "Claws Mail is free software, released under the terms\n"
                "of the GNU General Public License, version 3 or later, as\n"
-               "published by the Free Software Foundation, 51 Franklin Street,\n"
-               "Fifth Floor, Boston, MA 02110-1301, USA. The license can be\n"
-               "found at <%s>.\n"
+               "published by the Free Software Foundation. The license can\n"
+               "be found at <%s>.\n"
                "\n"
                "DONATIONS\n"
                "---------\n"
@@ -591,7 +590,7 @@ static void write_welcome_email(WizardWindow *wizard)
        msg = g_strconcat(head, body, NULL);
 
        if (inbox && inbox->total_msgs == 0
-        && str_write_to_file(msg, file) >= 0) {
+        && str_write_to_file(msg, file, TRUE) >= 0) {
                MsgFlags flags = { MSG_UNREAD|MSG_NEW, 0};
                folder_item_add_msg(inbox, file, &flags, FALSE);
        }
@@ -758,13 +757,16 @@ static gboolean wizard_write_config(WizardWindow *wizard)
 
        prefs_account->userid = g_strdup(
                                gtk_entry_get_text(GTK_ENTRY(wizard->recv_username)));
-       prefs_account->passwd = g_strdup(
-                               gtk_entry_get_text(GTK_ENTRY(wizard->recv_password)));
-
        prefs_account->smtp_userid = g_strdup(
                                gtk_entry_get_text(GTK_ENTRY(wizard->smtp_username)));
-       prefs_account->smtp_passwd = g_strdup(
-                               gtk_entry_get_text(GTK_ENTRY(wizard->smtp_password)));
+
+       passwd_store_set_account(prefs_account->account_id, PWS_ACCOUNT_RECV,
+                       gtk_entry_get_text(GTK_ENTRY(wizard->recv_password)),
+                       FALSE);
+       passwd_store_set_account(prefs_account->account_id, PWS_ACCOUNT_SEND,
+                       gtk_entry_get_text(GTK_ENTRY(wizard->smtp_password)),
+                       FALSE);
+
        if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wizard->smtp_auth))) {
                prefs_account->use_smtp_auth = TRUE;
        }
@@ -795,13 +797,17 @@ static gboolean wizard_write_config(WizardWindow *wizard)
 
        prefs_account->out_ssl_client_cert_file = g_strdup(
                                gtk_entry_get_text(GTK_ENTRY(wizard->smtp_ssl_cert_file)));
-       prefs_account->out_ssl_client_cert_pass = g_strdup(
-                               gtk_entry_get_text(GTK_ENTRY(wizard->smtp_ssl_cert_pass)));
        prefs_account->in_ssl_client_cert_file = g_strdup(
                                gtk_entry_get_text(GTK_ENTRY(wizard->recv_ssl_cert_file)));
-       prefs_account->in_ssl_client_cert_pass = g_strdup(
-                               gtk_entry_get_text(GTK_ENTRY(wizard->recv_ssl_cert_pass)));
+
+       passwd_store_set_account(prefs_account->account_id, PWS_ACCOUNT_SEND_CERT,
+                       gtk_entry_get_text(GTK_ENTRY(wizard->smtp_ssl_cert_pass)),
+                       FALSE);
+       passwd_store_set_account(prefs_account->account_id, PWS_ACCOUNT_RECV_CERT,
+                       gtk_entry_get_text(GTK_ENTRY(wizard->recv_ssl_cert_pass)),
+                       FALSE);
 #endif
+
        if (prefs_account->protocol == A_IMAP4) {
                gchar *directory = gtk_editable_get_chars(
                        GTK_EDITABLE(wizard->recv_imap_subdir), 0, -1);
@@ -837,13 +843,12 @@ static GtkWidget* create_page (WizardWindow *wizard, const char * title)
        GtkWidget *image;
        char *title_string;
 
-       vbox = gtk_vbox_new (FALSE, 6);
+       vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
        gtk_container_set_border_width  (GTK_CONTAINER(vbox), 10);
 
        /* create the titlebar */
-       hbox = gtk_hbox_new (FALSE, 12);
-       image = stock_pixmap_widget(wizard->window, 
-                               STOCK_PIXMAP_CLAWS_MAIL_ICON);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
+       image = priv_pixmap_widget(PRIV_PIXMAP_CLAWS_MAIL_ICON);
        gtk_box_pack_start (GTK_BOX(hbox), image, FALSE, FALSE, 0);
        title_string = g_strconcat ("<span size=\"xx-large\" weight=\"ultrabold\">", title ? title : "", "</span>", NULL);
        w = gtk_label_new (title_string);
@@ -855,12 +860,7 @@ static GtkWidget* create_page (WizardWindow *wizard, const char * title)
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
        /* pack the separator */
-       gtk_box_pack_start (GTK_BOX(vbox), gtk_hseparator_new(), FALSE, FALSE, 0);
-
-       /* pack space */
-       w = gtk_alignment_new (0, 0, 0, 0);
-       gtk_widget_set_size_request (w, 0, 6);
-       gtk_box_pack_start (GTK_BOX(vbox), w, FALSE, FALSE, 0);
+       gtk_box_pack_start (GTK_BOX(vbox), gtk_separator_new(GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 0);
 
        return vbox;
 }
@@ -868,8 +868,7 @@ static GtkWidget* create_page (WizardWindow *wizard, const char * title)
 #define PACK_BOX(hbox,text,entry) {                                    \
        GtkWidget *label = gtk_label_new(text);                         \
        gtk_label_set_use_markup(GTK_LABEL(label), TRUE);               \
-       if (GTK_IS_MISC(label))                                         \
-               gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);        \
+       gtk_label_set_xalign(GTK_LABEL(label), 1.0);                    \
        gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);      \
        gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 0);        \
 }
@@ -949,52 +948,59 @@ static void wizard_email_changed(GtkWidget *widget, gpointer data)
 
 static GtkWidget* user_page (WizardWindow * wizard)
 {
-       GtkWidget *table = gtk_table_new(1,1, FALSE);
+       GtkWidget *table = gtk_grid_new();
        GtkWidget *vbox;
        GtkWidget *label;
        GtkWidget *user_table;
        
-       gtk_table_set_row_spacings(GTK_TABLE(table), 4);
-       gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+       gtk_grid_set_row_spacing(GTK_GRID(table), 4);
+       gtk_grid_set_column_spacing(GTK_GRID(table), 8);
 
-       vbox = gtk_vbox_new(FALSE, VSPACING_NARROW);
+       vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, VSPACING_NARROW);
        gtk_container_set_border_width(GTK_CONTAINER(vbox), VSPACING_NARROW_2);
 
-       gtk_table_attach(GTK_TABLE(table), vbox, 0,1,1,2, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(table), vbox, 0, 1, 1, 1);
 
-       user_table = gtk_table_new(3, 2, FALSE);
-       gtk_table_set_row_spacings(GTK_TABLE(user_table), VSPACING_NARROW);
+       user_table = gtk_grid_new();
+       gtk_grid_set_row_spacing(GTK_GRID(user_table), VSPACING_NARROW);
        gtk_box_pack_start(GTK_BOX(vbox), user_table, FALSE, FALSE, 0);
 
-       label = gtk_label_new(_("<span weight=\"bold\">Your name:</span>"));
+       label = gtk_label_new(g_strconcat("<span weight=\"bold\">", _("Your name:"),
+                                         "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
-       gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
-       gtk_table_attach(GTK_TABLE(user_table), label, 0,1,0,1, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_label_set_xalign(GTK_LABEL(label), 1.0);
+       gtk_grid_attach(GTK_GRID(user_table), label, 0, 0, 1, 1);
+
        wizard->full_name = gtk_entry_new();
        gtk_entry_set_text(GTK_ENTRY(wizard->full_name), tmpl.name?tmpl.name:"");
-       gtk_table_attach(GTK_TABLE(user_table), wizard->full_name, 1,2,0,1, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(user_table), wizard->full_name, 1, 0, 1, 1);
+       gtk_widget_set_hexpand(wizard->full_name, TRUE);
+       gtk_widget_set_halign(wizard->full_name, GTK_ALIGN_FILL);
+       gtk_widget_set_margin_start(wizard->full_name, 4);
 
-       label = gtk_label_new(_("<span weight=\"bold\">Your email address:</span>"));
+       label = gtk_label_new(g_strconcat("<span weight=\"bold\">", _("Your email address:"),
+                                         "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
-       gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
-       gtk_table_attach(GTK_TABLE(user_table), label, 0,1,1,2, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_label_set_xalign(GTK_LABEL(label), 1.0);
+       gtk_grid_attach(GTK_GRID(user_table), label, 0, 1, 1, 1);
+
        wizard->email = gtk_entry_new();
        gtk_entry_set_text(GTK_ENTRY(wizard->email), tmpl.email?tmpl.email:"");
-       gtk_table_attach(GTK_TABLE(user_table), wizard->email, 1,2,1,2, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(user_table), wizard->email, 1, 1, 1, 1);
+       gtk_widget_set_hexpand(wizard->email, TRUE);
+       gtk_widget_set_halign(wizard->email, GTK_ALIGN_FILL);
+       gtk_widget_set_margin_start(wizard->email, 4);
 
        label = gtk_label_new(_("Your organization:"));
-       gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
-       gtk_table_attach(GTK_TABLE(user_table), label, 0,1,2,3, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_label_set_xalign(GTK_LABEL(label), 1.0);
+       gtk_grid_attach(GTK_GRID(user_table), label, 0, 2, 1, 1);
+
        wizard->organization = gtk_entry_new();
        gtk_entry_set_text(GTK_ENTRY(wizard->organization), tmpl.organization?tmpl.organization:"");
-       gtk_table_attach(GTK_TABLE(user_table), wizard->organization, 1,2,2,3, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(user_table), wizard->organization, 1, 2, 1, 1);
+       gtk_widget_set_hexpand(wizard->organization, TRUE);
+       gtk_widget_set_halign(wizard->organization, GTK_ALIGN_FILL);
+       gtk_widget_set_margin_start(wizard->organization, 4);
        
        g_signal_connect(G_OBJECT(wizard->email), "changed",
                         G_CALLBACK(wizard_email_changed),
@@ -1004,28 +1010,27 @@ static GtkWidget* user_page (WizardWindow * wizard)
 
 static GtkWidget* mailbox_page (WizardWindow * wizard)
 {
-       GtkWidget *table = gtk_table_new(1,1, FALSE);
+       GtkWidget *table = gtk_grid_new();
        GtkWidget *vbox;
        GtkWidget *hbox;
 
-       gtk_table_set_row_spacings(GTK_TABLE(table), 4);
-       gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+       gtk_grid_set_row_spacing(GTK_GRID(table), 4);
+       gtk_grid_set_column_spacing(GTK_GRID(table), 8);
 
-       vbox = gtk_vbox_new(FALSE, VSPACING_NARROW);
+       vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, VSPACING_NARROW);
        gtk_container_set_border_width(GTK_CONTAINER(vbox), VSPACING_NARROW_2);
 
-       gtk_table_attach(GTK_TABLE(table), vbox, 0,1,1,2, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(table), vbox, 0, 1, 1, 1);
 
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
-       wizard->mailbox_label = gtk_label_new(_("<span weight=\"bold\">Mailbox name:</span>"));
+       wizard->mailbox_label = gtk_label_new(g_strconcat("<span weight=\"bold\">",
+                                                         _("Mailbox name:"), "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(wizard->mailbox_label), TRUE);
-       if (GTK_IS_MISC(wizard->mailbox_label))                                               
-               gtk_misc_set_alignment(GTK_MISC(wizard->mailbox_label), 1, 0.5);              
-       wizard->mailbox_name = gtk_entry_new();
+       gtk_label_set_xalign(GTK_LABEL(wizard->mailbox_label), 1.0);
 
+       wizard->mailbox_name = gtk_entry_new();
        gtk_entry_set_text(GTK_ENTRY(wizard->mailbox_name), tmpl.mailbox?tmpl.mailbox:"");
 
        CLAWS_SET_TIP(wizard->mailbox_name, _("You can also specify an absolute path, for example: "
@@ -1060,7 +1065,7 @@ static void cert_browse_cb(GtkWidget *widget, gpointer data)
 
        utf8_filename = g_filename_to_utf8(filename, -1, NULL, NULL, NULL);
        if (!utf8_filename) {
-               g_warning("cert_browse_cb(): failed to convert character set.");
+               g_warning("cert_browse_cb(): failed to convert character set");
                utf8_filename = g_strdup(filename);
        }
        gtk_entry_set_text(dest, utf8_filename);
@@ -1070,7 +1075,7 @@ static void cert_browse_cb(GtkWidget *widget, gpointer data)
 
 static GtkWidget* smtp_page (WizardWindow * wizard)
 {
-       GtkWidget *table = gtk_table_new(1, 1, FALSE);
+       GtkWidget *table = gtk_grid_new();
        GtkWidget *vbox;
        GtkWidget *hbox;
        GtkWidget *hbox_spc;
@@ -1082,16 +1087,15 @@ static GtkWidget* smtp_page (WizardWindow * wizard)
 #endif
        gchar *text;
        
-       gtk_table_set_row_spacings(GTK_TABLE(table), 4);
-       gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+       gtk_grid_set_row_spacing(GTK_GRID(table), 4);
+       gtk_grid_set_column_spacing(GTK_GRID(table), 8);
 
-       vbox = gtk_vbox_new(FALSE, VSPACING_NARROW);
+       vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, VSPACING_NARROW);
        gtk_container_set_border_width(GTK_CONTAINER(vbox), VSPACING_NARROW_2);
 
-       gtk_table_attach(GTK_TABLE(table), vbox, 0,1,1,2, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(table), vbox, 0, 1, 1, 1);
 
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
        wizard->smtp_server = gtk_entry_new();
        text = get_default_server(wizard, "smtp");
@@ -1102,10 +1106,10 @@ static GtkWidget* smtp_page (WizardWindow * wizard)
                             _("You can specify the port number by appending it at the end: "
                               "\"mail.example.com:25\""));
 
-       PACK_BOX(hbox, _("<span weight=\"bold\">SMTP server address:</span>"),
-                wizard->smtp_server);
+       PACK_BOX(hbox, g_strconcat("<span weight=\"bold\">", _("SMTP server address:"),
+                                  "</span>", NULL), wizard->smtp_server);
 
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
        wizard->smtp_auth = gtk_check_button_new_with_label(
                                        _("Use authentication"));
@@ -1116,102 +1120,124 @@ static GtkWidget* smtp_page (WizardWindow * wizard)
                         wizard);
        gtk_box_pack_start(GTK_BOX(hbox), wizard->smtp_auth, FALSE, FALSE, 0);
 
-       label = gtk_label_new(_("<span size=\"small\">(empty to use the same as receive)</span>"));
+       label = gtk_label_new(g_strconcat("<span size=\"small\">",
+                                         _("(empty to use the same as receive)"), "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
        SET_TOGGLE_SENSITIVITY (wizard->smtp_auth, label);      
        gtk_box_pack_end(GTK_BOX(hbox), label, FALSE, FALSE, 0);
 
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-       hbox_spc = gtk_hbox_new (FALSE, 0);
+       hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_widget_set_size_request (hbox_spc, 12, -1);
        gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
-       smtp_auth_table = gtk_table_new(2, 2, FALSE);
+
+       smtp_auth_table = gtk_grid_new();
        SET_TOGGLE_SENSITIVITY (wizard->smtp_auth, smtp_auth_table);
        gtk_box_pack_start(GTK_BOX(hbox), smtp_auth_table, TRUE, TRUE, 0);
 
        wizard->smtp_username_label = gtk_label_new(_("SMTP username:"));
-       gtk_misc_set_alignment(GTK_MISC(wizard->smtp_username_label), 1, 0.5);        
-       gtk_table_attach(GTK_TABLE(smtp_auth_table), wizard->smtp_username_label, 0,1,0,1, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_label_set_xalign(GTK_LABEL(wizard->smtp_username_label), 1.0);
+       gtk_grid_attach(GTK_GRID(smtp_auth_table), wizard->smtp_username_label, 0, 0, 1, 1);
+       
        text = get_default_smtp_account(wizard);
        wizard->smtp_username = gtk_entry_new();
        gtk_entry_set_text(GTK_ENTRY(wizard->smtp_username), text);
        g_free(text);
-       gtk_table_attach(GTK_TABLE(smtp_auth_table), wizard->smtp_username, 1,2,0,1, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(smtp_auth_table), wizard->smtp_username, 1, 0, 1, 1);
+       gtk_widget_set_margin_start(wizard->smtp_username, 4);
+       gtk_widget_set_margin_bottom(wizard->smtp_username, 4);
+       gtk_widget_set_hexpand(wizard->smtp_username, TRUE);
+       gtk_widget_set_halign(wizard->smtp_username, GTK_ALIGN_FILL);
 
        wizard->smtp_password_label = gtk_label_new(_("SMTP password:"));
-       gtk_misc_set_alignment(GTK_MISC(wizard->smtp_password_label), 1, 0.5);        
-       gtk_table_attach(GTK_TABLE(smtp_auth_table), wizard->smtp_password_label, 0,1,1,2, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_label_set_xalign(GTK_LABEL(wizard->smtp_password_label), 1.0);
+       gtk_grid_attach(GTK_GRID(smtp_auth_table), wizard->smtp_password_label, 0, 1, 1, 1);
+
        wizard->smtp_password = gtk_entry_new();
        gtk_entry_set_text(GTK_ENTRY(wizard->smtp_password), tmpl.smtppass?tmpl.smtppass:""); 
        gtk_entry_set_visibility(GTK_ENTRY(wizard->smtp_password), FALSE);
-       gtk_table_attach(GTK_TABLE(smtp_auth_table), wizard->smtp_password, 1,2,1,2, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(smtp_auth_table), wizard->smtp_password, 1, 1, 1, 1);
+       gtk_widget_set_hexpand(wizard->smtp_password, TRUE);
+       gtk_widget_set_halign(wizard->smtp_password, GTK_ALIGN_FILL);
+       gtk_widget_set_margin_start(wizard->smtp_password, 4);
+
 #ifdef USE_GNUTLS
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
        wizard->smtp_use_ssl = gtk_check_button_new_with_label(
-                                       _("Use SSL to connect to SMTP server"));
+                                       _("Use TLS to connect to SMTP server"));
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->smtp_use_ssl),
                        tmpl.smtpssl != 0);
        gtk_box_pack_start(GTK_BOX(hbox), wizard->smtp_use_ssl, FALSE, FALSE, 0);
 
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-       hbox_spc = gtk_hbox_new (FALSE, 0);
+       hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
        gtk_widget_set_size_request (hbox_spc, 12, -1);
        wizard->smtp_use_tls = gtk_check_button_new_with_label(
-                                       _("Use SSL via STARTTLS"));
+                                       _("Use STARTTLS command to start encryption"));
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->smtp_use_tls),
                        tmpl.smtpssl == 2);
        gtk_box_pack_start(GTK_BOX(hbox), wizard->smtp_use_tls, FALSE, FALSE, 0);
        SET_TOGGLE_SENSITIVITY (wizard->smtp_use_ssl, wizard->smtp_use_tls);
        
-       smtp_cert_table = gtk_table_new(3,3, FALSE);
+       smtp_cert_table = gtk_grid_new();
        gtk_box_pack_start (GTK_BOX(vbox), smtp_cert_table, FALSE, FALSE, 4);
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
-       hbox_spc = gtk_hbox_new (FALSE, 0);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
+       hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_widget_set_size_request (hbox_spc, 12, -1);
        gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
-       label = gtk_label_new(_("Client SSL certificate (optional)"));
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+       label = gtk_label_new(_("Client TLS certificate (optional)"));
+       gtk_label_set_xalign(GTK_LABEL(label), 0.0);
        gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-       gtk_table_attach(GTK_TABLE(smtp_cert_table), hbox, 0, 3, 0, 1, GTK_FILL, 0, 0, 0);
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
-       hbox_spc = gtk_hbox_new (FALSE, 0);
+       gtk_grid_attach(GTK_GRID(smtp_cert_table), hbox, 0, 0, 1, 1);
+
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
+       hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_widget_set_size_request (hbox_spc, 12, -1);
        gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
-       label = gtk_label_new(_("File"));
-       gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
+       label = gtk_label_new(_("File:"));
+       gtk_label_set_xalign(GTK_LABEL(label), 1.0);
+       gtk_widget_set_margin_start(label, 4);
+       gtk_widget_set_margin_bottom(label, 4);
        gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
-       gtk_table_attach(GTK_TABLE(smtp_cert_table), hbox, 0, 1, 1, 2, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_grid_attach(GTK_GRID(smtp_cert_table), hbox, 0, 1, 1, 1);
+
        wizard->smtp_ssl_cert_file = gtk_entry_new();
        gtk_entry_set_text(GTK_ENTRY(wizard->smtp_ssl_cert_file), tmpl.smtpssl_cert?tmpl.smtpssl_cert:"");
-       gtk_table_attach(GTK_TABLE(smtp_cert_table), wizard->smtp_ssl_cert_file, 1, 2, 1, 2, GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(smtp_cert_table), wizard->smtp_ssl_cert_file, 1, 1, 1, 1);
+       gtk_widget_set_hexpand(wizard->smtp_ssl_cert_file, TRUE);
+       gtk_widget_set_halign(wizard->smtp_ssl_cert_file, GTK_ALIGN_FILL);
+       gtk_widget_set_margin_start(wizard->smtp_ssl_cert_file, 4);
+       gtk_widget_set_margin_end(wizard->smtp_ssl_cert_file, 4);
+       gtk_widget_set_margin_bottom(wizard->smtp_ssl_cert_file, 4);
+
        button = gtkut_get_browse_file_btn(_("Browse"));
-       gtk_table_attach(GTK_TABLE(smtp_cert_table), button, 2, 3, 1, 2, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_grid_attach(GTK_GRID(smtp_cert_table), button, 2, 1, 1, 1);
+
        g_signal_connect(G_OBJECT(button), "clicked",
                         G_CALLBACK(cert_browse_cb), wizard->smtp_ssl_cert_file);
 
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
-       hbox_spc = gtk_hbox_new (FALSE, 0);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
+       hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_widget_set_size_request (hbox_spc, 12, -1);
        gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0); 
-       label = gtk_label_new(_("Password"));
-       gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
+       label = gtk_label_new(_("Password:"));
+       gtk_label_set_xalign(GTK_LABEL(label), 1.0);
+       gtk_widget_set_margin_start(label, 4);
        gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
-       gtk_table_attach(GTK_TABLE(smtp_cert_table), hbox, 0, 1, 2, 3, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_grid_attach(GTK_GRID(smtp_cert_table), hbox, 0, 2, 1, 1);
+
        wizard->smtp_ssl_cert_pass = gtk_entry_new();
        gtk_entry_set_visibility(GTK_ENTRY(wizard->smtp_ssl_cert_pass), FALSE);
        gtk_entry_set_text(GTK_ENTRY(wizard->smtp_ssl_cert_pass), tmpl.smtpssl_cert_pass?tmpl.smtpssl_cert_pass:"");
-       gtk_table_attach(GTK_TABLE(smtp_cert_table), wizard->smtp_ssl_cert_pass, 1, 2, 2, 3, GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(smtp_cert_table), wizard->smtp_ssl_cert_pass, 1, 2, 1, 1);
+       gtk_widget_set_hexpand(wizard->smtp_ssl_cert_pass, TRUE);
+       gtk_widget_set_halign(wizard->smtp_ssl_cert_pass, GTK_ALIGN_FILL);
+       gtk_widget_set_margin_start(wizard->smtp_ssl_cert_pass, 4);
+
        SET_TOGGLE_SENSITIVITY (wizard->smtp_use_ssl, smtp_cert_table);
        wizard->smtp_cert_table = smtp_cert_table;
 #endif
@@ -1239,12 +1265,14 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_widget_show(wizard->recv_use_tls);
                gtk_widget_show(wizard->recv_cert_table);
 #endif
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
                gtk_widget_show(wizard->auto_configure_btn);
                gtk_widget_hide(wizard->auto_configure_cancel_btn);
                gtk_widget_show(wizard->auto_configure_lbl);
 #endif
-               gtk_label_set_text(GTK_LABEL(wizard->recv_label), _("<span weight=\"bold\">Server address:</span>"));
+               gtk_label_set_text(GTK_LABEL(wizard->recv_label),
+                                  g_strconcat("<span weight=\"bold\">", _("Server address:"),
+                                               "</span>", NULL));
                gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
                gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
                g_free(text);
@@ -1269,12 +1297,14 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_widget_show(wizard->recv_use_tls);
                gtk_widget_show(wizard->recv_cert_table);
 #endif
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
                gtk_widget_show(wizard->auto_configure_btn);
                gtk_widget_hide(wizard->auto_configure_cancel_btn);
                gtk_widget_show(wizard->auto_configure_lbl);
 #endif
-               gtk_label_set_text(GTK_LABEL(wizard->recv_label), _("<span weight=\"bold\">Server address:</span>"));
+               gtk_label_set_text(GTK_LABEL(wizard->recv_label),
+                                  g_strconcat("<span weight=\"bold\">", _("Server address:"),
+                                               "</span>", NULL));
                gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
                gtk_dialog_set_response_sensitive (GTK_DIALOG(wizard->window), GO_FORWARD, TRUE);
                g_free(text);
@@ -1304,7 +1334,9 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
 #endif
        } else if (protocol == A_LOCAL) {
                gtk_entry_set_text(GTK_ENTRY(wizard->recv_server), tmpl.mboxfile?tmpl.mboxfile:"");
-               gtk_label_set_text(GTK_LABEL(wizard->recv_label), _("<span weight=\"bold\">Local mailbox:</span>"));
+               gtk_label_set_text(GTK_LABEL(wizard->recv_label), 
+                                  g_strconcat("<span weight=\"bold\">", _("Local mailbox:"),
+                                              "</span>", NULL));
                gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
                gtk_widget_hide(wizard->no_imap_warning);
                gtk_widget_hide(wizard->recv_imap_label);
@@ -1314,7 +1346,7 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
                gtk_widget_hide(wizard->recv_password);
                gtk_widget_hide(wizard->recv_username_label);
                gtk_widget_hide(wizard->recv_password_label);
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
                gtk_widget_hide(wizard->auto_configure_btn);
                gtk_widget_hide(wizard->auto_configure_cancel_btn);
                gtk_widget_hide(wizard->auto_configure_lbl);
@@ -1340,11 +1372,10 @@ static void wizard_protocol_changed(GtkComboBox *combo, gpointer data)
        wizard_protocol_change(wizard, protocol);       
 }
 
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 static void auto_configure_cb (GtkWidget *widget, gpointer data)
 {
        gchar *address = NULL;
-       const gchar *domain = NULL;
        AutoConfigureData *recv_data;
        AutoConfigureData *send_data;
        static GCancellable *recv_cancel = NULL;
@@ -1369,24 +1400,25 @@ static void auto_configure_cb (GtkWidget *widget, gpointer data)
 
        address = gtk_editable_get_chars(GTK_EDITABLE(wizard->email), 0, -1);
 
-       if (strchr(address, '@') < 0) {
+       if (strchr(address, '@') == NULL) {
                g_free(address);
                gtk_label_set_text(GTK_LABEL(wizard->auto_configure_lbl),
                           _("Failed (wrong address)"));
+               return;
        }
-       domain = strchr(address, '@') + 1;
 
        if (protocol == A_POP3 || protocol == A_IMAP4) {
                recv_data = g_new0(AutoConfigureData, 1);
                recv_data->configure_button = GTK_BUTTON(wizard->auto_configure_btn);
                recv_data->cancel_button = GTK_BUTTON(wizard->auto_configure_cancel_btn);
                recv_data->info_label = GTK_LABEL(wizard->auto_configure_lbl);
+               recv_data->uid_entry = GTK_ENTRY(wizard->recv_username);
                recv_data->cancel = recv_cancel;
                switch(protocol) {
                case A_POP3:
                        recv_data->ssl_service = "pop3s";
                        recv_data->tls_service = "pop3";
-                       recv_data->domain = g_strdup(domain);
+                       recv_data->address = g_strdup(address);
                        recv_data->hostname_entry = GTK_ENTRY(wizard->recv_server);
                        recv_data->set_port = NULL;
                        recv_data->port = NULL;
@@ -1398,7 +1430,7 @@ static void auto_configure_cb (GtkWidget *widget, gpointer data)
                case A_IMAP4:
                        recv_data->ssl_service = "imaps";
                        recv_data->tls_service = "imap";
-                       recv_data->domain = g_strdup(domain);
+                       recv_data->address = g_strdup(address);
                        recv_data->hostname_entry = GTK_ENTRY(wizard->recv_server);
                        recv_data->set_port = NULL;
                        recv_data->port = NULL;
@@ -1421,7 +1453,7 @@ static void auto_configure_cb (GtkWidget *widget, gpointer data)
 
        send_data->ssl_service = NULL;
        send_data->tls_service = "submission";
-       send_data->domain = g_strdup(domain);
+       send_data->address = g_strdup(address);
        send_data->hostname_entry = GTK_ENTRY(wizard->smtp_server);
        send_data->set_port = NULL;
        send_data->port = NULL;
@@ -1439,7 +1471,7 @@ static void auto_configure_cb (GtkWidget *widget, gpointer data)
 
 static GtkWidget* recv_page (WizardWindow * wizard)
 {
-       GtkWidget *table = gtk_table_new(1,1, FALSE);
+       GtkWidget *table = gtk_grid_new();
        GtkWidget *vbox;
        GtkWidget *hbox;
        GtkWidget *hbox_spc;    
@@ -1449,7 +1481,7 @@ static GtkWidget* recv_page (WizardWindow * wizard)
        GtkWidget *button;
        GtkWidget *recv_cert_table;
 #endif
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
        GtkWidget *auto_configure_btn;
        GtkWidget *auto_configure_cancel_btn;
        GtkWidget *auto_configure_lbl;
@@ -1459,46 +1491,23 @@ static GtkWidget* recv_page (WizardWindow * wizard)
        gchar *text;
        gint index = 0;
 
-       gtk_table_set_row_spacings(GTK_TABLE(table), 4);
-       gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+       gtk_grid_set_row_spacing(GTK_GRID(table), 4);
+       gtk_grid_set_column_spacing(GTK_GRID(table), 8);
 
-       vbox = gtk_vbox_new(FALSE, VSPACING_NARROW);
+       vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, VSPACING_NARROW);
        gtk_container_set_border_width(GTK_CONTAINER(vbox), VSPACING_NARROW_2);
 
-       gtk_table_attach(GTK_TABLE(table), vbox, 0,1,1,2, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(table), vbox, 0, 1, 1, 1);
 
-       recv_table = gtk_table_new(4, 2, FALSE); 
+       recv_table = gtk_grid_new(); 
 
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
-       auto_configure_btn = gtk_button_new_with_label(_("Auto-configure"));
-       gtk_box_pack_start(GTK_BOX (hbox), auto_configure_btn, FALSE, FALSE, 0);
-       auto_configure_cancel_btn = gtk_button_new_with_label(_("Cancel"));
-       gtk_box_pack_start(GTK_BOX (hbox), auto_configure_cancel_btn, FALSE, FALSE, 0);
-       auto_configure_lbl = gtk_label_new("");
-       gtk_label_set_justify(GTK_LABEL(auto_configure_lbl), GTK_JUSTIFY_LEFT);
-       gtk_box_pack_start(GTK_BOX (hbox), auto_configure_lbl, FALSE, FALSE, 0);
-       gtk_widget_show(auto_configure_btn);
-       gtk_widget_show(auto_configure_lbl);
-       gtk_widget_show(hbox);
-       gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-       wizard->auto_configure_lbl = auto_configure_lbl;
-       wizard->auto_configure_btn = auto_configure_btn;
-       wizard->auto_configure_cancel_btn = auto_configure_cancel_btn;
-       g_signal_connect (G_OBJECT (auto_configure_btn), "clicked",
-                         G_CALLBACK (auto_configure_cb), wizard);
-       g_signal_connect (G_OBJECT (auto_configure_cancel_btn), "clicked",
-                         G_CALLBACK (auto_configure_cb), wizard);
-#endif
        gtk_box_pack_start(GTK_BOX(vbox), recv_table, FALSE, FALSE, 0);
 
-
-       label = gtk_label_new(_("<span weight=\"bold\">Server type:</span>"));
-       gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
+       label = gtk_label_new(g_strconcat("<span weight=\"bold\">", _("Server type:"), "</span>", NULL));
+       gtk_label_set_xalign(GTK_LABEL(label), 1.0);
        gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
-       gtk_table_attach(GTK_TABLE(recv_table), label, 0,1,0,1, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_grid_attach(GTK_GRID(recv_table), label, 0, 0, 1, 1);
+
        wizard->recv_type = gtkut_sc_combobox_create(NULL, FALSE);
        store = GTK_LIST_STORE(gtk_combo_box_get_model(
                        GTK_COMBO_BOX(wizard->recv_type)));
@@ -1521,126 +1530,171 @@ static GtkWidget* recv_page (WizardWindow * wizard)
                index = 0;
        }
        gtk_combo_box_set_active(GTK_COMBO_BOX (wizard->recv_type), index);
+       gtk_widget_set_margin_start(wizard->recv_type, 4);
        g_signal_connect(G_OBJECT(wizard->recv_type), "changed",
                         G_CALLBACK(wizard_protocol_changed),
                         wizard);
-       gtk_table_attach(GTK_TABLE(recv_table), wizard->recv_type, 1,2,0,1, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(recv_table), wizard->recv_type, 1, 0, 1, 1);
 
-       wizard->recv_label = gtk_label_new(_("<span weight=\"bold\">Server address:</span>"));
-       gtk_misc_set_alignment(GTK_MISC(wizard->recv_label), 1, 0.5);
+#if defined USE_GNUTLS
+       auto_configure_btn = gtk_button_new_with_label(_("Auto-configure"));
+       auto_configure_cancel_btn = gtk_button_new_with_label(_("Cancel"));
+       gtk_grid_attach(GTK_GRID(recv_table), auto_configure_btn, 0, 1, 1, 1);
+
+       auto_configure_lbl = gtk_label_new("");
+       gtk_label_set_xalign(GTK_LABEL(auto_configure_lbl), 0.0);
+       gtk_grid_attach(GTK_GRID(recv_table), auto_configure_lbl, 1, 1, 1, 1);
+
+       gtk_widget_show(auto_configure_btn);
+       gtk_widget_show(auto_configure_lbl);
+       wizard->auto_configure_lbl = auto_configure_lbl;
+       wizard->auto_configure_btn = auto_configure_btn;
+       wizard->auto_configure_cancel_btn = auto_configure_cancel_btn;
+       g_signal_connect (G_OBJECT (auto_configure_btn), "clicked",
+                         G_CALLBACK (auto_configure_cb), wizard);
+       g_signal_connect (G_OBJECT (auto_configure_cancel_btn), "clicked",
+                         G_CALLBACK (auto_configure_cb), wizard);
+#endif
+
+       wizard->recv_label = gtk_label_new(g_strconcat("<span weight=\"bold\">",
+                                               _("Server address:"), "</span>", NULL));
+       gtk_label_set_xalign(GTK_LABEL(wizard->recv_label), 1.0);
        gtk_label_set_use_markup(GTK_LABEL(wizard->recv_label), TRUE);
-       gtk_table_attach(GTK_TABLE(recv_table), wizard->recv_label, 0,1,1,2, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_grid_attach(GTK_GRID(recv_table), wizard->recv_label, 0, 2, 1, 1);
+
        wizard->recv_server = gtk_entry_new();
        text = get_default_server(wizard, "pop");
        gtk_entry_set_text(GTK_ENTRY(wizard->recv_server), text);
+       gtk_widget_set_margin_start(wizard->recv_server, 4);
+       gtk_widget_set_margin_bottom(wizard->recv_server, 4);
        g_free(text);
        
        CLAWS_SET_TIP(wizard->recv_server,
                             _("You can specify the port number by appending it at the end: "
                               "\"mail.example.com:110\""));
-       gtk_table_attach(GTK_TABLE(recv_table), wizard->recv_server, 1,2,1,2, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
-       
-       wizard->recv_username_label = gtk_label_new(_("<span weight=\"bold\">Username:</span>"));
-       gtk_misc_set_alignment(GTK_MISC(wizard->recv_username_label), 1, 0.5);
+       gtk_grid_attach(GTK_GRID(recv_table), wizard->recv_server, 1, 2, 1, 1);
+       gtk_widget_set_hexpand(wizard->recv_server, TRUE);
+       gtk_widget_set_halign(wizard->recv_server, GTK_ALIGN_FILL);
+
+       wizard->recv_username_label = gtk_label_new(g_strconcat("<span weight=\"bold\">",
+                                                               _("Username:"),"</span>", NULL));
+       gtk_label_set_xalign(GTK_LABEL(wizard->recv_username_label), 1.0);
        gtk_label_set_use_markup(GTK_LABEL(wizard->recv_username_label), TRUE);
-       gtk_table_attach(GTK_TABLE(recv_table), wizard->recv_username_label, 0,1,2,3, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_grid_attach(GTK_GRID(recv_table), wizard->recv_username_label, 0, 3, 1, 1);
+
        wizard->recv_username = gtk_entry_new();
        text = get_default_account(wizard);
        gtk_entry_set_text(GTK_ENTRY(wizard->recv_username), text);
        g_free(text);
-       gtk_table_attach(GTK_TABLE(recv_table), wizard->recv_username, 1,2,2,3, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(recv_table), wizard->recv_username, 1, 3, 1, 1);
+       gtk_widget_set_hexpand(wizard->recv_username, TRUE);
+       gtk_widget_set_halign(wizard->recv_username, GTK_ALIGN_FILL);
+       gtk_widget_set_margin_start(wizard->recv_username, 4);
+       gtk_widget_set_margin_bottom(wizard->recv_username, 4);
                         
        wizard->recv_password_label = gtk_label_new(_("Password:"));
-       gtk_misc_set_alignment(GTK_MISC(wizard->recv_password_label), 1, 0.5);
-       gtk_table_attach(GTK_TABLE(recv_table), wizard->recv_password_label, 0,1,3,4, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_label_set_xalign(GTK_LABEL(wizard->recv_password_label), 1.0);
+       gtk_grid_attach(GTK_GRID(recv_table), wizard->recv_password_label, 0, 4, 1, 1);
+
        wizard->recv_password = gtk_entry_new();
        gtk_entry_set_text(GTK_ENTRY(wizard->recv_password), tmpl.recvpass?tmpl.recvpass:"");
        gtk_entry_set_visibility(GTK_ENTRY(wizard->recv_password), FALSE);
-       gtk_table_attach(GTK_TABLE(recv_table), wizard->recv_password, 1,2,3,4, 
-                        GTK_EXPAND|GTK_FILL, 0, 0, 0); 
+       gtk_grid_attach(GTK_GRID(recv_table), wizard->recv_password, 1, 4, 1, 1);
+       gtk_widget_set_hexpand(wizard->recv_password, TRUE);
+       gtk_widget_set_halign(wizard->recv_password, GTK_ALIGN_FILL);
+       gtk_widget_set_margin_start(wizard->recv_password, 4);
+
+
 #ifdef USE_GNUTLS
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
        wizard->recv_use_ssl = gtk_check_button_new_with_label(
-                                       _("Use SSL to connect to receiving server"));
+                                       _("Use TLS to connect to receiving server"));
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->recv_use_ssl),
                        tmpl.recvssl != 0);
        gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_use_ssl, FALSE, FALSE, 0);
 
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-       hbox_spc = gtk_hbox_new (FALSE, 0);
+       hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_widget_set_size_request (hbox_spc, 12, -1);
        gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0); 
        wizard->recv_use_tls = gtk_check_button_new_with_label(
-                                       _("Use SSL via STARTTLS"));
+                                       _("Use STARTTLS command to start encryption"));
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wizard->recv_use_tls),
                        tmpl.recvssl == 2);
        gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_use_tls, FALSE, FALSE, 0);
        SET_TOGGLE_SENSITIVITY (wizard->recv_use_ssl, wizard->recv_use_tls);
 
-       recv_cert_table = gtk_table_new(3,3, FALSE);
+       recv_cert_table = gtk_grid_new();
+       
        gtk_box_pack_start (GTK_BOX(vbox), recv_cert_table, FALSE, FALSE, 4);
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
-       hbox_spc = gtk_hbox_new (FALSE, 0);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
+       hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_widget_set_size_request (hbox_spc, 12, -1);
        gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
-       label = gtk_label_new(_("Client SSL certificate (optional)"));
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+       label = gtk_label_new(_("Client TLS certificate (optional)"));
+       gtk_label_set_xalign(GTK_LABEL(label), 0.0);
        gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);    
-       gtk_table_attach(GTK_TABLE(recv_cert_table), hbox, 0, 3, 0, 1, GTK_FILL, 0, 0, 0);
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
-       hbox_spc = gtk_hbox_new (FALSE, 0);
+       gtk_grid_attach(GTK_GRID(recv_cert_table), hbox, 0, 0, 1, 1);
+
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
+       hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_widget_set_size_request (hbox_spc, 12, -1);
        gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
-       label = gtk_label_new(_("File"));
-       gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
+
+       label = gtk_label_new(_("File:"));
+       gtk_label_set_xalign(GTK_LABEL(label), 1.0);
        gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);      
-       gtk_table_attach(GTK_TABLE(recv_cert_table), hbox, 0, 1, 1, 2, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_grid_attach(GTK_GRID(recv_cert_table), hbox, 0, 1, 1, 1);
        wizard->recv_ssl_cert_file = gtk_entry_new();
        gtk_entry_set_text(GTK_ENTRY(wizard->recv_ssl_cert_file), tmpl.recvssl_cert?tmpl.recvssl_cert:"");
-       gtk_table_attach(GTK_TABLE(recv_cert_table), wizard->recv_ssl_cert_file, 1, 2, 1, 2, GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(recv_cert_table), wizard->recv_ssl_cert_file, 1, 1, 1, 1);
+       gtk_widget_set_hexpand(wizard->recv_ssl_cert_file, TRUE);
+       gtk_widget_set_halign(wizard->recv_ssl_cert_file, GTK_ALIGN_FILL);
+       gtk_widget_set_margin_start(wizard->recv_ssl_cert_file, 4);
+       gtk_widget_set_margin_end(wizard->recv_ssl_cert_file, 4);
+       gtk_widget_set_margin_bottom(wizard->recv_ssl_cert_file, 4);
+
        button = gtkut_get_browse_file_btn(_("Browse"));
-       gtk_table_attach(GTK_TABLE(recv_cert_table), button, 2, 3, 1, 2, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_grid_attach(GTK_GRID(recv_cert_table), button, 2, 1, 1, 1);
+
        g_signal_connect(G_OBJECT(button), "clicked",
                         G_CALLBACK(cert_browse_cb), wizard->recv_ssl_cert_file);
 
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
-       hbox_spc = gtk_hbox_new (FALSE, 0);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
+       hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_widget_set_size_request (hbox_spc, 12, -1);
        gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
-       label = gtk_label_new(_("Password"));
-       gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
+       label = gtk_label_new(_("Password:"));
+       gtk_label_set_xalign(GTK_LABEL(label), 1.0);
        gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
-       gtk_table_attach(GTK_TABLE(recv_cert_table), hbox, 0, 1, 2, 3, 
-                        GTK_FILL, 0, VSPACING_NARROW, 0);
+       gtk_grid_attach(GTK_GRID(recv_cert_table), hbox, 0, 2, 1, 1);
+
        wizard->recv_ssl_cert_pass = gtk_entry_new();
        gtk_entry_set_visibility(GTK_ENTRY(wizard->recv_ssl_cert_pass), FALSE);
        gtk_entry_set_text(GTK_ENTRY(wizard->recv_ssl_cert_pass), tmpl.recvssl_cert_pass?tmpl.recvssl_cert_pass:"");
-       gtk_table_attach(GTK_TABLE(recv_cert_table), wizard->recv_ssl_cert_pass, 1, 2, 2, 3, GTK_FILL, 0, 0, 0);
+       gtk_grid_attach(GTK_GRID(recv_cert_table), wizard->recv_ssl_cert_pass, 1, 2, 1, 1);
+       gtk_widget_set_hexpand(wizard->recv_ssl_cert_pass, TRUE);
+       gtk_widget_set_halign(wizard->recv_ssl_cert_pass, GTK_ALIGN_FILL);
+       gtk_widget_set_margin_start(wizard->recv_ssl_cert_pass, 4);
+       gtk_widget_set_margin_bottom(wizard->recv_ssl_cert_pass, 4);
+
        SET_TOGGLE_SENSITIVITY (wizard->recv_use_ssl, recv_cert_table); 
        wizard->recv_cert_table = recv_cert_table;
 #endif 
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
        wizard->recv_imap_subdir = gtk_entry_new();
        gtk_entry_set_text(GTK_ENTRY(wizard->recv_imap_subdir), tmpl.imapdir?tmpl.imapdir:"");
        wizard->recv_imap_label = gtk_label_new(_("IMAP server directory:"));
-       gtk_misc_set_alignment(GTK_MISC(wizard->recv_imap_label), 1, 0.5);            
+       gtk_label_set_xalign(GTK_LABEL(wizard->recv_imap_label), 1.0);
        gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_imap_label, FALSE, FALSE, 0);
        gtk_box_pack_start(GTK_BOX(hbox), wizard->recv_imap_subdir, TRUE, TRUE, 0);
        
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-       hbox_spc = gtk_hbox_new (FALSE, 0);
+       hbox_spc = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
        gtk_widget_set_size_request (hbox_spc, 12, -1);
        gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
        wizard->subsonly_checkbtn = gtk_check_button_new_with_label(
@@ -1649,11 +1703,11 @@ static GtkWidget* recv_page (WizardWindow * wizard)
                        tmpl.subsonly);
        gtk_box_pack_start(GTK_BOX(hbox), wizard->subsonly_checkbtn, FALSE, FALSE, 0);
        
-       hbox = gtk_hbox_new(FALSE, VSPACING_NARROW);
+       hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, VSPACING_NARROW);
        gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-       wizard->no_imap_warning = gtk_label_new(_(
-                         "<span weight=\"bold\">Warning: this version of Claws Mail\n"
-                         "has been built without IMAP support.</span>"));
+       wizard->no_imap_warning = gtk_label_new(g_strconcat("<span weight=\"bold\">",
+                       _("Warning: this version of Claws Mail\n"
+                         "has been built without IMAP support."), "</span>", NULL));
        gtk_label_set_use_markup(GTK_LABEL(wizard->no_imap_warning), TRUE);
        gtk_box_pack_start(GTK_BOX(hbox), wizard->no_imap_warning, FALSE, FALSE, 0);
 
@@ -1749,7 +1803,8 @@ static gint wizard_close_cb(GtkWidget *widget, GdkEventAny *event,
 
 #define PACK_WARNING(text) {                                           \
        label = gtk_label_new(text);                                    \
-       gtk_misc_set_alignment(GTK_MISC(label), 0, 0);                  \
+       gtk_label_set_xalign(GTK_LABEL(label), 0.0);                    \
+       gtk_label_set_yalign(GTK_LABEL(label), 0.0);                    \
        gtk_box_pack_end(GTK_BOX(widget), label, FALSE, FALSE, 0);      \
 }
 
@@ -1772,13 +1827,13 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
        
        wizard->window = gtk_dialog_new_with_buttons (_("Claws Mail Setup Wizard"),
                        NULL, 0, 
-                       GTK_STOCK_GO_BACK, GO_BACK,
-                       GTK_STOCK_GO_FORWARD, GO_FORWARD,
-                       GTK_STOCK_SAVE, FINISHED,
-                       GTK_STOCK_CANCEL, CANCEL,
+                       _("_Previous"), GO_BACK,
+                       _("_Next"), GO_FORWARD,
+                       _("_Save"), FINISHED,
+                       _("_Cancel"), CANCEL,
                        NULL);
-       gtk_widget_set_size_request(wizard->window, -1, 480);
        gtk_window_set_position(GTK_WINDOW(wizard->window), GTK_WIN_POS_CENTER);
+       gtk_window_set_default_size(GTK_WINDOW(wizard->window), 550, 500);
 
        g_signal_connect(wizard->window, "response", 
                          G_CALLBACK(wizard_response_cb), wizard);
@@ -1807,8 +1862,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
        page = create_page(wizard, _("Welcome to Claws Mail"));
        
        wizard->pages = g_slist_append(wizard->pages, page);
-       widget = stock_pixmap_widget(wizard->window, 
-                               STOCK_PIXMAP_CLAWS_MAIL_LOGO);
+       widget = priv_pixmap_widget(PRIV_PIXMAP_CLAWS_MAIL_LOGO);
 
        gtk_box_pack_start (GTK_BOX(page), widget, FALSE, FALSE, 0);
        
@@ -1831,8 +1885,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
                                         GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
        gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
 
-       gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
-                                             user_page(wizard));
+       gtk_container_add(GTK_CONTAINER(scrolled_window), user_page(wizard));
        PACK_WARNING(_("Bold fields must be completed"));
        
        wizard->pages = g_slist_append(wizard->pages, widget);
@@ -1846,8 +1899,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
                                         GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
        gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
 
-       gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
-                                             recv_page(wizard));
+       gtk_container_add(GTK_CONTAINER(scrolled_window), recv_page(wizard));
        PACK_WARNING(_("Bold fields must be completed"));
        
        wizard->pages = g_slist_append(wizard->pages, widget);
@@ -1861,8 +1913,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
                                         GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
        gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
 
-       gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
-                                             smtp_page(wizard));
+       gtk_container_add(GTK_CONTAINER(scrolled_window), smtp_page(wizard));
        PACK_WARNING(_("Bold fields must be completed"));
        
        wizard->pages = g_slist_append(wizard->pages, widget);
@@ -1877,8 +1928,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
                                         GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
                gtk_box_pack_start(GTK_BOX(widget), scrolled_window, TRUE, TRUE, 0);
 
-               gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
-                                             mailbox_page(wizard));
+               gtk_container_add(GTK_CONTAINER(scrolled_window), mailbox_page(wizard));
                PACK_WARNING(_("Bold fields must be completed"));
        
                wizard->pages = g_slist_append(wizard->pages, widget);
@@ -1890,8 +1940,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
        page = create_page(wizard, _("Configuration finished"));
        
        wizard->pages = g_slist_append(wizard->pages, page);
-       widget = stock_pixmap_widget(wizard->window, 
-                               STOCK_PIXMAP_CLAWS_MAIL_LOGO);
+       widget = priv_pixmap_widget(PRIV_PIXMAP_CLAWS_MAIL_LOGO);
 
        gtk_box_pack_start (GTK_BOX(page), widget, FALSE, FALSE, 0);
        
@@ -1914,7 +1963,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
        gtk_widget_hide(wizard->recv_imap_label);
        gtk_widget_hide(wizard->recv_imap_subdir);
        gtk_widget_hide(wizard->subsonly_checkbtn);
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
        gtk_widget_hide(wizard->auto_configure_cancel_btn);
 #endif
        wizard_protocol_change(wizard, tmpl.recvtype);