[dasher] Fix Spanish xml mdash. Fix so dasher works with gconf. GConf's gconf-2.m4 should be fixed upstream a



commit e7fe8a297b51eff6d68cce4346895449ea11c14a
Author: Patrick Welche <prlw1 cam ac uk>
Date:   Wed Dec 23 22:58:42 2009 +0000

    Fix Spanish xml mdash.
    Fix so dasher works with gconf. GConf's gconf-2.m4 should be
    fixed upstream as if you don't have gconf installed,
    AM_GCONF_SOURCE_2 will give an error as it calls gconftool-2.
    If you pkg-config check for gconf, and try
    
    if gconf_is_found
      AM_GCONF_SOURCE_2
    fi
    
    things will break as AM_GCONF_SOURCE_2 has an AM_CONDITIONAL
    which then won't be defined.

 ChangeLog                      |    2 ++
 Data/Help/Gnome/es/es.po       |    8 ++++----
 Src/Gtk2/DasherAppSettings.cpp |    7 ++++++-
 Src/Gtk2/Makefile.am           |    7 ++++---
 configure.ac                   |   13 ++++---------
 m4/gconf-2.m4                  |   13 +++++++++----
 6 files changed, 29 insertions(+), 21 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 43a1a2a..3f38f21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2009-12-20  Patrick Welche <prlw1 cam ac uk>
 
 	* Import newer gconf-2.m4
+	* Fix so dasher works with gconf.
+	* Fix Spanish xml mdash.
 
 2009-12-18  Alan Lawrence <acl33 inf phy cam ac uk>
 
diff --git a/Data/Help/Gnome/es/es.po b/Data/Help/Gnome/es/es.po
index 6dd869e..97236f7 100644
--- a/Data/Help/Gnome/es/es.po
+++ b/Data/Help/Gnome/es/es.po
@@ -1163,9 +1163,9 @@ msgid ""
 "to the training file, or replace the original training file."
 msgstr ""
 "Si es posible, proporcione a Dasher un texto de entrenamiento con su propio "
-"estilo &mdash;un archivo de texto plano con partes de documentos que haya "
+"estilo &amp;mdash;un archivo de texto plano con partes de documentos que haya "
 "escrito anteriormente y que contenga sus propias frases, nombres de amigos y "
-"demás&mdash;. Añada este archivo al final del archivo de entrenamiento o "
+"demás&amp;mdash;. Añada este archivo al final del archivo de entrenamiento o "
 "reemplace el archivo de entrenamiento original."
 
 #: C/dasher.xml:865(para)
@@ -1819,7 +1819,7 @@ msgid ""
 "[This feature is not currently provided within Dasher.]"
 msgstr ""
 "Ajuste el <emphasis>botón de menú de Dasher</emphasis> como se ha descrito "
-"anteriormente y use el tercer botón como tecla de escape &mdash;para salir "
+"anteriormente y use el tercer botón como tecla de escape &amp;mdash;para salir "
 "de Dasher, por ejemplo. (Dasher no proporciona esta característica.)"
 
 #: C/dasher.xml:1157(para)
@@ -1877,7 +1877,7 @@ msgid ""
 msgstr ""
 "Pruebe el <emphasis>botón directo de Dasher</emphasis> y el <emphasis>botón "
 "de menú de Dasher</emphasis>. Con tantos botones, también tiene la opción de "
-"usar un sistema como el T9 &mdash;el sistema de predicción de texto para "
+"usar un sistema como el T9 &amp;mdash;el sistema de predicción de texto para "
 "teléfonos móviles. Si quiere puede investigar <emphasis>Tapir</emphasis>, un "
 "teclado de desambiguación de los desarrolladores de Dasher."
 
diff --git a/Src/Gtk2/DasherAppSettings.cpp b/Src/Gtk2/DasherAppSettings.cpp
index 3b41846..f27792d 100644
--- a/Src/Gtk2/DasherAppSettings.cpp
+++ b/Src/Gtk2/DasherAppSettings.cpp
@@ -124,7 +124,6 @@ static void dasher_app_settings_init_gconf(DasherAppSettings *pSelf, int argc, c
   if(!gconf_init(argc, argv, &pGConfError))
     g_error("Failed to initialise gconf: %s", pGConfError->message);
   
-  // FIXME - apparently there's a function gnome_gconf_get_client - maybe we should use this if building with gnome
     pPrivate->pGConfClient = gconf_client_get_default();
 #endif
 }
