2008-10-07 [colin] 3.6.0cvs13
[claws.git] / src / mainwindow.c
index 4d2c9e3524b3ed62c4fc9893138c913aa22ff38a..0c5ed63f2553051c5351fdeafac02d06b256ef4e 100644 (file)
@@ -187,6 +187,8 @@ static void view_source_cb          (GtkAction      *action,
 
 static void show_all_header_cb         (GtkAction      *action,
                                  gpointer       data);
+static void toggle_fullscreen_cb       (GtkAction      *action,
+                                 gpointer       data);
 
 static void hide_quotes_cb(GtkAction   *action,
                                  gpointer       data);
@@ -386,6 +388,9 @@ static void addr_harvest_msg_cb      ( GtkAction    *action,
 static void sync_cb             ( GtkAction    *action,
                                  gpointer       data );
 
+static void forget_session_passwords_cb        (GtkAction      *action,
+                                        gpointer        data );
+
 static gboolean mainwindow_focus_in_event      (GtkWidget      *widget, 
                                                 GdkEventFocus  *focus,
                                                 gpointer        data);
@@ -637,8 +642,8 @@ static GtkActionEntry mainwin_entries[] =
        {"Message/Mark/Lock",                   NULL, N_("Lock"), NULL, NULL, G_CALLBACK(lock_msgs_cb) },
        {"Message/Mark/Unlock",                 NULL, N_("Unlock"), NULL, NULL, G_CALLBACK(unlock_msgs_cb) },
 
-       {"Message/ColorLabel",                  NULL, "Color la_bel" },
-       {"Message/Tags",                        NULL, "Ta_gs" },
+       {"Message/ColorLabel",                  NULL, N_("Color la_bel") },
+       {"Message/Tags",                        NULL, N_("Ta_gs") },
        /*{"Message/---",                       NULL, "---" },*/
 
        {"Message/Reedit",                      NULL, N_("Re-_edit"), NULL, NULL, G_CALLBACK(reedit_cb) },
@@ -689,8 +694,12 @@ static GtkActionEntry mainwin_entries[] =
        {"Tools/SSLCertificates",               NULL, N_("SSL cer_tificates"), NULL, NULL, G_CALLBACK(ssl_manager_open_cb) }, 
 #endif
        /* {"Tools/---",                        NULL, "---", NULL, NULL, NULL }, */
+#ifndef G_OS_WIN32
        {"Tools/FilteringLog",                  NULL, N_("Filtering Lo_g"), NULL, NULL, G_CALLBACK(filtering_debug_window_show_cb) }, 
+#endif
        {"Tools/NetworkLog",                    NULL, N_("Network _Log"), "<shift><control>L", NULL, G_CALLBACK(log_window_show_cb) }, 
+       /* {"Tools/---",                        NULL, "---", NULL, NULL, NULL }, */
+       {"Tools/ForgetSessionPasswords",                NULL, N_("_Forget all session passwords"), NULL, NULL, G_CALLBACK(forget_session_passwords_cb) }, 
 
 /* Configuration menu */       
        {"Configuration/ChangeAccount",         NULL, N_("C_hange current account") },
@@ -720,13 +729,16 @@ static GtkActionEntry mainwin_entries[] =
 
 static GtkToggleActionEntry mainwin_toggle_entries[] = {
        {"File/OfflineMode",                    NULL, N_("Offline _mode"), "<control>W", NULL, G_CALLBACK(toggle_work_offline_cb) }, /*toggle*/
-       {"View/ShowHide/MessageView",           NULL, N_("_Message view"), NULL, NULL, G_CALLBACK(toggle_message_cb) }, /* toggle */
+       {"View/ShowHide/MessageView",           NULL, N_("_Message view"), "V", NULL, G_CALLBACK(toggle_message_cb) }, /* toggle */
 #ifndef GENERIC_UMPC
        {"View/ShowHide/StatusBar",             NULL, N_("Status _bar"), NULL, NULL, G_CALLBACK(toggle_statusbar_cb) }, /* toggle */
 #endif
        {"View/ShowHide/ColumnHeaders",         NULL, N_("Column headers"), NULL, NULL, G_CALLBACK(toggle_col_headers_cb) }, /* toggle */
        {"View/ThreadView",                     NULL, N_("Th_read view"), "<control>T", NULL, G_CALLBACK(thread_cb) }, /* toggle */
        {"View/HideReadMessages",               NULL, N_("_Hide read messages"), NULL, NULL, G_CALLBACK(hide_read_messages) }, /* toggle */
+#ifndef MAEMO
+       {"View/FullScreen",                     NULL, N_("_Fullscreen"), "F11", NULL, G_CALLBACK(toggle_fullscreen_cb) }, /* toggle */
+#endif
        {"View/AllHeaders",                     NULL, N_("Show all _headers"), "<control>H", NULL, G_CALLBACK(show_all_header_cb) }, /* toggle */
        {"View/Quotes/FoldAll",                 NULL, N_("_Fold all"), "<control><shift>Q", NULL, G_CALLBACK(hide_quotes_cb) }, /* 1 toggle */
        {"View/Quotes/Fold2",                   NULL, N_("Fold from level _2"), NULL, NULL, G_CALLBACK(hide_quotes_cb) }, /* 2 toggle */
@@ -742,7 +754,7 @@ static GtkRadioActionEntry mainwin_showhide_radio_entries[] = { /* toggle_toolba
        {"View/ShowHide/Toolbar/Hide",          NULL, N_("_Hide"), NULL, NULL, TOOLBAR_NONE }, /* radio TOOLBAR_NONE */
 #endif
 };
-
+#ifndef GENERIC_UMPC
 static GtkRadioActionEntry mainwin_layout_radio_entries[] = { /* set_layout_cb */
        {"View/Layout/Standard",                NULL, N_("_Standard"), NULL, NULL, NORMAL_LAYOUT }, /* radio NORMAL_LAYOUT */
        {"View/Layout/ThreeColumns",            NULL, N_("_Three columns"), NULL, NULL, VERTICAL_LAYOUT }, /* radio VERTICAL_LAYOUT */
@@ -750,7 +762,7 @@ static GtkRadioActionEntry mainwin_layout_radio_entries[] = { /* set_layout_cb *
        {"View/Layout/WideMessageList",         NULL, N_("W_ide message list"), NULL, NULL, WIDE_MSGLIST_LAYOUT }, /* radio WIDE_MSGLIST_LAYOUT */
        {"View/Layout/SmallScreen",             NULL, N_("S_mall screen"), NULL, NULL, SMALL_LAYOUT }, /* radio SMALL_LAYOUT */
 };
-
+#endif
 static GtkRadioActionEntry mainwin_sort_radio_entries[] = { /* sort_summary_cb */
        {"View/Sort/Number",                    NULL, N_("by _Number"), NULL, NULL, SORT_BY_NUMBER }, /* radio SORT_BY_NUMBER */
        {"View/Sort/Size",                      NULL, N_("by S_ize"), NULL, NULL, SORT_BY_SIZE }, /* radio SORT_BY_SIZE */
@@ -776,21 +788,21 @@ static GtkRadioActionEntry mainwin_sorttype_radio_entries[] = { /* sort_summary_
 
 static GtkRadioActionEntry mainwin_radio_enc_entries[] =
 {
-       ENC_ACTION(CS_AUTO, C_AUTO, "_Automatic"), /* RADIO set_charset_cb */
-       ENC_ACTION(CS_US_ASCII, C_US_ASCII, "7bit ASCII (US-ASC_II)"), /* RADIO set_charset_cb */
-       ENC_ACTION(CS_UTF_8, C_UTF_8, "Unicode (_UTF-8)"), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_AUTO, C_AUTO, N_("_Automatic")), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_US_ASCII, C_US_ASCII, N_("7bit ASCII (US-ASC_II)")), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_UTF_8, C_UTF_8, N_("Unicode (_UTF-8)")), /* RADIO set_charset_cb */
        ENC_ACTION("Western/"CS_ISO_8859_1, C_ISO_8859_1, "ISO-8859-_1"), /* RADIO set_charset_cb */
        ENC_ACTION("Western/"CS_ISO_8859_15, C_ISO_8859_15, "ISO-8859-15"), /* RADIO set_charset_cb */
        ENC_ACTION("Western/"CS_WINDOWS_1252, C_WINDOWS_1252, "Windows-1252"), /* RADIO set_charset_cb */
-       ENC_ACTION(CS_ISO_8859_2, C_ISO_8859_2, "Central European (ISO-8859-_2)"), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_ISO_8859_2, C_ISO_8859_2, N_("Central European (ISO-8859-_2)")), /* RADIO set_charset_cb */
        ENC_ACTION("Baltic/"CS_ISO_8859_13, C_ISO_8859_13, "ISO-8859-13"), /* RADIO set_charset_cb */
        ENC_ACTION("Baltic/"CS_ISO_8859_4, C_ISO_8859_14, "ISO-8859-_4"), /* RADIO set_charset_cb */
-       ENC_ACTION(CS_ISO_8859_7, C_ISO_8859_7, "Greek (ISO-8859-_7)"), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_ISO_8859_7, C_ISO_8859_7, N_("Greek (ISO-8859-_7)")), /* RADIO set_charset_cb */
        ENC_ACTION("Hebrew/"CS_ISO_8859_8, C_ISO_8859_8, "ISO-8859-_8"), /* RADIO set_charset_cb */
        ENC_ACTION("Hebrew/"CS_WINDOWS_1255, C_WINDOWS_1255, "Windows-1255"), /* RADIO set_charset_cb */
        ENC_ACTION("Arabic/"CS_ISO_8859_6, C_ISO_8859_6, "ISO-8859-_6"), /* RADIO set_charset_cb */
        ENC_ACTION("Arabic/"CS_WINDOWS_1256, C_WINDOWS_1256, "Windows-1256"), /* RADIO set_charset_cb */
-       ENC_ACTION(CS_ISO_8859_9, C_ISO_8859_9, "Turkish (ISO-8859-_9)"), /* RADIO set_charset_cb */
+       ENC_ACTION(CS_ISO_8859_9, C_ISO_8859_9, N_("Turkish (ISO-8859-_9)")), /* RADIO set_charset_cb */
        ENC_ACTION("Cyrillic/"CS_ISO_8859_5, C_ISO_8859_5, "ISO-8859-_5"), /* RADIO set_charset_cb */
        ENC_ACTION("Cyrillic/"CS_KOI8_R, C_KOI8_R, "KOI8-_R"), /* RADIO set_charset_cb */
        ENC_ACTION("Cyrillic/"CS_KOI8_U, C_KOI8_U, "KOI8-_U"), /* RADIO set_charset_cb */
@@ -811,7 +823,7 @@ static GtkRadioActionEntry mainwin_radio_enc_entries[] =
 
 static GtkRadioActionEntry mainwin_radio_dec_entries[] =
 {
-       DEC_ACTION("AutoDetect", 0, "_Auto detect"),    /* set_decode_cb */
+       DEC_ACTION("AutoDetect", 0, N_("_Auto detect")),        /* set_decode_cb */
        /* --- */
        DEC_ACTION("8bit", ENC_8BIT, "_8bit"),
        DEC_ACTION("QP", ENC_QUOTED_PRINTABLE, "_Quoted printable"),
@@ -865,7 +877,7 @@ static void mainwindow_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_i
        Xalloca(items, (N_COLOR_LABELS + 1) * sizeof(GtkWidget *), return);
 
        /* NOTE: don't return prematurely because we set the "dont_toggle"
-        * state for check menu items */
+        * state for check menu items. This would be bad! */
        g_object_set_data(G_OBJECT(menu), "dont_toggle",
                          GINT_TO_POINTER(1));
 
@@ -1031,6 +1043,33 @@ static void mainwindow_tags_menu_item_activate_cb(GtkWidget *widget,
        summary_set_tag(mainwin->summaryview, id, NULL);
 }
 
+void mainwin_accel_changed_cb (GtkAccelGroup *accelgroup, guint keyval, GdkModifierType modifier,
+                                 GClosure *closure, GtkMenuItem *item)
+{
+       GList *closures = gtk_widget_list_accel_closures(GTK_WIDGET(item));
+       GList *cur;
+       for (cur = closures; cur; cur = cur->next) {
+               if (closure == cur->data) {
+                       GtkLabel *label = g_object_get_data(G_OBJECT(item), "accel_label");
+                       gchar *new_accel;
+                       
+                       if (keyval == GDK_BackSpace) {
+                               const gchar *accel_path;
+#if GTK_CHECK_VERSION(2,14,0)
+                               accel_path = gtk_menu_item_get_accel_path(item);
+#else
+                               accel_path = GTK_MENU_ITEM(item)->accel_path;
+#endif
+                               keyval = 0; modifier = 0;
+                               gtk_accel_map_change_entry (accel_path, keyval, modifier, TRUE);
+                       }
+                       new_accel = gtk_accelerator_get_label(keyval, modifier);
+                       gtk_label_set_text(label, new_accel);
+                       g_free(new_accel);
+               }
+       }
+}
+
 static void mainwindow_colorlabel_menu_create(MainWindow *mainwin, gboolean refresh)
 {
        GtkWidget *label_menuitem;
@@ -1062,10 +1101,10 @@ static void mainwindow_colorlabel_menu_create(MainWindow *mainwin, gboolean refr
        g_object_set_data(G_OBJECT(item), "mainwin", mainwin);
        gtk_widget_show(item);
 
-       gtk_widget_add_accelerator(item, "activate", 
-                                  gtk_ui_manager_get_accel_group(mainwin->ui_manager), 
-                                  GDK_0, GDK_CONTROL_MASK,
-                                  GTK_ACCEL_LOCKED | GTK_ACCEL_VISIBLE);
+       accel_path = g_strdup_printf("<ClawsColorLabels>/None");
+       gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), accel_path);
+       g_free(accel_path);
+       gtk_accel_map_add_entry("<ClawsColorLabels>/None", GDK_0, GDK_CONTROL_MASK);
 
        item = gtk_menu_item_new();
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
@@ -1082,14 +1121,15 @@ static void mainwindow_colorlabel_menu_create(MainWindow *mainwin, gboolean refr
                g_object_set_data(G_OBJECT(item), "mainwin",
                                  mainwin);
                gtk_widget_show(item);
-               accel_path = g_strdup_printf("<ClawsColorLabels>/%d", i);
+               accel_path = g_strdup_printf("<ClawsColorLabels>/%d", i+1);
                gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), accel_path);
-               g_free(accel_path);
                if (i < 9)
-                       gtk_widget_add_accelerator(item, "activate", 
-                                  gtk_ui_manager_get_accel_group(mainwin->ui_manager), 
-                                  GDK_1+i, GDK_CONTROL_MASK,
-                                  GTK_ACCEL_LOCKED | GTK_ACCEL_VISIBLE);
+                       gtk_accel_map_add_entry(accel_path, GDK_1+i, GDK_CONTROL_MASK);
+               g_free(accel_path);
+               g_signal_connect (gtk_ui_manager_get_accel_group(mainwin->ui_manager), 
+                       "accel-changed", G_CALLBACK (mainwin_accel_changed_cb), item);
+
+
        }
        gtk_widget_show(menu);
        gtk_menu_item_set_submenu(GTK_MENU_ITEM(label_menuitem), menu);
