[balsa/wip/gmime3: 43/197] Save/restore spell-check language in all builds
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/wip/gmime3: 43/197] Save/restore spell-check language in all builds
- Date: Wed, 23 May 2018 21:15:59 +0000 (UTC)
commit 5a07ed0ff0f7adfcd5b0b0743f7173abd44afa64
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Thu Aug 3 22:14:43 2017 -0400
Save/restore spell-check language in all builds
* src/balsa-app.h: include the spell_check_lang member in all
builds.
* src/save-restore.c (config_global_load), (config_save): save
and restore it in all builds.
* src/sendmsg-window.c (create_lang_menu), (lang_set_cb): use it
in all builds.
ChangeLog | 12 ++++++++++++
src/balsa-app.h | 2 +-
src/save-restore.c | 4 ++--
src/sendmsg-window.c | 6 +-----
4 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 52bb733..520db3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2017-08-03 Peter Bloomfield <pbloomfield bellsouth net>
+
+ Save and restore the spell checking language when built with the
+ internal checker
+
+ * src/balsa-app.h: include the spell_check_lang member in all
+ builds.
+ * src/save-restore.c (config_global_load), (config_save): save
+ and restore it in all builds.
+ * src/sendmsg-window.c (create_lang_menu), (lang_set_cb): use it
+ in all builds.
+
2017-07-17 Peter Bloomfield <pbloomfield bellsouth net>
* libbalsa/libbalsa-gpgme.c (get_key_from_name): do not
diff --git a/src/balsa-app.h b/src/balsa-app.h
index d1b09a2..d63e26c 100644
--- a/src/balsa-app.h
+++ b/src/balsa-app.h
@@ -340,8 +340,8 @@ extern struct BalsaApplication {
LibBalsaAddressBook *default_address_book;
/* spell checking */
-#if HAVE_GSPELL || HAVE_GTKSPELL
gchar *spell_check_lang;
+#if HAVE_GSPELL || HAVE_GTKSPELL
gboolean spell_check_active;
#else /* HAVE_GSPELL */
gboolean check_sig;
diff --git a/src/save-restore.c b/src/save-restore.c
index bd6fce5..00a923c 100644
--- a/src/save-restore.c
+++ b/src/save-restore.c
@@ -869,9 +869,9 @@ config_global_load(void)
/* Spelling options ... */
libbalsa_conf_push_group("Spelling");
-#if HAVE_GSPELL || HAVE_GTKSPELL
balsa_app.spell_check_lang =
libbalsa_conf_get_string("SpellCheckLanguage");
+#if HAVE_GSPELL || HAVE_GTKSPELL
balsa_app.spell_check_active =
libbalsa_conf_get_bool_with_default("SpellCheckActive", &def_used);
if (def_used)
@@ -1351,9 +1351,9 @@ config_save(void)
libbalsa_conf_remove_group("Spelling");
libbalsa_conf_push_group("Spelling");
-#if HAVE_GSPELL || HAVE_GTKSPELL
libbalsa_conf_set_string("SpellCheckLanguage",
balsa_app.spell_check_lang);
+#if HAVE_GSPELL || HAVE_GTKSPELL
libbalsa_conf_set_bool("SpellCheckActive",
balsa_app.spell_check_active);
#else /* HAVE_GTKSPELL */
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 83a0d51..161f8b5 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -4056,12 +4056,8 @@ create_lang_menu(GtkWidget * parent, BalsaSendmsg * bsmsg)
}
/* find the preferred charset... */
-#if HAVE_GSPELL || HAVE_GTKSPELL
preferred_lang = balsa_app.spell_check_lang ?
balsa_app.spell_check_lang : setlocale(LC_CTYPE, NULL);
-#else /* HAVE_GTKSPELL */
- preferred_lang = setlocale(LC_CTYPE, NULL);
-#endif /* HAVE_GTKSPELL */
#if HAVE_GTKSPELL_3_0_3
lang_list = gtk_spell_checker_get_language_list();
@@ -6191,9 +6187,9 @@ lang_set_cb(GtkWidget * w, BalsaSendmsg * bsmsg)
lang = g_object_get_data(G_OBJECT(w), BALSA_LANGUAGE_MENU_LANG);
set_locale(bsmsg, lang);
-#if HAVE_GSPELL || HAVE_GTKSPELL
g_free(balsa_app.spell_check_lang);
balsa_app.spell_check_lang = g_strdup(lang);
+#if HAVE_GSPELL || HAVE_GTKSPELL
sw_action_set_active(bsmsg, "spell-check", TRUE);
#endif /* HAVE_GTKSPELL */
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]