diff options
author | Bruno Coudoin <bcoudoin@src.gnome.org> | 2005-11-23 23:52:12 (GMT) |
---|---|---|
committer | Bruno Coudoin <bcoudoin@src.gnome.org> | 2005-11-23 23:52:12 (GMT) |
commit | 2eb24fc2939e6c8b627676a3d91c7ea3c3c892a1 (patch) | |
tree | 80adf6ddfc34e56974bc67a4e019d10f7570601d | |
parent | efdb222222bf7ca30cdd1b00ff39e49a7277b548 (diff) |
fixed for windows, missing " release 7.1.1 fixed uninstallation now usegcompris_7_1
* Makefile.mingw: fixed for windows, missing "
* configure.in: release 7.1.1
* gcompris-installer.nsi: fixed uninstallation
* gcompris.spec.in: now use mandriva-release instead of mandrake. no more check %canvaslib < 2.3.6
because the numbering has changed, at least on mandriva. not sure it's usefull.
* src/boards/draw.c: fixed to work again on windows
* src/boards/python.c: (pythonboard_init): taken patch from HEAD to remove
the error AttributeError: 'module' object has no attribute 'argv'
thanks to misc and erwan for their help.
* src/gcompris/gameutil.c: (gcompris_load_pixmap),
(gcompris_read_xml_file), (gcompris_find_absolute_filename):
* src/gcompris/images_selector.c: (gcompris_images_selector_start),
(display_image), (parseImage), (read_xml_file),
(read_dataset_directory): use gcompris_find_absolute_filename from HEAD. This fixed an error
in image_selector when a tuxpaint image is selected.
* src/gcompris/properties.c: (gcompris_properties_new): added user_data_dir from HEAD
* src/gcompris/properties.h: added user_data_dir from HEAD
-rw-r--r-- | ChangeLog | 30 | ||||
-rw-r--r-- | Makefile.mingw | 2 | ||||
-rw-r--r-- | configure.in | 18 | ||||
-rw-r--r-- | gcompris-installer.nsi | 2 | ||||
-rw-r--r-- | gcompris.spec.in | 4 | ||||
-rw-r--r-- | src/boards/draw.c | 2 | ||||
-rw-r--r-- | src/boards/python.c | 3 | ||||
-rw-r--r-- | src/gcompris/gameutil.c | 65 | ||||
-rw-r--r-- | src/gcompris/images_selector.c | 22 | ||||
-rw-r--r-- | src/gcompris/properties.c | 5 | ||||
-rw-r--r-- | src/gcompris/properties.h | 3 |
11 files changed, 97 insertions, 59 deletions
@@ -1,3 +1,25 @@ + *** RELEASE 7.1.1 *** + +2005-11-24 Bruno coudoin <bruno.coudoin@free.fr> + + * Makefile.mingw: fixed for windows, missing " + * configure.in: release 7.1.1 + * gcompris-installer.nsi: fixed uninstallation + * gcompris.spec.in: now use mandriva-release instead of mandrake. no more check %canvaslib < 2.3.6 + because the numbering has changed, at least on mandriva. not sure it's usefull. + * src/boards/draw.c: fixed to work again on windows + * src/boards/python.c: (pythonboard_init): taken patch from HEAD to remove + the error AttributeError: 'module' object has no attribute 'argv' + thanks to misc and erwan for their help. + * src/gcompris/gameutil.c: (gcompris_load_pixmap), + (gcompris_read_xml_file), (gcompris_find_absolute_filename): + * src/gcompris/images_selector.c: (gcompris_images_selector_start), + (display_image), (parseImage), (read_xml_file), + (read_dataset_directory): use gcompris_find_absolute_filename from HEAD. This fixed an error + in image_selector when a tuxpaint image is selected. + * src/gcompris/properties.c: (gcompris_properties_new): added user_data_dir from HEAD + * src/gcompris/properties.h: added user_data_dir from HEAD + *** RELEASE 7.1 FINAL *** 2005-11-17 Bruno coudoin <bruno.coudoin@free.fr> @@ -54,14 +76,6 @@ * src/boards/menu.c: (menu_start): * src/gcompris/gcompris.c: (gcompris_terminate): -2005-11-04 Bruno coudoin <bruno.coudoin@free.fr> - - reviewed by: <delete if not using a buddy> - - * src/boards/menu.c: (menu_start): - * src/gcompris/gcompris.c: (gcompris_terminate): - - *** RELEASE 7.1PRE2 *** 2005-11-03 Bruno coudoin <bruno.coudoin@free.fr> diff --git a/Makefile.mingw b/Makefile.mingw index 4efdeb8..e2d8a24 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -118,5 +118,5 @@ prep: @echo "Copy pixmap" mkdir $(GCOMPRIS_INSTALL_DIR)/share/pixmaps cp gcompris.png $(GCOMPRIS_INSTALL_DIR)/share/pixmaps - @echo "Create the file gcompris-win-prepack.tar.gz + @echo "Create the file gcompris-win-prepack.tar.gz" tar -czf gcompris-win-prepack.tar.gz win32-install-dir nsis diff --git a/configure.in b/configure.in index 6082e62..10b6444 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(src/gcompris/gcompris.c) AC_CANONICAL_TARGET -AM_INIT_AUTOMAKE(gcompris, 7.1) +AM_INIT_AUTOMAKE(gcompris, 7.1.1) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE @@ -426,17 +426,17 @@ VERSION_VOICES_MISC_ES=1.0 AC_SUBST(VERSION_VOICES_MISC_ES) # EU -VERSION_VOICEU_ALPHABET_EU=1.0 -AC_SUBST(VERSION_VOICEU_ALPHABET_EU) +VERSION_VOICES_ALPHABET_EU=1.0 +AC_SUBST(VERSION_VOICES_ALPHABET_EU) -VERSION_VOICEU_COLORS_EU=1.0 -AC_SUBST(VERSION_VOICEU_COLORS_EU) +VERSION_VOICES_COLORS_EU=1.0 +AC_SUBST(VERSION_VOICES_COLORS_EU) -VERSION_VOICEU_GEOGRAPHY_EU=1.0 -AC_SUBST(VERSION_VOICEU_GEOGRAPHY_EU) +VERSION_VOICES_GEOGRAPHY_EU=1.0 +AC_SUBST(VERSION_VOICES_GEOGRAPHY_EU) -VERSION_VOICEU_MISC_EU=1.0 -AC_SUBST(VERSION_VOICEU_MISC_EU) +VERSION_VOICES_MISC_EU=1.0 +AC_SUBST(VERSION_VOICES_MISC_EU) # FR VERSION_VOICES_ALPHABET_FR=1.1 diff --git a/gcompris-installer.nsi b/gcompris-installer.nsi index caaf23a..a5f6af6 100644 --- a/gcompris-installer.nsi +++ b/gcompris-installer.nsi @@ -18,7 +18,7 @@ Var STARTUP_RUN_KEY ;The name var is set in .onInit Name $name -!define GCOMPRIS_VERSION "7.1PRE1" +!define GCOMPRIS_VERSION "7.1" OutFile "gcompris-${GCOMPRIS_VERSION}.exe" diff --git a/gcompris.spec.in b/gcompris.spec.in index 8508e0b..7c20808 100644 --- a/gcompris.spec.in +++ b/gcompris.spec.in @@ -4,7 +4,7 @@ %define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE} %define prefix /usr %define canvaspackage %(if rpm -q redhat-release &> /dev/null; then echo gdk-pixbuf-gnome; elif rpm -q mandrake-release &> /dev/null; then echo gdk-pixbuf-gnomecanvas; else echo; fi) -%define canvaslib %(if rpm -q mandrakelinux-release &> /dev/null; then echo libgnomecanvas2; else echo libgnomecanvas; fi) +%define canvaslib %(if rpm -q mandriva-release &> /dev/null; then echo libgnomecanvas2; else echo libgnomecanvas; fi) Summary: Educational suite for kids 2-10 years old Name: %name @@ -19,7 +19,7 @@ Buildrequires: libxml2-devel libgnomeui2-devel libsqlite3_0-devel Buildrequires: texinfo # (misc) needed for python support Buildrequires: gnome-python python-devel pygtk2.0-devel -Requires: gnome-libs libxml2 gdk-pixbuf %canvaspackage %canvaslib >= 2.3.6 +Requires: gnome-libs libxml2 gdk-pixbuf %canvaspackage %canvaslib Requires: gnuchess >= 5.02 Requires: @REQUIRE_PYTHON@ Requires: assetml-flags diff --git a/src/boards/draw.c b/src/boards/draw.c index 25de6bc..d40b7ed 100644 --- a/src/boards/draw.c +++ b/src/boards/draw.c @@ -28,7 +28,7 @@ #include "gcompris/gcompris.h" #define SOUNDLISTFILE PACKAGE -#define IMG_DATA_SET PACKAGE_DATA_DIR "/dataset/mrpatate.xml" +#define IMG_DATA_SET PACKAGE_DATA_DIR "/dataset" #define FILE_SELECTOR_ROOT "drawings" /* Represent the drawing area */ diff --git a/src/boards/python.c b/src/boards/python.c index ee29f90..d932e71 100644 --- a/src/boards/python.c +++ b/src/boards/python.c @@ -137,6 +137,9 @@ pythonboard_init (GcomprisBoard *agcomprisBoard){ /* Initialize the python interpreter */ Py_Initialize(); + static char *python_args[]={ "" }; + PySys_SetArgv( 1, python_args); + pythonboard_is_ready = TRUE; main_module = PyImport_AddModule("__main__"); /* Borrowed reference */ diff --git a/src/gcompris/gameutil.c b/src/gcompris/gameutil.c index 8d65d3c..600f42d 100644 --- a/src/gcompris/gameutil.c +++ b/src/gcompris/gameutil.c @@ -1,6 +1,6 @@ /* gcompris - gameutil.c * - * Time-stamp: <2005/11/17 21:51:32 bruno> + * Time-stamp: <2005/11/17 11:13:26 yves> * * Copyright (C) 2000 Bruno Coudoin * @@ -184,7 +184,7 @@ GdkPixbuf *gcompris_load_pixmap(char *pixmapfile) if (!filename) { char *str; - g_warning (_("Couldn't find file %s !"), pixmapfile); + g_warning ("Couldn't find file %s !", pixmapfile); str = g_strdup_printf("%s\n%s\n%s\n%s", _("Couldn't find file"), @@ -592,8 +592,8 @@ GcomprisBoard *gcompris_read_xml_file(GcomprisBoard *gcomprisBoard, if(!g_file_test ((filename), G_FILE_TEST_EXISTS)) { - g_warning(_("Couldn't find file %s !"), fname); - g_warning(_("Couldn't find file %s !"), filename); + g_warning("Couldn't find file %s !", fname); + g_warning("Couldn't find file %s !", filename); g_free(filename); g_free(gcomprisBoard); return NULL; @@ -1260,39 +1260,52 @@ gchar *g_utf8_strndup(gchar* utf8text, gint n) return result; } -/* - * Return NULL or a new gchar* with the absolute_filename of the given filename +/** \brief search a given relative file in all gcompris dir it could be found + * + * \return NULL or a new gchar* with the absolute_filename of the given filename * */ gchar *gcompris_find_absolute_filename(gchar *filename) { - gchar *absolute_filename; + int i = 0; + gchar *absolute_filename; + gchar *dir_to_search[4]; + GcomprisProperties *properties = gcompris_get_properties(); + GcomprisBoard *gcomprisBoard = get_current_gcompris_board(); - /* Search it on the file system */ + /* Check it's already an absolute file */ + if(g_path_is_absolute (filename) && + g_file_test (filename, G_FILE_TEST_IS_REGULAR)) + return g_strdup(filename); + + /* + * Search it on the file system + */ + + dir_to_search[i++] = properties->package_data_dir; + dir_to_search[i++] = properties->user_data_dir; - if (!g_path_is_absolute (filename)) { - GcomprisProperties *properties = gcompris_get_properties(); + if(gcomprisBoard) + dir_to_search[i++] = gcomprisBoard->board_dir; - absolute_filename = g_strdup_printf("%s/%s", properties->package_data_dir, filename); + dir_to_search[i++] = NULL; - if (!g_file_test (absolute_filename, G_FILE_TEST_IS_REGULAR)) { - GcomprisBoard *gcomprisBoard = get_current_gcompris_board(); + absolute_filename = g_strdup(filename); + i = 0; + + while (dir_to_search[i]) + { g_free(absolute_filename); - if(gcomprisBoard) { - absolute_filename = g_strdup_printf("%s/%s", gcomprisBoard->board_dir, filename); - } else { - return NULL; - } + absolute_filename = g_strdup_printf("%s/%s", dir_to_search[i], filename); + i++; + if(g_file_test (absolute_filename, G_FILE_TEST_IS_REGULAR)) + goto FOUND; } - } else { - absolute_filename = strdup(filename); - } - if (!g_file_test (absolute_filename, G_FILE_TEST_IS_REGULAR)){ - g_free(absolute_filename); - return NULL; - } - + g_free(absolute_filename); + return NULL; + + FOUND: return absolute_filename; } diff --git a/src/gcompris/images_selector.c b/src/gcompris/images_selector.c index 9501f9d..7159c60 100644 --- a/src/gcompris/images_selector.c +++ b/src/gcompris/images_selector.c @@ -1,6 +1,6 @@ /* gcompris - images_selector.c * - * Time-stamp: <2005/10/01 14:49:05 bruno> + * Time-stamp: <2005/11/12 19:03:14 bruno> * * Copyright (C) 2000 Bruno Coudoin * @@ -44,7 +44,7 @@ static gint item_event_scroll(GnomeCanvasItem *item, GdkEvent *event, GnomeCanvas *canvas); static gboolean read_xml_file(gchar *fname); -static gboolean read_dataset_directory(gchar *dataset_dir); +static gboolean read_dataset_directory(gchar *dataset_dir); static void display_image(gchar *imagename, GnomeCanvasItem *rootitem); static void free_stuff (GtkObject *obj, GList *data); @@ -290,7 +290,7 @@ void gcompris_images_selector_start (GcomprisBoard *gcomprisBoard, gchar *datase /* if the file doesn't exist */ if(g_file_test ((dataset), G_FILE_TEST_IS_DIR) ) { - g_warning(_("dataset %s is a directory. Trying to read xml "), dataset); + g_warning("dataset %s is a directory. Trying to read xml", dataset); read_dataset_directory(dataset); } @@ -348,6 +348,10 @@ static void display_image(gchar *imagename, GnomeCanvasItem *root_item) pixmap = gcompris_load_pixmap(imagename); + /* Sad, the image is not found */ + if(!pixmap) + return; + iw = IMAGE_WIDTH; ih = IMAGE_HEIGHT; @@ -629,7 +633,7 @@ parseImage (xmlDocPtr doc, xmlNodePtr cur) { /* replace '~' by home dir */ pathname = g_strdup_printf("%s%s",g_get_home_dir(), pathname+1); if (!g_file_test ((pathname), G_FILE_TEST_IS_DIR)){ - g_warning(_("In ImageSet %s, the pathname for the home directory '%s' is not found. Skipping the whole ImageSet.\n"), imageSetName, pathname); + g_warning("In ImageSet %s, the pathname for the home directory '%s' is not found. Skipping the whole ImageSet.", imageSetName, pathname); return; } } @@ -663,7 +667,7 @@ parseImage (xmlDocPtr doc, xmlNodePtr cur) { if(!g_file_test ((absolutepath), G_FILE_TEST_EXISTS) ) { - g_warning(_("In ImageSet %s, an image is not found. Skipping ImageSet...\n"), absolutepath); + g_warning("In ImageSet %s, an image is not found. Skipping ImageSet...", absolutepath); return; } @@ -694,7 +698,7 @@ parseImage (xmlDocPtr doc, xmlNodePtr cur) { g_free(pathname); pathname = tmpdir; if (!g_file_test ((pathname), G_FILE_TEST_IS_DIR)){ - g_warning(_("In ImageSet %s, directory %s is not found. Skipping all the ImageSet...\n"), absolutepath, pathname); + g_warning("In ImageSet %s, directory %s is not found. Skipping all the ImageSet...", absolutepath, pathname); return; } } @@ -706,7 +710,7 @@ parseImage (xmlDocPtr doc, xmlNodePtr cur) { continue; } filename = g_strdup_printf("%s/%s", pathname, onefile); - if (!g_file_test ((filename), G_FILE_TEST_EXISTS)){ + if (!g_file_test ((filename), G_FILE_TEST_IS_REGULAR)){ continue; } imageList = g_list_append (imageList, filename); @@ -764,7 +768,7 @@ read_xml_file(gchar *fname) /* if the file doesn't exist */ if(!g_file_test ((fname), G_FILE_TEST_EXISTS)) { - g_warning(_("Couldn't find file %s !"), fname); + g_warning("Couldn't find file %s !", fname); return FALSE; } @@ -815,7 +819,7 @@ read_dataset_directory(gchar *dataset_dir) absolute_fname = g_strdup_printf("%s/%s",dataset_dir,fname); printf("Reading dataset file %s\n",absolute_fname); - if (!g_file_test ((absolute_fname), G_FILE_TEST_EXISTS)) + if (!g_file_test ((absolute_fname), G_FILE_TEST_IS_REGULAR)) continue; /* parse the new file and put the result into newdoc */ diff --git a/src/gcompris/properties.c b/src/gcompris/properties.c index ac6cf5c..a180ccf 100644 --- a/src/gcompris/properties.c +++ b/src/gcompris/properties.c @@ -1,6 +1,6 @@ /* gcompris - properties.c * - * Time-stamp: <2005/10/01 14:03:36 bruno> + * Time-stamp: <2005/11/20 22:11:44 bruno> * * Copyright (C) 2000,2003 Bruno Coudoin * @@ -186,6 +186,9 @@ GcomprisProperties *gcompris_properties_new () tmp->users_dir = g_strconcat(gcompris_user_dir, "/users", NULL); create_rootdir( tmp->users_dir ); + tmp->user_data_dir = g_strconcat(gcompris_user_dir, "/Plugins/boards", NULL); + create_rootdir( tmp->user_data_dir ); + /* Needs to be set after command line parsing */ tmp->database = NULL; diff --git a/src/gcompris/properties.h b/src/gcompris/properties.h index 0fc67ea..4f288e3 100644 --- a/src/gcompris/properties.h +++ b/src/gcompris/properties.h @@ -1,6 +1,6 @@ /* gcompris - properties.h * - * Time-stamp: <2005/09/28 21:03:08 bruno> + * Time-stamp: <2005/11/20 22:08:10 bruno> * * Copyright (C) 2000 Bruno Coudoin * @@ -38,6 +38,7 @@ typedef struct { gint difficulty_max; gchar *root_menu; gchar *local_directory; + gchar *user_data_dir; gchar *package_data_dir; gchar *locale; gchar *skin; |