@@ -1179,10 +1219,6 @@ static void mainwindow_tags_menu_create(MainWindow *mainwin, gboolean refresh)
        }
 
        item = gtk_menu_item_new_with_label(_("Apply tags..."));
-       gtk_widget_add_accelerator(item, "activate", 
-                  gtk_ui_manager_get_accel_group(mainwin->ui_manager), 
-                  GDK_T, GDK_CONTROL_MASK|GDK_SHIFT_MASK,
-                  GTK_ACCEL_LOCKED | GTK_ACCEL_VISIBLE);
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
        g_signal_connect(G_OBJECT(item), "activate",
                         G_CALLBACK(mainwindow_tags_menu_item_apply_tags_activate_cb),
@@ -1190,6 +1226,10 @@ static void mainwindow_tags_menu_create(MainWindow *mainwin, gboolean refresh)
        g_object_set_data(G_OBJECT(item), "mainwin",
                          mainwin);
        gtk_widget_show(item);
+       accel_path = g_strdup_printf("<ClawsTags>/ApplyTags");
+       gtk_menu_item_set_accel_path(GTK_MENU_ITEM(item), accel_path);
+       g_free(accel_path);
+       gtk_accel_map_add_entry("<ClawsTags>/ApplyTags", GDK_T, GDK_CONTROL_MASK|GDK_SHIFT_MASK);
 
        g_slist_free(orig);
        gtk_widget_show(menu);
@@ -1266,6 +1306,7 @@ static gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
                app_exit_cb(NULL, mainwin);
                return FALSE;
        case GDK_space:
+               BREAK_ON_MODIFIER_KEY();
                if (gtk_window_is_active(GTK_WINDOW(mainwin->window))) {
                        if (mainwin->folderview && mainwin->summaryview
                            && ((!mainwin->summaryview->displayed
@@ -1278,6 +1319,7 @@ static gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
                        }
                }
                break;
+
 #ifdef MAEMO
        case GDK_F6:
                if (maemo_mainwindow_is_fullscreen(widget)) {
@@ -1522,8 +1564,10 @@ MainWindow *main_window_create()
                        G_N_ELEMENTS(mainwin_toggle_entries), (gpointer)mainwin);
        gtk_action_group_add_radio_actions(mainwin->action_group, mainwin_showhide_radio_entries,
                        G_N_ELEMENTS(mainwin_showhide_radio_entries), C_AUTO, G_CALLBACK(toggle_toolbar_cb), (gpointer)mainwin);
+#ifndef GENERIC_UMPC
        gtk_action_group_add_radio_actions(mainwin->action_group, mainwin_layout_radio_entries,
                        G_N_ELEMENTS(mainwin_layout_radio_entries), C_AUTO, G_CALLBACK(set_layout_cb), (gpointer)mainwin);
+#endif
        gtk_action_group_add_radio_actions(mainwin->action_group, mainwin_sort_radio_entries,
                        G_N_ELEMENTS(mainwin_sort_radio_entries), C_AUTO, G_CALLBACK(sort_summary_cb), (gpointer)mainwin);
        gtk_action_group_add_radio_actions(mainwin->action_group, mainwin_sorttype_radio_entries,
@@ -1536,7 +1580,7 @@ MainWindow *main_window_create()
 #ifndef MAEMO
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/", "Menu", NULL, GTK_UI_MANAGER_MENUBAR)
 #else
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/", "Menu", NULL, GTK_UI_MANAGER_MENU)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/", "Menu", NULL, GTK_UI_MANAGER_POPUP)
 #endif
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu", "File", "File", GTK_UI_MANAGER_MENU)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu", "Edit", "Edit", GTK_UI_MANAGER_MENU)
@@ -1599,6 +1643,9 @@ MainWindow *main_window_create()
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/SetColumns", "Messagelist", "View/SetColumns/Messagelist", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator1", "View/---", GTK_UI_MANAGER_SEPARATOR)
 
+#ifndef MAEMO
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "FullScreen", "View/FullScreen", GTK_UI_MANAGER_MENUITEM)
+#endif
 #ifndef GENERIC_UMPC
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Layout", "View/Layout", GTK_UI_MANAGER_MENU)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "Standard", "View/Layout/Standard", GTK_UI_MANAGER_MENUITEM)
@@ -1640,22 +1687,22 @@ MainWindow *main_window_create()
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Goto", "View/Goto", GTK_UI_MANAGER_MENU)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Prev", "View/Goto/Prev", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Next", "View/Goto/Next", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator1", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator1", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "PrevUnread", "View/Goto/PrevUnread", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextUnread", "View/Goto/NextUnread", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator2", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator2", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "PrevNew", "View/Goto/PrevNew", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextNew", "View/Goto/NextNew", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator3", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator3", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "PrevMarked", "View/Goto/PrevMarked", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextMarked", "View/Goto/NextMarked", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator4", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator4", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "PrevLabeled", "View/Goto/PrevLabeled", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextLabeled", "View/Goto/NextLabeled", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator5", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator5", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "LastRead", "View/Goto/LastRead", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "ParentMessage", "View/Goto/ParentMessage", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator6", "View/Goto/---", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator6", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextUnreadFolder", "View/Goto/NextUnreadFolder", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "OtherFolder", "View/Goto/OtherFolder", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator4", "View/---", GTK_UI_MANAGER_SEPARATOR)
@@ -1783,7 +1830,7 @@ MainWindow *main_window_create()
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Mark", "Message/Mark", GTK_UI_MANAGER_MENU)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "Mark", "Message/Mark/Mark", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "Unmark", "Message/Mark/Unmark", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "---", "Message/Mark/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "Separator1", "Message/Mark/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "MarkUnread", "Message/Mark/MarkUnread", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "MarkRead", "Message/Mark/MarkRead", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "MarkAllRead", "Message/Mark/MarkAllRead", GTK_UI_MANAGER_MENUITEM)
@@ -1791,10 +1838,10 @@ MainWindow *main_window_create()
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "UnignoreThread", "Message/Mark/UnignoreThread", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "WatchThread", "Message/Mark/WatchThread", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "UnwatchThread", "Message/Mark/UnwatchThread", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "---", "Message/Mark/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "Separator2", "Message/Mark/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "MarkSpam", "Message/Mark/MarkSpam", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "MarkHam", "Message/Mark/MarkHam", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "---", "Message/Mark/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "Separator3", "Message/Mark/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "Lock", "Message/Mark/Lock", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Mark", "Unlock", "Message/Mark/Unlock", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "ColorLabel", "Message/ColorLabel", GTK_UI_MANAGER_MENUITEM)
@@ -1847,9 +1894,13 @@ MainWindow *main_window_create()
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "SSLCertificates", "Tools/SSLCertificates", GTK_UI_MANAGER_MENUITEM)
 #endif
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator7", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
+#ifndef G_OS_WIN32
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "FilteringLog", "Tools/FilteringLog", GTK_UI_MANAGER_MENUITEM)
+#endif
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "NetworkLog", "Tools/NetworkLog", GTK_UI_MANAGER_MENUITEM)
-               MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator8", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator8", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "ForgetSessionPasswords", "Tools/ForgetSessionPasswords", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "Separator9", "Tools/---", GTK_UI_MANAGER_SEPARATOR)
 
 /* Configuration menu */
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Configuration", "ChangeAccount", "Configuration/ChangeAccount", GTK_UI_MANAGER_MENU)
@@ -1888,7 +1939,6 @@ MainWindow *main_window_create()
        hildon_window_set_menu(HILDON_WINDOW(window), GTK_MENU(menubar));
 #endif
 