@@ -343,6 +342,7 @@ void dasher_app_settings_set_long(DasherAppSettings *pSelf, int iParameter, gint
 }
 
 gboolean dasher_app_settings_get_free_long(DasherAppSettings *pSelf, const gchar *szName, gint &iValue) {
+#ifdef WITH_GCONF
   DasherAppSettingsPrivate *pPrivate = (DasherAppSettingsPrivate *)(pSelf->private_data);
 
   gchar szFullName[256];
@@ -363,9 +363,13 @@ gboolean dasher_app_settings_get_free_long(DasherAppSettings *pSelf, const gchar
   else {
     return false;
   }
+#else
+  return false;
+#endif
 }
 
 void dasher_app_settings_set_free_long(DasherAppSettings *pSelf, const gchar *szName, gint iValue) {   
+#ifdef WITH_GCONF
   DasherAppSettingsPrivate *pPrivate = (DasherAppSettingsPrivate *)(pSelf->private_data);
 
   gchar szFullName[256];
@@ -375,6 +379,7 @@ void dasher_app_settings_set_free_long(DasherAppSettings *pSelf, const gchar *sz
 
   GError *pGConfError = NULL;
   gconf_client_set_int(pPrivate->pGConfClient, szFullName, iValue, &pGConfError);
+#endif
 }
 
 const gchar *dasher_app_settings_get_string(DasherAppSettings *pSelf, int iParameter) {
diff --git a/Src/Gtk2/Makefile.am b/Src/Gtk2/Makefile.am
index 2852c38..bdeecd6 100644
--- a/Src/Gtk2/Makefile.am
+++ b/Src/Gtk2/Makefile.am
@@ -1,7 +1,10 @@
 LIBS = @INTLLIBS@ @LIBS@
 
 noinst_LTLIBRARIES = libdashergtk.la libdashercontrol.la
-noinst_PROGRAMS = generate-schema
+if GCONF_SCHEMAS_INSTALL
+  noinst_PROGRAMS = generate-schema
+  generate_schema_SOURCES = GenerateSchema.cpp
+endif
 
 #bin_PROGRAMS = dasher-config
 
@@ -11,8 +14,6 @@ else
 settings_store = 
 endif
 
-generate_schema_SOURCES = GenerateSchema.cpp
-
 #dasher_config_SOURCES = \
 #		DasherAppSettings.cpp \
 #		DasherAppSettings.h \
diff --git a/configure.ac b/configure.ac
index ca3dfe5..19d9a1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -202,6 +202,7 @@ else
 	BUILDGTK2=false
 fi
 
+AM_GCONF_SOURCE_2
 if test x$BUILDGTK2 = xtrue
 then
 # GtkBuilder's autoconnect feature requires dasher to be linked with
@@ -210,10 +211,9 @@ then
 # (We need this e.g., for <object class="DasherEditor">)
 	GTK2_LIBS="$GTK2_LIBS -export-dynamic"
 
-	PKG_CHECK_MODULES(GCONF, gconf-2.0,[GCONF2HERE=true],[GCONF2HERE=false])
-	if test x$GCONF2HERE = xfalse; then
-		AC_MSG_WARN([GConf was not detected - user preferences will not be stored.])
-	fi
+	PKG_CHECK_MODULES(GCONF, gconf-2.0,
+		[AC_DEFINE([WITH_GCONF], 1, [Use GConf])],
+		[AC_MSG_WARN([GConf was not detected - user preferences will not be stored.])])
 	save_CFLAGS="$CFLAGS"
 	save_LIBS="$LIBS"
 	CFLAGS="$CFLAGS $GTK2_CFLAGS"
@@ -330,11 +330,6 @@ if test x"$BUILDGTK2" = xtrue; then
 	PKG_CHECK_MODULES(gthread, gthread-2.0)
 fi
 
-if test x"$GCONF2HERE" = xtrue ; then
-        AM_GCONF_SOURCE_2
-        AC_DEFINE([WITH_GCONF], 1, [Use GConf])
-fi
-
 AC_SUBST(gnome_speech_LIBS)
 AC_SUBST(gnome_speech_CFLAGS)
 AC_SUBST([SPEECH_SOURCES])
diff --git a/m4/gconf-2.m4 b/m4/gconf-2.m4
index 4a0936e..b6c4951 100644
--- a/m4/gconf-2.m4
+++ b/m4/gconf-2.m4
@@ -7,7 +7,8 @@ dnl
 
 AC_DEFUN([AM_GCONF_SOURCE_2],
 [
-  if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
+  AC_CHECK_PROG([found_gconftool], [gconftool-2], [yes], [no])
+  if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x" -a $found_gconftool = yes; then
     GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
   else
     GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
@@ -19,7 +20,9 @@ AC_DEFUN([AM_GCONF_SOURCE_2],
 	      [GCONF_SCHEMA_CONFIG_SOURCE="$withval"],)
 
   AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
-  AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
+  if test $found_gconftool = yes; then
+    AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
+  fi
 
   if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
     GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
@@ -31,7 +34,9 @@ AC_DEFUN([AM_GCONF_SOURCE_2],
 	      [GCONF_SCHEMA_FILE_DIR="$withval"],)
 
   AC_SUBST(GCONF_SCHEMA_FILE_DIR)
-  AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
+  if test $found_gconftool = yes; then
+    AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
+  fi
 
   AC_ARG_ENABLE(schemas-install,
   	AC_HELP_STRING([--disable-schemas-install],
@@ -40,5 +45,5 @@ AC_DEFUN([AM_GCONF_SOURCE_2],
        yes|no) ;;
        *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-install]) ;;
       esac])
-  AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
+  AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no -a $found_gconftool = yes])
 ])



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]