2006-02-16 [wwp] 2.0.0cvs58
authorTristan Chabredier <wwp@claws-mail.org>
Thu, 16 Feb 2006 16:01:51 +0000 (16:01 +0000)
committerTristan Chabredier <wwp@claws-mail.org>
Thu, 16 Feb 2006 16:01:51 +0000 (16:01 +0000)
* src/gtk/gtkaspell.c
* src/gtk/gtkaspell.h
* src/prefs_spelling.c
* src/compose.c
* src/prefs_common.c
* src/prefs_common.h
implemented new optional spellchecker behaviour: re-check message when
dictionary got changed (from compose-window/context-menu/Change dictionary).

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/gtk/gtkaspell.c
src/gtk/gtkaspell.h
src/prefs_common.c
src/prefs_common.h
src/prefs_spelling.c

index 5b8d4a58323259ab946ed95613f9169b8a3c835c..280941afdee102646d4ad31ce62973f56d32441c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-02-16 [wwp]       2.0.0cvs58
+
+       * src/gtk/gtkaspell.c
+       * src/gtk/gtkaspell.h
+       * src/prefs_spelling.c
+       * src/compose.c
+       * src/prefs_common.c
+       * src/prefs_common.h
+               implemented new optional spellchecker behaviour: re-check message when
+               dictionary got changed (from compose-window/context-menu/Change dictionary).
+
 2006-02-16 [wwp]       2.0.0cvs57
 
        * src/quote_fmt_parse.y
index bf2171f339bef48cd20ddeb933f6fe531f7f9431..4365ac87b224641c91d14848043aa8e354a113ab 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.240 -r 1.382.2.241 src/compose.c;  cvs diff -u -r 1.50.2.20 -r 1.50.2.21 src/compose.h;  cvs diff -u -r 1.3.12.13 -r 1.3.12.14 src/message_search.c;  cvs diff -u -r 1.1.16.2 -r 1.1.16.3 src/message_search.h;  cvs diff -u -r 1.96.2.96 -r 1.96.2.97 src/textview.c;  cvs diff -u -r 1.5.2.20 -r 1.5.2.21 src/gtk/gtkutils.c;  cvs diff -u -r 1.4.2.17 -r 1.4.2.18 src/gtk/gtkutils.h;  ) > 2.0.0cvs55.patchset
 ( cvs diff -u -r 1.83.2.64 -r 1.83.2.65 src/mimeview.c;  cvs diff -u -r 1.20.2.7 -r 1.20.2.8 src/mimeview.h;  cvs diff -u -r 1.395.2.169 -r 1.395.2.170 src/summaryview.c;  cvs diff -u -r 1.1.4.27 -r 1.1.4.28 src/etpan/imap-thread.c;  ) > 2.0.0cvs56.patchset
 ( cvs diff -u -r 1.22.2.18 -r 1.22.2.19 src/quote_fmt_parse.y;  ) > 2.0.0cvs57.patchset
+( cvs diff -u -r 1.9.2.36 -r 1.9.2.37 src/gtk/gtkaspell.c;  cvs diff -u -r 1.5.2.4 -r 1.5.2.5 src/gtk/gtkaspell.h;  cvs diff -u -r 1.5.2.18 -r 1.5.2.19 src/prefs_spelling.c;  cvs diff -u -r 1.382.2.241 -r 1.382.2.242 src/compose.c;  cvs diff -u -r 1.204.2.75 -r 1.204.2.76 src/prefs_common.c;  cvs diff -u -r 1.103.2.40 -r 1.103.2.41 src/prefs_common.h;  ) > 2.0.0cvs58.patchset
index a39a3d81fe3d34c1eb064a4e06f4f8077036e5dc..a50778a3599058cdcc0ad167fc6390c922003039 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=57
+EXTRA_VERSION=58
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 1e9a886c8aed357a4f4e56dd0aef7c3f75ef5db0..e0cb0bfc37c1ee726fe094c078540746dae095d3 100644 (file)
@@ -5697,6 +5697,7 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
                                                  conv_get_locale_charset_str(),
                                                  prefs_common.misspelled_col,
                                                  prefs_common.check_while_typing,
+                                                 prefs_common.recheck_when_changing_dict,
                                                  prefs_common.use_alternate,
                                                  GTK_TEXT_VIEW(text),
                                                  GTK_WINDOW(compose->window));