-
        if (prefs_common.toolbar_detachable) {
                handlebox = gtk_handle_box_new();
                gtk_widget_show(handlebox);
@@ -2143,6 +2193,9 @@ MainWindow *main_window_create()
        }
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
 
+       toolbar_set_style(mainwin->toolbar->toolbar, 
+                         mainwin->handlebox, 
+                         prefs_common.toolbar_style);
 #ifndef GENERIC_UMPC
        gtk_widget_hide(mainwin->hbox_stat);
        menuitem = gtk_ui_manager_get_widget(mainwin->ui_manager, "/Menu/View/ShowHide/StatusBar");
@@ -2222,6 +2275,13 @@ MainWindow *main_window_create()
 
 #ifdef MAEMO
        main_window_install_maemo_hooks(mainwin);
+#endif
+#ifndef MAEMO
+       if (prefs_common.mainwin_fullscreen) {
+               cm_toggle_menu_set_active_full(mainwin->ui_manager, 
+                       "Menu/View/FullScreen",
+                       TRUE);
+       }
 #endif
        return mainwin;
 }
@@ -2653,9 +2713,9 @@ static void main_window_separation_change(MainWindow *mainwin, LayoutType layout
                    prefs_common.layout_mode, layout_mode);
 
        /* remove widgets from those containers */
