sync with sylpheed 0.7.2cvs17
[claws.git] / src / mainwindow.c
index 095efdb7e139bdc643d7d2543b2178d241ebd65a..2ef1a42dd6d9341a4b056f3e79b8b6b97b0562ec 100644 (file)
@@ -81,6 +81,7 @@
 #include "about.h"
 #include "manual.h"
 #include "version.h"
+#include "selective_download.h"
 
 #define AC_LABEL_WIDTH 240
 
@@ -251,6 +252,9 @@ static void addressbook_open_cb     (MainWindow     *mainwin,
 static void log_window_show_cb (MainWindow     *mainwin,
                                 guint           action,
                                 GtkWidget      *widget);
+static void sel_download_cb     (MainWindow *mainwin, 
+                                guint action,
+                                GtkWidget *widget);
 
 static void inc_mail_cb                        (MainWindow     *mainwin,
                                         guint           action,
@@ -669,6 +673,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Tool/E_xecute"),                 "X", execute_summary_cb, 0, NULL},
        {N_("/_Tool/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_Tool/_Log window"),              "<control>L", log_window_show_cb, 0, NULL},
+       {N_("/_Tool/_Selective Download"),      "<alt>S", sel_download_cb, 0, NULL},
 
        {N_("/_Configuration"),                 NULL, NULL, 0, "<Branch>"},
        {N_("/_Configuration/_Common preferences..."),
@@ -759,12 +764,10 @@ MainWindow *main_window_create(SeparateType type)
        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_title(GTK_WINDOW(window), PROG_VERSION);
        gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, FALSE);
+       gtk_window_set_wmclass(GTK_WINDOW(window), "main_window", "Sylpheed");
        gtk_signal_connect(GTK_OBJECT(window), "delete_event",
                           GTK_SIGNAL_FUNC(main_window_close_cb), mainwin);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
        gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
                                GTK_SIGNAL_FUNC(key_pressed), mainwin);
 
@@ -1076,6 +1079,11 @@ static void main_window_menu_callback_unblock(MainWindow *mainwin)
 }
 
 void main_window_reflect_prefs_all(void)
+{
+       main_window_reflect_prefs_all_real(FALSE);
+}
+
+void main_window_reflect_prefs_all_real(gboolean pixmap_theme_changed)
 {
        GList *cur;
        MainWindow *mainwin;
@@ -1088,14 +1096,17 @@ void main_window_reflect_prefs_all(void)
                main_window_set_toolbar_sensitive(mainwin);
 
                /* pixmap themes */
-               gtk_container_remove(GTK_CONTAINER(mainwin->handlebox), GTK_WIDGET(mainwin->toolbar));
-               mainwin->toolbar = NULL;
-               main_window_toolbar_create(mainwin, mainwin->handlebox);
-               set_toolbar_style(mainwin);
-               activate_compose_button(mainwin, prefs_common.toolbar_style, mainwin->compose_btn_type);
-               folderview_reflect_prefs_pixmap_theme(mainwin->folderview);
-               summary_reflect_prefs_pixmap_theme(mainwin->summaryview);
-
+               if (pixmap_theme_changed)
+               {
+                       gtk_container_remove(GTK_CONTAINER(mainwin->handlebox), GTK_WIDGET(mainwin->toolbar));
+                       mainwin->toolbar = NULL;
+                       main_window_toolbar_create(mainwin, mainwin->handlebox);
+                       set_toolbar_style(mainwin);
+                       activate_compose_button(mainwin, prefs_common.toolbar_style, mainwin->compose_btn_type);
+                       folderview_reflect_prefs_pixmap_theme(mainwin->folderview);
+                       summary_reflect_prefs_pixmap_theme(mainwin->summaryview);
+               }
+               
                summary_redisplay_msg(mainwin->summaryview);
                headerview_set_visibility(mainwin->messageview->headerview,
                                          prefs_common.display_header_pane);
@@ -1573,7 +1584,9 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
 
        main_window_menu_callback_block(mainwin);
        menuitem = gtk_item_factory_get_widget(ifactory, "/View/Show all header");
-       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), FALSE);
+       gtk_check_menu_item_set_active
+               (GTK_CHECK_MENU_ITEM(menuitem),
+                mainwin->messageview->textview->show_all_headers);
        menuitem = gtk_item_factory_get_widget(ifactory, "/View/Thread view");
        gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
                                       (state & M_THREADED) != 0);
@@ -2326,7 +2339,7 @@ static void update_folderview_cb(MainWindow *mainwin, guint action,
                                 GtkWidget *widget)
 {
        summary_show(mainwin->summaryview, NULL, FALSE);
-       folderview_update_all();
+       folderview_rescan_all();
 }
 
 static void new_folder_cb(MainWindow *mainwin, guint action,
@@ -2505,6 +2518,12 @@ static void log_window_show_cb(MainWindow *mainwin, guint action,
        log_window_show(mainwin->logwin);
 }
 
+static void sel_download_cb(MainWindow *mainwin, guint action,
+                              GtkWidget *widget)
+{
+       selective_download(mainwin);
+}
+
 static void inc_mail_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
 {
        inc_mail(mainwin);