From ffb864c479eca0edd3c5c0e98c0f0e893cad2d96 Mon Sep 17 00:00:00 2001 From: Yves Combe Date: Wed, 08 Nov 2006 14:53:28 +0000 Subject: 2.6/Win98 fix --- diff --git a/ChangeLog b/ChangeLog index e56f9db..86b740c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2006-11-08 Yves Combe + + 2.6/Win98 fix: + - tuxpaint launcher: fix bug related to pygtk/gtk 2.6 (for win98) + - suppress g_error if no boards in gc_board_pause. + - add error message with db name + - use G_WIN32_IS_NT_BASED, as g_get_home_dir return c:\ instead of NULL in 2.6/Win98 + - reuse time instead of g_timeval for 2.6 + + * configure.in: + * src/boards/python/tuxpaint.py: + * src/gcompris/board.c: (gc_board_pause): + * src/gcompris/gcompris.c: (load_properties): + * src/gcompris/gcompris_db.c: (gc_db_init): + * src/gcompris/menu.c: (gc_menu_load): + * src/gcompris/properties.c: (gc_prop_user_root_directory_get), + (gc_prop_config_file_get): + 2006-10-27 Yves Combe pass -DSTATIC_MODULE for native mingw compilation. diff --git a/configure.in b/configure.in index 4f9fe9d..2218da1 100644 --- a/configure.in +++ b/configure.in @@ -513,7 +513,7 @@ AC_MSG_RESULT([$native_win32]) AM_CONDITIONAL(BUILD_MINGW32, test "$native_win32" = yes) if test "$native_win32" = yes; then - LIBS="$LIBS -luuid -lole32 -lwsock32 -mno-cygwin -mms-bitfields -mwindows" + LIBS="$LIBS -luuid -lole32 -lwsock32 -mno-cygwin -mms-bitfields -mwindows -mconsole" #CFLAGS="$CFLAGS -D__GW32__ -DWIN32 -I$CROSS_ROOT/include -I$CROSS_ROOT/include/glibc" #CFLAGS="$CFLAGS -DWIN32" fi diff --git a/src/boards/python/tuxpaint.py b/src/boards/python/tuxpaint.py index befaa02..dea43b6 100644 --- a/src/boards/python/tuxpaint.py +++ b/src/boards/python/tuxpaint.py @@ -34,7 +34,6 @@ import platform from gettext import gettext as _ pid = None -#board = None class Gcompris_tuxpaint: """TuxPaint Launcher""" @@ -66,6 +65,8 @@ class Gcompris_tuxpaint: "Software\\TuxPaint" ) tuxpaint_dir, type = _winreg.QueryValueEx(tuxpaint_key, "Install_Dir") flags = gobject.SPAWN_DO_NOT_REAP_CHILD + # escape mandatory in Win pygtk2.6 + tuxpaint_dir = '"' + tuxpaint_dir + '"' except: pass @@ -127,7 +128,6 @@ class Gcompris_tuxpaint: #self.window.set_keep_below(False) try: - print tuxpaint_dir, flags, options # bug in working_directory=None ? if (tuxpaint_dir): pid, stdin, stdout, stderr = gobject.spawn_async( @@ -254,9 +254,12 @@ def child_callback(fd, cond, data): if (gcompris.get_properties().fullscreen and not gcompris.get_properties().noxf86vm): gtk.gdk.pointer_grab(data.window.window, True, 0, data.window.window) - #global board - #board.window.set_property("accept-focus", 1) - #board.window.set_keep_above(False) + + #bug in gtk2.6/window + if (gtk.gtk_version <= (2,6,10)): + data.window.unfullscreen() + data.window.fullscreen() + gcompris.sound.reopen() global pid diff --git a/src/gcompris/board.c b/src/gcompris/board.c index ca451db..023ad9a 100644 --- a/src/gcompris/board.c +++ b/src/gcompris/board.c @@ -386,7 +386,7 @@ gc_board_pause(int pause) if(gc_board_get_current_board_plugin()->pause_board) gc_board_get_current_board_plugin()->pause_board(pause); } - else g_error ("No boards to pause ?"); + else g_warning ("No boards to pause ?"); } void diff --git a/src/gcompris/gcompris.c b/src/gcompris/gcompris.c index d5193e2..710e701 100644 --- a/src/gcompris/gcompris.c +++ b/src/gcompris/gcompris.c @@ -1098,12 +1098,12 @@ static void load_properties () g_free(prefix_dir); - /* Display the directory value we have */ + /* Display the directory and database value we have */ printf("package_data_dir = %s\n", properties->package_data_dir); printf("package_locale_dir = %s\n", properties->package_locale_dir); printf("package_plugin_dir = %s\n", properties->package_plugin_dir); printf("package_python_plugin_dir= %s\n", properties->package_python_plugin_dir); - + printf("database = %s\n", properties->database); } GcomprisProperties *gc_prop_get () diff --git a/src/gcompris/gcompris_db.c b/src/gcompris/gcompris_db.c index 31c21aa..ef9cb7e 100644 --- a/src/gcompris/gcompris_db.c +++ b/src/gcompris/gcompris_db.c @@ -149,7 +149,7 @@ int gc_db_init() rc = sqlite3_open(properties->database, &gcompris_db); if( rc ){ - g_error("Can't open database: %s\n", sqlite3_errmsg(gcompris_db)); + g_error("Can't open database %s : %s\n", properties->database, sqlite3_errmsg(gcompris_db)); sqlite3_close(gcompris_db); exit(1); } diff --git a/src/gcompris/menu.c b/src/gcompris/menu.c index 4eb08e0..33aede4 100644 --- a/src/gcompris/menu.c +++ b/src/gcompris/menu.c @@ -634,13 +634,18 @@ void gc_menu_load() properties->reread_menu = TRUE; gc_menu_load_dir(properties->package_data_dir, db); + /* use GTimeVal for portability */ GDate *today = g_date_new(); + +#if (GLIB_MAJOR_VERSION > 2) && (GLIB_MINOR_VERSION > 10) GTimeVal now; g_get_current_time (&now); - g_date_set_time_val (today, &now); - + g_date_set_time_val (today, &now);- +#else + g_date_set_time (today, time (NULL)); +#endif gchar date[11]; g_date_strftime (date, 11, "%F", today); gc_db_set_date(date); diff --git a/src/gcompris/properties.c b/src/gcompris/properties.c index 17a1979..002d1de 100644 --- a/src/gcompris/properties.c +++ b/src/gcompris/properties.c @@ -78,9 +78,11 @@ gc_prop_user_root_directory_get () { G_CONST_RETURN gchar *home_dir = g_get_home_dir(); - if (home_dir == NULL) /* Win9x */ - return g_strdup("gcompris"); +#ifdef WIN32 + if ( ! G_WIN32_IS_NT_BASED() ) /* Win9x */ + return g_strdup("../gcompris"); else +#endif return g_strconcat(home_dir, "/.gcompris", NULL); } @@ -97,7 +99,7 @@ gc_prop_config_file_get() return(config_file); dir = gc_prop_user_root_directory_get(); /* Was never called, must calculate it */ - if (g_get_home_dir()==NULL) { + if (! G_WIN32_IS_NT_BASED() ) { config_file = g_strconcat(dir, "/gcompris.cfg", NULL); } else { config_file = g_strconcat(dir, "/gcompris.conf", NULL); -- cgit v0.9.1