add global setting stuff for spelling checker; 'nother 20% done
[claws.git] / src / mainwindow.c
index 1d48030db1b04d10854a4ca93c1ed0bc4171c92a..8032f6b2528961b4baa586d23f7b532e6e4c3ee5 100644 (file)
@@ -75,6 +75,7 @@
 #include "about.h"
 #include "manual.h"
 
+
 #define AC_LABEL_WIDTH 240
 
 #define STATUSBAR_PUSH(mainwin, str) \
@@ -569,7 +570,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
 
        {N_("/_Help"),                          NULL, NULL, 0, "<LastBranch>"},
        {N_("/_Help/_Manual"),                  NULL, NULL, 0, "<Branch>"},
-       {N_("/_Help/_Manual/_English"),         NULL, NULL, MANUAL_LANG_EN, NULL},
+       {N_("/_Help/_Manual/_English"),         NULL, manual_open_cb, MANUAL_LANG_EN, NULL},
        {N_("/_Help/_Manual/_Japanese"),        NULL, manual_open_cb, MANUAL_LANG_JA, NULL},
        {N_("/_Help/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_Help/_About"),                   NULL, about_show, 0, NULL}
@@ -592,8 +593,8 @@ MainWindow *main_window_create(SeparateType type)
        SummaryView *summaryview;
        MessageView *messageview;
        GdkColormap *colormap;
-       GdkColor color[3];
-       gboolean success[3];
+       GdkColor color[4];
+       gboolean success[4];
        guint n_menu_entries;
        GtkItemFactory *ifactory;
        GtkWidget *ac_menu;
@@ -703,6 +704,9 @@ MainWindow *main_window_create(SeparateType type)
        folderview->color_new.red = (guint16)55000;
        folderview->color_new.green = folderview->color_new.blue = 15000;
 
+       gtkut_convert_int_to_gdk_color(prefs_common.tgt_folder_col,
+                                      &folderview->color_op);
+
        summaryview->color_important.red = 0;
        summaryview->color_marked.green = 0;
        summaryview->color_important.blue = (guint16)65535;
@@ -710,10 +714,11 @@ MainWindow *main_window_create(SeparateType type)
        color[0] = summaryview->color_marked;
        color[1] = summaryview->color_dim;
        color[2] = folderview->color_new;
+       color[3] = folderview->color_op;
 
        colormap = gdk_window_get_colormap(window->window);
-       gdk_colormap_alloc_colors(colormap, color, 3, FALSE, TRUE, success);
-       for (i = 0; i < 3; i++) {
+       gdk_colormap_alloc_colors(colormap, color, 4, FALSE, TRUE, success);
+       for (i = 0; i < 4; i++) {
                if (success[i] == FALSE)
                        g_warning(_("MainWindow: color allocation %d failed\n"), i);
        }
@@ -776,7 +781,6 @@ MainWindow *main_window_create(SeparateType type)
        */
        main_window_set_thread_option(mainwin);
 
-       menu_set_sensitive(ifactory, "/Help/Manual/English", FALSE);
 
        /* set account selection menu */
        ac_menu = gtk_item_factory_get_widget
@@ -800,17 +804,6 @@ MainWindow *main_window_create(SeparateType type)
        header_window_init(mainwin->headerwin);
        log_window_init(mainwin->logwin);
 
-       {
-               GtkStyle *newstyle;
-
-               gtk_widget_ensure_style(folderview->ctree);
-               newstyle = gtk_widget_get_style(folderview->ctree);
-               newstyle = gtk_style_copy(newstyle);
-               gtk_widget_set_style(summaryview->ctree, newstyle);
-               gtk_widget_ensure_style(summaryview->ctree);
-               gtk_widget_realize(summaryview->ctree);
-       }
-
        mainwin->cursor_count = 0;
 
        if (!watch_cursor)
@@ -1226,6 +1219,7 @@ void main_window_popup(MainWindow *mainwin)
        y %= sy; if (y < 0) y += sy;
        gdk_window_move(mainwin->window->window, x, y);
        gdk_window_raise(mainwin->window->window);
+       gdk_window_show(mainwin->window->window);
 
        debug_print("window position: x = %d, y = %d\n", x, y);
 
@@ -1568,7 +1562,7 @@ static void main_window_toolbar_create(MainWindow *mainwin,
        
        CREATE_TOOLBAR_ICON(stock_mail_compose_xpm);
        compose_mail_btn_plain = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
-                                             _("Compose email"),
+                                             _("Email"),
                                              _("Compose an email message"),
                                              "New",
                                              icon_wid,
@@ -1579,7 +1573,7 @@ static void main_window_toolbar_create(MainWindow *mainwin,
 
        CREATE_TOOLBAR_ICON(stock_news_compose_xpm);
        compose_news_btn_plain = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
-                                             _("Compose news"),
+                                             _("News"),
                                              _("Compose a news message"),
                                              "New",
                                              icon_wid,
@@ -2158,7 +2152,7 @@ static void compose_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
                    && mainwin->summaryview->folder_item->folder->account->protocol == A_NNTP)
                        compose_new_with_recipient(mainwin->summaryview->folder_item->folder->account, mainwin->summaryview->folder_item->path);
                else
-                       compose_new(mainwin->summaryview->folder_item->folder->account);
+                       compose_new_with_folderitem(mainwin->summaryview->folder_item->folder->account, mainwin->summaryview->folder_item);
        }
        else
                compose_new(NULL);
@@ -2174,16 +2168,21 @@ static void compose_mail_cb(MainWindow *mainwin, guint action,
        if (mainwin->summaryview->folder_item) {
                ac = mainwin->summaryview->folder_item->folder->account;
                if (ac && ac->protocol != A_NNTP) {
-                       compose_new(ac);
+                       compose_new_with_folderitem(ac, mainwin->summaryview->folder_item);
                        return;
                }
        }
 
+       if(cur_account && (cur_account->protocol != A_NNTP)) {
+               compose_new_with_folderitem(cur_account, mainwin->summaryview->folder_item);
+               return;
+       }
+
        list = account_get_list();
        for(cur = list ; cur != NULL ; cur = g_list_next(cur)) {
                ac = (PrefsAccount *) cur->data;
                if (ac->protocol != A_NNTP) {
-                       compose_new(ac);
+                       compose_new_with_folderitem(ac, mainwin->summaryview->folder_item);
                        return;
                }
        }
@@ -2437,6 +2436,8 @@ static void update_summary_cb(MainWindow *mainwin, guint action,
        if (!mainwin->summaryview->folder_item) return;
        if (!folderview->opened) return;
 
+       folder_update_op_count();
+
        fitem = gtk_ctree_node_get_row_data(GTK_CTREE(folderview->ctree),
                                            folderview->opened);
        if (!fitem) return;