-       gtk_widget_ref(folder_wid);
-       gtk_widget_ref(summary_wid);
-       gtk_widget_ref(message_wid);
+       g_object_ref(folder_wid);
+       g_object_ref(summary_wid);
+       g_object_ref(message_wid);
        gtkut_container_remove
                (GTK_CONTAINER(folder_wid->parent), folder_wid);
        gtkut_container_remove
@@ -2667,9 +2727,9 @@ static void main_window_separation_change(MainWindow *mainwin, LayoutType layout
        main_window_set_widgets(mainwin, layout_mode);
        gtk_widget_show(mainwin->window);
 
-       gtk_widget_unref(folder_wid);
-       gtk_widget_unref(summary_wid);
-       gtk_widget_unref(message_wid);
+       g_object_unref(folder_wid);
+       g_object_unref(summary_wid);
+       g_object_unref(message_wid);
 }
 #endif
 void mainwindow_reset_paned(GtkPaned *paned)
@@ -2735,14 +2795,14 @@ void main_window_toggle_message_view(MainWindow *mainwin)
                if (ppaned->parent != NULL) {
                        mainwin->messageview->visible = FALSE;
                        summaryview->displayed = NULL;
-                       gtk_widget_ref(ppaned);
+                       g_object_ref(ppaned);
                        gtkut_container_remove(GTK_CONTAINER(container), ppaned);
                        gtk_widget_reparent(GTK_WIDGET_PTR(summaryview), container);
                } else {
                        mainwin->messageview->visible = TRUE;
                        gtk_widget_reparent(GTK_WIDGET_PTR(summaryview), ppaned);
                        gtk_container_add(GTK_CONTAINER(container), ppaned);
-                       gtk_widget_unref(ppaned);
+                       g_object_unref(ppaned);
                }
                break;
        case WIDE_LAYOUT:
