Revision 2471

src/compose.c (revision 2471)
507 507

  
508 508
#if USE_GTKSPELL
509 509
static void compose_set_spell_lang_menu (Compose	*compose);
510
static void compose_change_spell_lang_menu
511
					(Compose	*compose,
512
					 const gchar	*lang);
510 513
static void compose_toggle_spell_cb	(gpointer	 data,
511 514
					 guint		 action,
512 515
					 GtkWidget	*widget);
......
1219 1222
		menu_set_active(ifactory, "/Tools/Request disposition notification", TRUE);
1220 1223
	}
1221 1224
	menu_set_active(ifactory, "/Edit/Auto wrapping", compose->autowrap);
1225
#if USE_GTKSPELL
1226
	menu_set_active(ifactory, "/Tools/Check spell", compose->check_spell);
1227
	compose_change_spell_lang_menu(compose, compose->spell_lang);
1228
#endif
1222 1229

  
1223 1230
	syl_plugin_signal_emit("compose-created", compose);
1224 1231

  
......
1600 1607
				       {"FWD:", NULL, FALSE},
1601 1608
				       {"Disposition-Notification-To:", NULL, FALSE},
1602 1609
				       {"X-Sylpheed-Compose-AutoWrap:", NULL, FALSE},
1610
				       {"X-Sylpheed-Compose-CheckSpell:", NULL, FALSE},
1611
				       {"X-Sylpheed-Compose-SpellLang:", NULL, FALSE},
1603 1612
				       {NULL, NULL, FALSE}};
1604 1613

  
1605 1614
	enum
......
1609 1618
		H_REP = 2,
1610 1619
		H_FWD = 3,
1611 1620
		H_MDN = 4,
1612
		H_X_SYLPHEED_COMPOSE_AUTOWRAP = 5
1621
		H_X_SYLPHEED_COMPOSE_AUTOWRAP = 5,
1622
		H_X_SYLPHEED_COMPOSE_CHECKSPELL = 6,
1623
		H_X_SYLPHEED_COMPOSE_SPELLLANG = 7
1613 1624
	};
1614 1625

  
1615 1626
	gchar *file;
......
1645 1656
				compose->autowrap = TRUE;
1646 1657
			else
1647 1658
				compose->autowrap = FALSE;
1659
#if USE_GTKSPELL
1660
		} else if (hnum == H_X_SYLPHEED_COMPOSE_CHECKSPELL) {
1661
			if (g_ascii_strcasecmp(str, "TRUE") == 0)
1662
				compose->check_spell = TRUE;
1663
			else
1664
				compose->check_spell = FALSE;
1665
		} else if (hnum == H_X_SYLPHEED_COMPOSE_SPELLLANG) {
1666
			g_free(compose->spell_lang);
1667
			compose->spell_lang = g_strdup(str);
1668
#endif
1648 1669
		}
1649 1670
	}
1650 1671

  
......
4729 4750
			fprintf(fp, "X-Sylpheed-Forward: %s\n",
4730 4751
				compose->forward_targets);
4731 4752
		fprintf(fp, "X-Sylpheed-Compose-AutoWrap: %s\n",
4732
			compose->autowrap ? "TRUE": "FALSE");
4753
			compose->autowrap ? "TRUE" : "FALSE");
4754
#if USE_GTKSPELL
4755
		fprintf(fp, "X-Sylpheed-Compose-CheckSpell: %s\n",
4756
			compose->check_spell ? "TRUE" : "FALSE");
4757
		if (compose->spell_lang)
4758
			fprintf(fp, "X-Sylpheed-Compose-SpellLang: %s\n",
4759
				compose->spell_lang);
4760
#endif
4733 4761
	}
4734 4762

  
4735 4763
	/* separator between header and body */
......
5958 5986
	gtk_widget_show(menu);
5959 5987
	gtk_menu_item_set_submenu(GTK_MENU_ITEM(compose->spell_menu), menu);
5960 5988
}
5989

  
5990
static void compose_change_spell_lang_menu(Compose *compose, const gchar *lang)
5991
{
5992
	GtkWidget *menu;
5993
	GList *cur_item;
5994
	const gchar *dict;
5995

  
5996
	if (!lang)
5997
		return;
5998

  
5999
	menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(compose->spell_menu));
6000
	for (cur_item = GTK_MENU_SHELL(menu)->children; cur_item != NULL;
6001
	     cur_item = cur_item->next) {
6002
		dict = g_object_get_data(G_OBJECT(cur_item->data), "spell-lang");
6003
		if (dict && !g_ascii_strcasecmp(dict, lang)) {
6004
			gtk_check_menu_item_set_active
6005
				(GTK_CHECK_MENU_ITEM(cur_item->data), TRUE);
6006
			break;
6007
		}
6008
	}
6009
}
5961 6010
#endif /* USE_GTKSPELL */
5962 6011

  
5963 6012
static void compose_set_template_menu(Compose *compose)
ChangeLog (revision 2471)
1 1
2010-02-12
2 2

  
3
	* src/compose: Preserve spell-checking settings saving and loading
4
	  drafts (thanks to Antonio).
5

  
6
2010-02-12
7

  
3 8
	* libsylph/folder.c
4 9
	  src/quick_search.[ch]
5 10
	  src/addressbook.c: added 'In addressbook' to the quick search menu.

Also available in: Unified diff