index 8519ffa67d1734d4d7aa9279f969ce7b24b973cb..5af96208aefd33a225a9609103f0e044715e97c1 100644 (file)
@@ -121,6 +121,7 @@ struct _GtkAspell
        gint             end_check_pos;
        gboolean         misspelled;
        gboolean         check_while_typing;
+       gboolean         recheck_when_changing_dict;
        gboolean         use_alternate;
 
        ContCheckFunc    continue_check; 
@@ -373,6 +374,7 @@ GtkAspell *gtkaspell_new(const gchar *dictionary_path,
                         const gchar *encoding,
                         gint  misspelled_color,
                         gboolean check_while_typing,
+                        gboolean recheck_when_changing_dict,
                         gboolean use_alternate,
                         GtkTextView *gtktext,
                         GtkWindow *parent_win)
@@ -408,6 +410,7 @@ GtkAspell *gtkaspell_new(const gchar *dictionary_path,
        gtkaspell->end_check_pos      = -1;
        gtkaspell->misspelled         = -1;
        gtkaspell->check_while_typing = check_while_typing;
+       gtkaspell->recheck_when_changing_dict = recheck_when_changing_dict;
        gtkaspell->continue_check     = NULL;
        gtkaspell->replace_entry      = NULL;
        gtkaspell->gtktext            = gtktext;
@@ -2277,6 +2280,9 @@ static void change_dict_cb(GtkWidget *w, GtkAspell *gtkaspell)
                return;
 
        gtkaspell_change_dict(gtkaspell, fullname);
+       if (gtkaspell->recheck_when_changing_dict) {
+               gtkaspell_highlight_all(gtkaspell);
+       }
 }
 
 static void switch_to_alternate_cb(GtkWidget *w,
index ecee9f1eb1ff512414e09b60c3654402846717bf..59add9bbc4ff228762ff16d1face1a01946666a5 100644 (file)
@@ -54,7 +54,8 @@ GtkAspell*    gtkaspell_new                   (const gchar *dictionary_path,
                                                 const gchar *dictionary, 
                                                 const gchar *encoding,
                                                 gint  misspelled_color,
-                                                gboolean check_while_typing,  
+                                                gboolean check_while_typing,
+                                                gboolean recheck_when_changing_dict,
                                                 gboolean use_alternate,  
                                                 GtkTextView *gtktext,
                                                 GtkWindow *parent_win);
index b2c8a9ab9ea46d4b2a9af1921d517697d7228bd2..ca19532fceae831495bca48cbea6ab74bba8cde5 100644 (file)
@@ -220,6 +220,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"check_while_typing", "TRUE", &prefs_common.check_while_typing, P_BOOL,
         NULL, NULL, NULL},
+       {"recheck_when_changing_dict", "TRUE", &prefs_common.recheck_when_changing_dict,
+        P_BOOL, NULL, NULL, NULL},
        {"misspelled_color", "16711680", &prefs_common.misspelled_col, P_COLOR,
         NULL, NULL, NULL},
 #endif
index 2f1012c66444aea8e043887747058beaed1d7982..b8b422af446bcd3913734fbc21007ec8dc73dba8 100644 (file)
@@ -126,6 +126,7 @@ struct _PrefsCommon
        gulong misspelled_col;
        gint aspell_sugmode;
        gboolean check_while_typing;
+       gboolean recheck_when_changing_dict;
        gboolean use_alternate;
 #endif
         
index bc74d961ade5f48a0ac9623856aebaecd51370b6..1613f9a8824f93614b58a2284100a5fc8fa1a96e 100644 (file)
@@ -59,6 +59,7 @@ typedef struct _SpellingPage
        GtkWidget *misspelled_btn;
        GtkWidget *checkbtn_use_alternate;
        GtkWidget *checkbtn_check_while_typing;
+       GtkWidget *checkbtn_recheck_when_changing_dict;
 
        gint       misspell_col;
 } SpellingPage;
@@ -72,6 +73,7 @@ static void prefs_spelling_enable(SpellingPage *spelling, gboolean enable)
        gtk_widget_set_sensitive(spelling->misspelled_btn,              enable);
        gtk_widget_set_sensitive(spelling->checkbtn_use_alternate,      enable);
        gtk_widget_set_sensitive(spelling->checkbtn_check_while_typing, enable);
+       gtk_widget_set_sensitive(spelling->checkbtn_recheck_when_changing_dict, enable);
 }
 
 static void prefs_spelling_checkbtn_enable_aspell_toggle_cb
@@ -134,10 +136,10 @@ void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gpointer
 {
        SpellingPage *prefs_spelling = (SpellingPage *) _page;
 
-       /* START GLADE CODE */
        GtkWidget *table;
        GtkWidget *checkbtn_enable_aspell;
        GtkWidget *checkbtn_check_while_typing;
+       GtkWidget *checkbtn_recheck_when_changing_dict;
        GtkWidget *checkbtn_use_alternate;
        GtkWidget *label2;
        GtkWidget *entry_aspell_path;
@@ -155,7 +157,7 @@ void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gpointer
 
        tooltips = gtk_tooltips_new ();
 
-       table = gtk_table_new(8, 3, FALSE);
+       table = gtk_table_new(9, 3, FALSE);
        gtk_widget_show(table);
        gtk_container_set_border_width(GTK_CONTAINER(table), VBOX_BORDER);
        gtk_table_set_row_spacings(GTK_TABLE(table), 4);
@@ -175,19 +177,26 @@ void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gpointer
                         3, 1, 2, (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
 
+       checkbtn_recheck_when_changing_dict = gtk_check_button_new_with_label(
+                       _("Re-check message when changing dictionary"));
+       gtk_widget_show(checkbtn_recheck_when_changing_dict);
+       gtk_table_attach(GTK_TABLE(table), checkbtn_recheck_when_changing_dict, 0,
+                        3, 2, 3, (GtkAttachOptions) (GTK_FILL),
+                        (GtkAttachOptions) (0), 0, 0);
+
        checkbtn_use_alternate =
            gtk_check_button_new_with_label(_
                                            ("Enable alternate dictionary"));
        gtk_widget_show(checkbtn_use_alternate);
-       gtk_table_attach(GTK_TABLE(table), checkbtn_use_alternate, 0, 3, 2,
-                        3, (GtkAttachOptions) (GTK_FILL),
+       gtk_table_attach(GTK_TABLE(table), checkbtn_use_alternate, 0, 3, 3,
+                        4, (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
        gtk_tooltips_set_tip (tooltips, checkbtn_use_alternate, 
                        _("Faster switching with last used dictionary"), NULL);
 
        label2 = gtk_label_new(_("Dictionaries path:"));
        gtk_widget_show(label2);
-       gtk_table_attach(GTK_TABLE(table), label2, 0, 1, 4, 5,
+       gtk_table_attach(GTK_TABLE(table), label2, 0, 1, 5, 6,
                         (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
        gtk_label_set_justify(GTK_LABEL(label2), GTK_JUSTIFY_RIGHT);
@@ -195,13 +204,19 @@ void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gpointer
 
        entry_aspell_path = gtk_entry_new();
        gtk_widget_show(entry_aspell_path);
-       gtk_table_attach(GTK_TABLE(table), entry_aspell_path, 1, 2, 4, 5,
+       gtk_table_attach(GTK_TABLE(table), entry_aspell_path, 1, 2, 5, 6,
                         (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
 
+       btn_aspell_path = gtkut_get_browse_directory_btn(_("_Browse"));
+       gtk_widget_show(btn_aspell_path);
+       gtk_table_attach(GTK_TABLE(table), btn_aspell_path, 2, 3, 5, 6,
+                        (GtkAttachOptions) (GTK_FILL),
+                        (GtkAttachOptions) (0), 0, 0);
+
        label3 = gtk_label_new(_("Default dictionary:"));
        gtk_widget_show(label3);
-       gtk_table_attach(GTK_TABLE(table), label3, 0, 1, 5, 6,
+       gtk_table_attach(GTK_TABLE(table), label3, 0, 1, 6, 7,
                         (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
        gtk_label_set_justify(GTK_LABEL(label3), GTK_JUSTIFY_RIGHT);
@@ -209,7 +224,7 @@ void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gpointer
 
        optmenu_dictionary = gtk_option_menu_new();
        gtk_widget_show(optmenu_dictionary);
-       gtk_table_attach(GTK_TABLE(table), optmenu_dictionary, 1, 3, 5, 6,
+       gtk_table_attach(GTK_TABLE(table), optmenu_dictionary, 1, 3, 6, 7,
                         (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
        optmenu_dictionary_menu = gtk_menu_new();
@@ -218,7 +233,7 @@ void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gpointer
 
        label4 = gtk_label_new(_("Default suggestion mode:"));
        gtk_widget_show(label4);
-       gtk_table_attach(GTK_TABLE(table), label4, 0, 1, 6, 7,
+       gtk_table_attach(GTK_TABLE(table), label4, 0, 1, 7, 8,
                         (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
        gtk_label_set_justify(GTK_LABEL(label4), GTK_JUSTIFY_RIGHT);
@@ -226,7 +241,7 @@ void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gpointer
 
        optmenu_sugmode = gtk_option_menu_new();
        gtk_widget_show(optmenu_sugmode);
-       gtk_table_attach(GTK_TABLE(table), optmenu_sugmode, 1, 3, 6, 7,
+       gtk_table_attach(GTK_TABLE(table), optmenu_sugmode, 1, 3, 7, 8,
                         (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
        optmenu_sugmode_menu = gtk_menu_new();
@@ -235,40 +250,33 @@ void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gpointer
 
        label5 = gtk_label_new(_("Misspelled word color:"));
        gtk_widget_show(label5);
-       gtk_table_attach(GTK_TABLE(table), label5, 0, 1, 7, 8,
+       gtk_table_attach(GTK_TABLE(table), label5, 0, 1, 8, 9,
                         (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (0), 0, 0);
        gtk_label_set_justify(GTK_LABEL(label5), GTK_JUSTIFY_RIGHT);
        gtk_misc_set_alignment(GTK_MISC(label5), 1, 0.5);
 
-       btn_aspell_path = gtkut_get_browse_directory_btn(_("_Browse"));
-       gtk_widget_show(btn_aspell_path);
-       gtk_table_attach(GTK_TABLE(table), btn_aspell_path, 2, 3, 4, 5,
-                        (GtkAttachOptions) (GTK_FILL),
-                        (GtkAttachOptions) (0), 0, 0);
-
        hbox1 = gtk_hbox_new(FALSE, 0);
        gtk_widget_show(hbox1);
-       gtk_table_attach(GTK_TABLE(table), hbox1, 1, 2, 7, 8,
+       gtk_table_attach(GTK_TABLE(table), hbox1, 1, 2, 8, 9,
                         (GtkAttachOptions) (GTK_FILL),
                         (GtkAttachOptions) (GTK_FILL), 0, 0);
 
        misspelled_btn = gtk_button_new_with_label("");
        gtk_widget_show(misspelled_btn);
-       gtk_box_pack_start(GTK_BOX(hbox1), misspelled_btn, FALSE, FALSE,
-                          0);
+       gtk_box_pack_start(GTK_BOX(hbox1), misspelled_btn, FALSE, FALSE, 0);
        gtk_widget_set_size_request(misspelled_btn, 30, 20);
        label5 = gtk_label_new(_("Use black to underline"));
        gtkut_widget_set_small_font_size (label5);
        gtk_widget_show(label5);
-       gtk_box_pack_start(GTK_BOX(hbox1), label5, FALSE, FALSE,
-                          4);
-       /* END GLADE CODE */
+       gtk_box_pack_start(GTK_BOX(hbox1), label5, FALSE, FALSE, 4);
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_aspell),
                                     prefs_common.enable_aspell);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_check_while_typing),
                                     prefs_common.check_while_typing);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_recheck_when_changing_dict),
+                                    prefs_common.recheck_when_changing_dict);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_use_alternate),
                                     prefs_common.use_alternate);
        gtk_entry_set_text(GTK_ENTRY(entry_aspell_path), 
@@ -311,6 +319,8 @@ void prefs_spelling_create_widget(PrefsPage *_page, GtkWindow *window, gpointer
                = checkbtn_use_alternate;
        prefs_spelling->checkbtn_check_while_typing
                = checkbtn_check_while_typing;
+       prefs_spelling->checkbtn_recheck_when_changing_dict
+               = checkbtn_recheck_when_changing_dict;
        prefs_spelling->misspelled_btn
                = misspelled_btn;
 
@@ -327,6 +337,8 @@ void prefs_spelling_save(PrefsPage *_page)
                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(spelling->checkbtn_enable_aspell));
        prefs_common.check_while_typing =
                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(spelling->checkbtn_check_while_typing));
+       prefs_common.recheck_when_changing_dict =
+               gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(spelling->checkbtn_recheck_when_changing_dict));
        prefs_common.use_alternate =
                gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(spelling->checkbtn_use_alternate));