@@ -2751,12 +2811,12 @@ void main_window_toggle_message_view(MainWindow *mainwin)
                if (mainwin->messageview->vbox->parent != NULL) {
                        mainwin->messageview->visible = FALSE;
                        summaryview->displayed = NULL;
-                       gtk_widget_ref(mainwin->messageview->vbox);
+                       g_object_ref(mainwin->messageview->vbox);
                        gtkut_container_remove(GTK_CONTAINER(container), mainwin->messageview->vbox);
                } else {
                        mainwin->messageview->visible = TRUE;
                        gtk_container_add(GTK_CONTAINER(container), mainwin->messageview->vbox);
-                       gtk_widget_unref(mainwin->messageview->vbox);
+                       g_object_unref(mainwin->messageview->vbox);
                }
                break;
        case WIDE_MSGLIST_LAYOUT:
@@ -2799,8 +2859,12 @@ void main_window_get_size(MainWindow *mainwin)
        }
 
        allocation = &(GTK_WIDGET_PTR(mainwin->summaryview)->allocation);
-
-       if (allocation->width > 1 && allocation->height > 1) {
+       
+       if (prefs_common.mainwin_fullscreen) {
+               debug_print("mainwin in full screen state. "
+                           "Keeping original settings\n");
+       }
+       if (allocation->width > 1 && allocation->height > 1 && !prefs_common.mainwin_fullscreen) {
                prefs_common.summaryview_width = allocation->width;
 
                if (messageview_is_visible(mainwin->messageview))
@@ -2811,20 +2875,22 @@ void main_window_get_size(MainWindow *mainwin)
 
        allocation = &mainwin->window->allocation;
        if (allocation->width > 1 && allocation->height > 1 &&
-           !prefs_common.mainwin_maximised) {
+           !prefs_common.mainwin_maximised && !prefs_common.mainwin_fullscreen) {
                prefs_common.mainview_height = allocation->height;
                prefs_common.mainwin_width   = allocation->width;
                prefs_common.mainwin_height  = allocation->height;
        }
 
        allocation = &(GTK_WIDGET_PTR(mainwin->folderview)->allocation);
-       if (allocation->width > 1 && allocation->height > 1) {
+       if (allocation->width > 1 && allocation->height > 1 &&
+           !prefs_common.mainwin_fullscreen) {
                prefs_common.folderview_width  = allocation->width;
                prefs_common.folderview_height = allocation->height;
        }
 
        allocation = &(GTK_WIDGET_PTR(mainwin->messageview)->allocation);
-       if (allocation->width > 1 && allocation->height > 1) {
+       if (allocation->width > 1 && allocation->height > 1 &&
+           !prefs_common.mainwin_fullscreen) {
                prefs_common.msgview_width = allocation->width;
                prefs_common.msgview_height = allocation->height;
        }
@@ -2844,7 +2910,7 @@ void main_window_get_position(MainWindow *mainwin)
 {
        gint x, y;
 
-       if (prefs_common.mainwin_maximised)
+       if (prefs_common.mainwin_maximised || prefs_common.mainwin_fullscreen)
                return;
 
        gtkut_widget_get_uposition(mainwin->window, &x, &y);
@@ -3038,6 +3104,14 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
        if (prefs_common.layout_mode != SMALL_LAYOUT || mainwin->in_folder)
                state |= M_IN_MSGLIST;
 
+       for (account_list = account_get_list(); account_list != NULL; account_list = account_list->next) {
+               PrefsAccount *account = account_list->data;
+               if (account->session_passwd || account->session_smtp_passwd) {
+                       state |= M_SESSION_PASSWORDS;
+                       break;
+               }
+       }
+
        return state;
 }
 
@@ -3132,6 +3206,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"Menu/Tools/ListUrls"                 , M_TARGET_EXIST},
                {"Menu/Tools/Actions"                      , M_TARGET_EXIST|M_ACTIONS_EXIST},
                {"Menu/Tools/Execute"                      , M_DELAY_EXEC},
+               {"Menu/Tools/ForgetSessionPasswords"       , M_SESSION_PASSWORDS},
                {"Menu/Tools/DeleteDuplicates/SelFolder"   , M_MSG_EXIST|M_ALLOW_DELETE},
 
                {"Menu/Configuration", M_UNLOCKED},
@@ -3168,7 +3243,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
 
        main_window_menu_callback_block(mainwin);
 
-       cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/ShowHide/MessageView",
+       cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/ShowHide/MessageView",
                              messageview_is_visible(mainwin->messageview));
 
        summaryview = mainwin->summaryview;
@@ -3207,12 +3282,12 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        default:
                menu_path = "Menu/View/Sort/DontSort"; break;
        }
-       cm_menu_set_sensitive_full(mainwin->ui_manager, menu_path, TRUE);
+       cm_toggle_menu_set_active_full(mainwin->ui_manager, menu_path, TRUE);
 
        if (summaryview->sort_type == SORT_ASCENDING) {
-               cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Sort/Ascending", TRUE);
+               cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Sort/Ascending", TRUE);
        } else {
-               cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Sort/Descending", TRUE);
+               cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Sort/Descending", TRUE);
        }
 
        if (summaryview->sort_key != SORT_BY_NONE) {
@@ -3226,7 +3301,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        if (mainwin->messageview 
        &&  mainwin->messageview->mimeview
        &&  mainwin->messageview->mimeview->textview)
-               cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/AllHeaders",
+               cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/AllHeaders",
                              mainwin->messageview->mimeview->textview->show_all_headers);
        cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/ThreadView", (state & M_THREADED) != 0);
        cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/FoldAll", (prefs_common.hide_quotes == 1));
@@ -3308,7 +3383,7 @@ static gint mailing_list_populate_submenu (GtkWidget *menuitem, const gchar * li
        GList *amenu, *alist;
        gint menu_nb = 0;
        
-       menu = GTK_WIDGET(GTK_MENU_ITEM(menuitem)->submenu);
+       menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(menuitem));
        
        /* First delete old submenu */
        /* FIXME: we can optimize this, and only change/add/delete necessary items */
@@ -3416,7 +3491,7 @@ static void mailing_list_compose (GtkWidget *w, gpointer *data)
 {
        const gchar *mailto;
 
-       mailto = gtk_label_get_text(GTK_LABEL (GTK_BIN (w)->child));
+       mailto = gtk_label_get_text(GTK_LABEL (gtk_bin_get_child(GTK_BIN((w)))));
        if (mailto)
                compose_new(NULL, mailto+7, NULL);
 }
@@ -3426,7 +3501,7 @@ static void mailing_list_compose (GtkWidget *w, gpointer *data)
  
        const gchar *mailto;
  
-       mailto = gtk_label_get_text(GTK_LABEL (GTK_BIN (w)->child));
+       mailto = gtk_label_get_text(GTK_LABEL (gtk_bin_get_child(GTK_BIN((w)))));
        if (mailto)
                open_uri (mailto, prefs_common_get_uri_cmd());
 } 
