Commit b601fc50 authored by Bruno Coudoin's avatar Bruno Coudoin

fixed english - fixed misspelled files added Rwanda

	* boards/erase_clic.xml.in: fixed english
	* boards/erase_double_clic.xml.in: -
	* po/POTFILES.in: fixed misspelled files
	* po_report.pl: added Rwanda
	* src/gcompris/anim.c: (gcompris_load_animation):
	* src/gcompris/gameutil.c: (gcompris_load_pixmap),
	(gcompris_find_absolute_filename): added gcompris_find_absolute_filename by Yves
	It makes it easier to search file in GCompris usual directory or local
	gcomprisBoard->board_dir.
	* src/gcompris/gameutil.h:
	* src/gcompris/soundutil.c: (thread_play_ogg):
parent 900c47ba
2005-04-18 Bruno coudoin <bruno.coudoin@free.fr>
* boards/erase_clic.xml.in: fixed english
* boards/erase_double_clic.xml.in: -
* po/POTFILES.in: fixed misspelled files
* po_report.pl: added Rwanda
* src/gcompris/anim.c: (gcompris_load_animation):
* src/gcompris/gameutil.c: (gcompris_load_pixmap),
(gcompris_find_absolute_filename): added gcompris_find_absolute_filename by Yves
It makes it easier to search file in GCompris usual directory or local
gcomprisBoard->board_dir.
* src/gcompris/gameutil.h:
* src/gcompris/soundutil.c: (thread_play_ogg):
2005-04-18 Bruno coudoin <bruno.coudoin@free.fr>
......
......@@ -9,12 +9,12 @@
mode="clic"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
boarddir="">
<_title>Clic with the mouse</_title>
<_description>Clic with the mouse to erase the area and discover the background</_description>
<_title>Click with the mouse</_title>
<_description>Click with the mouse to erase the area and discover the background</_description>
<_prerequisite>Mouse manipulation</_prerequisite>
<_goal>Motor coordination</_goal>
<_manual>
Clic on rectangles with the mouse until all the blocks disappear.
Click on rectangles with the mouse until all the blocks disappear.
</_manual>
<_credit>Animal pictures are taken from the Animal Photography Page of Ralf Schmode (http://schmode.net/)
Ralf has given gcompris the authorization to include his pictures. Thanks a lot Ralf.
......
......@@ -9,12 +9,12 @@
mode="double_clic"
author="Bruno Coudoin (bruno.coudoin@free.fr)"
boarddir="">
<_title>Double-clic with the mouse</_title>
<_description>Double-Clic with the mouse to erase the area and discover the background</_description>
<_title>Double-click with the mouse</_title>
<_description>Double-Click with the mouse to erase the area and discover the background</_description>
<_prerequisite>Mouse manipulation</_prerequisite>
<_goal>Motor coordination</_goal>
<_manual>
Double clic on rectangles with the mouse until all the blocks disappear.
Double click on rectangles with the mouse until all the blocks disappear.
</_manual>
<_credit>Animal pictures are taken from the Animal Photography Page of Ralf Schmode (http://schmode.net/)
Ralf has given gcompris the authorization to include his pictures. Thanks a lot Ralf.
......
......@@ -72,8 +72,8 @@ boards/doubleentry/board3_0.xml.in
boards/draw.xml.in
boards/enumerate.xml.in
boards/erase.xml.in
boards/erase_click.xml.in
boards/erase_double_click.xml.in
boards/erase_clic.xml.in
boards/erase_double_clic.xml.in
boards/experience.xml.in
boards/followline.xml.in
boards/fifteen.xml.in
......
......@@ -99,6 +99,7 @@ my %COUNTRY = (
'pt_BR' => 'Brazilian Portuguese',
'ro' => 'Romanian',
'ru' => 'Russian',
'rw' => 'Kinyarwanda',
'sk' => 'Slovak',
'sl' => 'Slovenian',
'sq' => 'Albanian',
......
......@@ -32,18 +32,16 @@ static gboolean anim_tick(void*);
GcomprisAnimation *gcompris_load_animation(char *filename)
{
FILE *f;
if(filename[0] == '/') /* we were probably called by load_animation_asset */
{
f = fopen(filename, "r");
}
else
{
GcomprisBoard *gcomprisBoard = get_current_gcompris_board();
gchar *tmp = g_strdup_printf("%s/%s", gcomprisBoard->board_dir, filename);
f = fopen(tmp, "r");
g_free(tmp);
}
FILE *f = NULL;
gchar *absolute_filename;
absolute_filename = gcompris_find_absolute_filename(filename);
if (absolute_filename){
f = fopen(absolute_filename, "r");
g_free(absolute_filename);
}
if(!f)
{
......
......@@ -116,24 +116,15 @@ GdkPixbuf *gcompris_load_pixmap_asset(gchar *dataset, gchar* categories,
GdkPixbuf *gcompris_load_pixmap(char *pixmapfile)
{
gchar *filename;
GdkPixbuf *pixmap;
GcomprisProperties *properties = gcompris_get_properties();
GdkPixbuf *pixmap=NULL;
/* Search it on the file system */
if (!g_path_is_absolute (pixmapfile)) {
filename = g_strdup_printf("%s/%s", properties->package_data_dir, pixmapfile);
if (!g_file_test ((filename), G_FILE_TEST_EXISTS)) {
GcomprisBoard *gcomprisBoard = get_current_gcompris_board();
g_free(filename);
filename = g_strdup_printf("%s/%s", gcomprisBoard->board_dir, pixmapfile);
}
} else {
filename = strdup(pixmapfile);
}
/* Search */
filename = gcompris_find_absolute_filename(pixmapfile);
if (!g_file_test ((filename), G_FILE_TEST_EXISTS)) {
if (!filename) {
char *str;
g_warning (_("Couldn't find file %s !"), filename);
g_warning (_("Couldn't find file %s !"), pixmapfile);
str = g_strdup_printf("%s\n%s\n%s\n%s",
_("Couldn't find file"),
......@@ -142,6 +133,7 @@ GdkPixbuf *gcompris_load_pixmap(char *pixmapfile)
_("Exit it and report\nthe problem to the authors."));
gcompris_dialog (str, NULL);
g_free(str);
return NULL;
}
pixmap = gdk_pixbuf_new_from_file (filename, NULL);
......@@ -1097,6 +1089,32 @@ gchar *g_utf8_strndup(gchar* utf8text, gint n)
return result;
}
gchar *gcompris_find_absolute_filename(gchar *filename)
{
gchar *absolute_filename;
GcomprisProperties *properties = gcompris_get_properties();
/* Search it on the file system */
if (!g_path_is_absolute (filename)) {
absolute_filename = g_strdup_printf("%s/%s", properties->package_data_dir, filename);
if (!g_file_test (absolute_filename, G_FILE_TEST_EXISTS)) {
GcomprisBoard *gcomprisBoard = get_current_gcompris_board();
g_free(absolute_filename);
absolute_filename = g_strdup_printf("%s/%s", gcomprisBoard->board_dir, filename);
}
} else {
absolute_filename = strdup(filename);
}
if (!g_file_test (absolute_filename, G_FILE_TEST_EXISTS)){
g_free(absolute_filename);
return NULL;
}
return absolute_filename;
}
/* Local Variables: */
/* mode:c */
......
......@@ -102,4 +102,7 @@ gchar *gcompris_get_asset_file(gchar *dataset, gchar* categories,
*/
void gcompris_clone_item(GnomeCanvasItem *item, GnomeCanvasGroup *parent);
/* find the complete filename lookig for the file everywhere */
gchar *gcompris_find_absolute_filename(gchar *filename);
#endif
......@@ -218,80 +218,43 @@ static gpointer scheduler (gpointer user_data)
======================================================================*/
static void* thread_play_ogg (void *s)
{
char* file = NULL;
gchar *file = NULL;
gchar *relative_filename;
char locale[3];
GcomprisBoard *gcomprisBoard = get_current_gcompris_board();
strncpy( locale, gcompris_get_locale(), 2 );
locale[2] = 0; // because strncpy does not put a '\0' at the end of the string
if(((char *)s)[0]=='/')
{
/* If the given file starts with a / then we don't need to search it */
file = g_strdup(s);
}
else
{
file = g_strdup_printf("%s/%s/%s.ogg", PACKAGE_DATA_DIR "/sounds", locale, s);
if (g_file_test ((file), G_FILE_TEST_EXISTS))
{
g_warning("trying to play %s\n", file);
}
else
{
g_free(file);
file = g_strdup_printf("%s/%s.ogg", PACKAGE_DATA_DIR "/music", s);
if (g_file_test ((file), G_FILE_TEST_EXISTS))
{
g_warning("trying to play %s\n", file);
}
else
{
/* Try to find a sound file that does not need to be localized
(ie directly in root /sounds directory) */
g_free(file);
file = g_strdup_printf("%s/%s.ogg", PACKAGE_DATA_DIR "/sounds", s);
if (g_file_test ((file), G_FILE_TEST_EXISTS))
{
g_warning("trying to play %s\n", file);
}
else
{
g_free(file);
file = g_strdup_printf("%s", s);
if (g_file_test ((file), G_FILE_TEST_EXISTS))
{
g_warning("trying to play %s\n", file);
}
else if(gcomprisBoard)
{
/* Search it in the board_dir */
g_free(file);
file = g_strdup_printf("%s/%s.ogg", gcomprisBoard->board_dir, s);
if (g_file_test ((file), G_FILE_TEST_EXISTS))
{
g_warning("trying to play %s\n", file);
}
}
else
{
g_free(file);
g_warning("Can't find sound %s", s);
return NULL;
}
}
}
relative_filename = g_strdup_printf("sounds/%s/%s.ogg", locale, s);
file = gcompris_find_absolute_filename(s);
if (!file){
g_free(relative_filename);
relative_filename = g_strdup_printf("music/%s.ogg", s);
file = gcompris_find_absolute_filename(relative_filename);
if (!file){
g_free(relative_filename);
/* Try to find a sound file that does not need to be localized
(ie directly in root /sounds directory) */
relative_filename = g_strdup_printf("sounds/%s.ogg", s);
file = gcompris_find_absolute_filename(relative_filename);
if (!file){
file = gcompris_find_absolute_filename(s);
if (!file){
g_free(relative_filename);
g_warning("Can't find sound %s", s);
return NULL;
}
}
}
}
g_free(relative_filename);
if ( file )
{
g_warning("Calling gcompris internal sdlplayer_file(%s)\n", file);
sdlplayer(file, 128);
g_free( file );
}
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment