more fixes for Go To actions not obeying 'always_show_msg' option
[claws.git] / src / mainwindow.c
index 2dc592f13bd3419934e7d3b5925c94ff15a9e785..e8e759e6dee504a7f2f01dc128346535ccb84c45 100644 (file)
@@ -1,6 +1,6 @@
 /*
    Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
-   Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
+   Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
 
    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
@@ -771,7 +771,7 @@ static GtkActionEntry mainwin_entries[] =
        {"Tools/Expunge",                       NULL, N_("Exp_unge"), "<control>E", NULL, G_CALLBACK(expunge_summary_cb) }, 
 #ifdef USE_GNUTLS
        /* {"Tools/---",                        NULL, "---", NULL, NULL, NULL }, */
-       {"Tools/SSLCertificates",               NULL, N_("SSL cer_tificates"), NULL, NULL, G_CALLBACK(ssl_manager_open_cb) }, 
+       {"Tools/SSLCertificates",               NULL, N_("SSL/TLS cer_tificates"), NULL, NULL, G_CALLBACK(ssl_manager_open_cb) }, 
 #endif
        /* {"Tools/---",                        NULL, "---", NULL, NULL, NULL }, */
 #ifndef G_OS_WIN32
@@ -1407,7 +1407,7 @@ static gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
                                    && mainwin->summaryview->folder_item->total_msgs == 0))) {
                                g_signal_stop_emission_by_name(G_OBJECT(widget), 
                                               "key_press_event");
-                               folderview_select_next_with_flag(mainwin->folderview, MSG_UNREAD, TRUE);
+                               folderview_select_next_with_flag(mainwin->folderview, MSG_UNREAD);
                        }
                }
                break;
@@ -3015,6 +3015,10 @@ SensitiveCondMask main_window_get_current_state(MainWindow *mainwin)
             !folder_has_parent_of_type(mainwin->summaryview->folder_item, F_TRASH)))
                UPDATE_STATE(M_NOT_TRASH);
 
+       if (mainwin->summaryview->folder_item
+           && mainwin->summaryview->folder_item->stype != F_DRAFT)
+               UPDATE_STATE(M_NOT_DRAFT);
+
        if (prefs_common.actions_list && g_slist_length(prefs_common.actions_list))
                UPDATE_STATE(M_ACTIONS_EXIST);
 
@@ -3175,9 +3179,9 @@ do { \
        FILL_TABLE("Menu/View/ThreadView", M_EXEC, M_SUMMARY_ISLIST);
        FILL_TABLE("Menu/View/ExpandThreads", M_MSG_EXIST, M_SUMMARY_ISLIST);
        FILL_TABLE("Menu/View/CollapseThreads", M_MSG_EXIST, M_SUMMARY_ISLIST);
-       FILL_TABLE("Menu/View/HideReadThreads", M_HIDE_READ_THREADS, M_SUMMARY_ISLIST);
-       FILL_TABLE("Menu/View/HideReadMessages", M_HIDE_READ_MSG, M_SUMMARY_ISLIST);
-       FILL_TABLE("Menu/View/HideDelMessages", M_SUMMARY_ISLIST);
+       FILL_TABLE("Menu/View/HideReadThreads", M_HIDE_READ_THREADS, M_SUMMARY_ISLIST, M_NOT_DRAFT);
+       FILL_TABLE("Menu/View/HideReadMessages", M_HIDE_READ_MSG, M_SUMMARY_ISLIST, M_NOT_DRAFT);
+       FILL_TABLE("Menu/View/HideDelMessages", M_SUMMARY_ISLIST, M_NOT_DRAFT);
        FILL_TABLE("Menu/View/Goto/Prev", M_MSG_EXIST);
        FILL_TABLE("Menu/View/Goto/Next", M_MSG_EXIST);
        FILL_TABLE("Menu/View/Goto/PrevUnread", M_MSG_EXIST);
@@ -3345,7 +3349,7 @@ do { \
        cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/ThreadView", (state & main_window_get_mask(M_THREADED, -1)) != 0);
        cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/ExpandThreads", (state & main_window_get_mask(M_THREADED, -1)) != 0);
        cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/CollapseThreads", (state & main_window_get_mask(M_THREADED, -1)) != 0);
-       cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/HideReadThreads", (state & main_window_get_mask(M_THREADED, -1)) != 0);
+       cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/HideReadThreads", (state & main_window_get_mask(M_THREADED, -1)) != 0 && (state & main_window_get_mask(M_NOT_DRAFT, -1)) != 0);
        cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/CollapseAll", (prefs_common.hide_quotes == 1));
        cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/Collapse2", (prefs_common.hide_quotes == 2));
        cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Quotes/Collapse3", (prefs_common.hide_quotes == 3));
@@ -3667,7 +3671,7 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
        GtkWidget *vpaned;
        GtkWidget *vbox_body = mainwin->vbox_body;
        gboolean first_set = (mainwin->hpaned == NULL);
-       debug_print("Setting widgets... ");
+       debug_print("Setting widgets...\n");
 
 #ifndef GENERIC_UMPC
        mainwin->messageview->statusbar = mainwin->statusbar;
@@ -3872,7 +3876,7 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
                         mainwin);
        }
 
-       debug_print("done.\n");
+       debug_print("Setting widgets done.\n");
 }
 
 void main_window_destroy_all(void)
@@ -4781,13 +4785,13 @@ static void update_summary_cb(GtkAction *action, gpointer data)
 static void prev_cb(GtkAction *action, gpointer data)
 {
        MainWindow *mainwin = (MainWindow *)data;
-       summary_step(mainwin->summaryview, GTK_SCROLL_STEP_BACKWARD);
+       summary_select_prev(mainwin->summaryview);
 }
 
 static void next_cb(GtkAction *action, gpointer data)
 {
        MainWindow *mainwin = (MainWindow *)data;
-       summary_step(mainwin->summaryview, GTK_SCROLL_STEP_FORWARD);
+       summary_select_next(mainwin->summaryview);
 }
 
 static void prev_unread_cb(GtkAction *action, gpointer data)
@@ -4887,7 +4891,7 @@ static void goto_folder_cb(GtkAction *action, gpointer data)
 static void goto_unread_folder_cb(GtkAction *action, gpointer data)
 {
        MainWindow *mainwin = (MainWindow *)data;
-       folderview_select_next_with_flag(mainwin->folderview, MSG_UNREAD, FALSE);
+       folderview_select_next_with_flag(mainwin->folderview, MSG_UNREAD);
 }
 
 static void scroll_prev_line_cb(GtkAction *action, gpointer data)