@@ -3474,7 +3549,7 @@ void main_window_show(MainWindow *mainwin)
        gtk_widget_show(mainwin->window);
        gtk_widget_show(mainwin->vbox_body);
 #ifndef GENERIC_UMPC
-        gtk_widget_set_uposition(mainwin->window,
+        gtk_window_move(GTK_WINDOW(mainwin->window),
                                  prefs_common.mainwin_x,
                                  prefs_common.mainwin_y);
 
@@ -3565,7 +3640,7 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
                } else {
                        gtk_paned_add2(GTK_PANED(hpaned),
                                       GTK_WIDGET_PTR(mainwin->summaryview));
-                       gtk_widget_ref(vpaned);
+                       g_object_ref(vpaned);
                }
                gtk_paned_add2(GTK_PANED(vpaned),
                               GTK_WIDGET_PTR(mainwin->messageview));
@@ -3593,7 +3668,7 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
                        gtk_paned_add2(GTK_PANED(vpaned),
                               GTK_WIDGET_PTR(mainwin->messageview));   
                } else {
-                       gtk_widget_ref(GTK_WIDGET_PTR(mainwin->messageview));
+                       g_object_ref(GTK_WIDGET_PTR(mainwin->messageview));
                }
                gtk_widget_show(vpaned);
                gtk_widget_queue_resize(vpaned);
@@ -3615,7 +3690,7 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
                        gtk_paned_add2(GTK_PANED(hpaned),
                               GTK_WIDGET_PTR(mainwin->messageview));   
                } else {
-                       gtk_widget_ref(GTK_WIDGET_PTR(mainwin->messageview));
+                       g_object_ref(GTK_WIDGET_PTR(mainwin->messageview));
                }
                gtk_paned_add2(GTK_PANED(vpaned), hpaned);
 
@@ -3762,14 +3837,15 @@ static gboolean ac_label_button_pressed(GtkWidget *widget, GdkEventButton *event
                                    gpointer data)
 {
        MainWindow *mainwin = (MainWindow *)data;
-
+       GtkWidget *menu = NULL;
+       
        if (!event) return FALSE;
 
        gtk_button_set_relief(GTK_BUTTON(widget), GTK_RELIEF_NORMAL);
-       g_object_set_data(G_OBJECT(mainwin->ac_menu), "menu_button",
-                         widget);
+       
+       menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(mainwin->ac_menu));
 
-       gtk_menu_popup(GTK_MENU(mainwin->ac_menu), NULL, NULL,
+       gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
                       menu_button_position, widget,
                       event->button, event->time);
 
@@ -3978,12 +4054,12 @@ static void toggle_col_headers_cb(GtkAction *gaction, gpointer data)
        SummaryView *summaryview = mainwin->summaryview;
 
        if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (gaction))) {
-               gtk_clist_column_titles_show(GTK_CLIST(folderview->ctree));
-               gtk_clist_column_titles_show(GTK_CLIST(summaryview->ctree));
+               gtk_cmclist_column_titles_show(GTK_CMCLIST(folderview->ctree));
+               gtk_cmclist_column_titles_show(GTK_CMCLIST(summaryview->ctree));
                prefs_common.show_col_headers = TRUE;
        } else {
-               gtk_clist_column_titles_hide(GTK_CLIST(folderview->ctree));
-               gtk_clist_column_titles_hide(GTK_CLIST(summaryview->ctree));
+               gtk_cmclist_column_titles_hide(GTK_CMCLIST(folderview->ctree));
+               gtk_cmclist_column_titles_hide(GTK_CMCLIST(summaryview->ctree));
                prefs_common.show_col_headers = FALSE;
        }
 }
