almanah r107 - in trunk: . data src
- From: pwithnall svn gnome org
- To: svn-commits-list gnome org
- Subject: almanah r107 - in trunk: . data src
- Date: Sun, 16 Nov 2008 13:25:50 +0000 (UTC)
Author: pwithnall
Date: Sun Nov 16 13:25:50 2008
New Revision: 107
URL: http://svn.gnome.org/viewvc/almanah?rev=107&view=rev
Log:
2008-11-16 Philip Withnall <philip tecnocode co uk>
* data/almanah.schemas.in:
* src/main-window.c (almanah_main_window_new): Allow the
spelling
language to be set with a GConf key.
Modified:
trunk/ChangeLog
trunk/data/almanah.schemas.in
trunk/src/main-window.c
Modified: trunk/data/almanah.schemas.in
==============================================================================
--- trunk/data/almanah.schemas.in (original)
+++ trunk/data/almanah.schemas.in Sun Nov 16 13:25:50 2008
@@ -12,6 +12,17 @@
</locale>
</schema>
<schema>
+ <key>/schemas/apps/almanah/spelling_language</key>
+ <applyto>/apps/almanah/spelling_language</applyto>
+ <owner>almanah</owner>
+ <type>string</type>
+ <default></default>
+ <locale name="C">
+ <short>Spell checking language</short>
+ <long>The locale specifier of the language in which to check entry spellings.</long>
+ </locale>
+ </schema>
+ <schema>
<key>/schemas/apps/almanah/state/main_window_maximized</key>
<applyto>/apps/almanah/state/main_window_maximized</applyto>
<owner>almanah</owner>
Modified: trunk/src/main-window.c
==============================================================================
--- trunk/src/main-window.c (original)
+++ trunk/src/main-window.c Sun Nov 16 13:25:50 2008
@@ -120,6 +120,10 @@
AlmanahMainWindow *main_window;
AlmanahMainWindowPrivate *priv;
GError *error = NULL;
+#ifdef ENABLE_SPELL_CHECKING
+ GtkSpell *gtkspell;
+ gchar *spelling_language;
+#endif /* ENABLE_SPELL_CHECKING */
const gchar *interface_filename = almanah_get_interface_filename ();
const gchar *object_names[] = {
"dry_main_window",
@@ -193,7 +197,18 @@
#ifdef ENABLE_SPELL_CHECKING
/* Set up spell checking */
- if (gtkspell_new_attach (priv->entry_view, NULL, &error) == FALSE) {
+ spelling_language = gconf_client_get_string (almanah->gconf_client, "/apps/almanah/spelling_language", NULL);
+
+ /* Make sure it's either NULL or a proper locale specifier */
+ if (spelling_language != NULL && spelling_language[0] == '\0') {
+ g_free (spelling_language);
+ spelling_language = NULL;
+ }
+
+ gtkspell = gtkspell_new_attach (priv->entry_view, spelling_language, &error);
+ g_free (spelling_language);
+
+ if (gtkspell == NULL) {
GtkWidget *dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
_("Spelling checker could not be initialized"));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]