@@ -4208,6 +4284,20 @@ static void show_all_header_cb(GtkAction *action, gpointer data)
                                     gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
 }
 
+static void toggle_fullscreen_cb(GtkAction *action, gpointer data)
+{
+       MainWindow *mainwin = (MainWindow *)data;
+       if (mainwin->menu_lock_count) return;
+       if (!gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
+               gtk_window_unfullscreen(GTK_WINDOW(mainwin->window));
+               prefs_common.mainwin_fullscreen = FALSE;
+       }
+       else {
+               prefs_common.mainwin_fullscreen = TRUE;
+               gtk_window_fullscreen(GTK_WINDOW(mainwin->window));
+       }
+}
+
 static void hide_quotes_cb(GtkAction *action, gpointer data)
 {
        MainWindow *mainwin = (MainWindow *)data;
@@ -4538,7 +4628,7 @@ static void update_summary_cb(GtkAction *action, gpointer data)
 
        folder_update_op_count();
 
-       fitem = gtk_ctree_node_get_row_data(GTK_CTREE(folderview->ctree),
+       fitem = gtk_cmctree_node_get_row_data(GTK_CMCTREE(folderview->ctree),
                                            folderview->opened);
        if (!fitem) return;
 
@@ -4846,8 +4936,8 @@ static gboolean mainwindow_focus_in_event(GtkWidget *widget, GdkEventFocus *focu
        summary = ((MainWindow *)data)->summaryview;
        g_return_val_if_fail(summary, FALSE);
 
-       if (GTK_CLIST(summary->ctree)->selection && 
-           g_list_length(GTK_CLIST(summary->ctree)->selection) > 1)
+       if (GTK_CMCLIST(summary->ctree)->selection && 
+           g_list_length(GTK_CMCLIST(summary->ctree)->selection) > 1)
                return FALSE;
 
        return FALSE;
@@ -4942,6 +5032,34 @@ static void sync_cb(GtkAction *action, gpointer data)
        mainwindow_check_synchronise(mainwin, FALSE);
 }
 
+static void forget_session_passwords_cb(GtkAction *action, gpointer data)
+{
+       MainWindow *mainwin = (MainWindow *)data;
+       GList *list = NULL;
+        gint fgtn = 0;
+       gint accs = 0;
+
+       main_window_lock(mainwin);
+       for (list = account_get_list(); list != NULL; list = list->next) {
+               PrefsAccount *account = list->data;
+               if (account->session_passwd) {
+                       g_free(account->session_passwd);
+                       account->session_passwd = NULL;
+                       ++fgtn;
+               }
+               if (account->session_smtp_passwd) {
+                       g_free(account->session_smtp_passwd);
+                       account->session_smtp_passwd = NULL;
+                       ++fgtn;
+               }
+               ++accs;
+       }
+       main_window_unlock(mainwin);
+       alertpanel_notice(ngettext("Forgotten %d password in %d accounts.\n",
+                                  "Forgotten %d passwords in %d accounts.\n",
+                                  fgtn), fgtn, accs);  
+}
+
 void mainwindow_learn (MainWindow *mainwin, gboolean is_spam)
 {
        summary_mark_as_spam(mainwin->summaryview, is_spam, NULL);