[gcompris/gcomprixogoo] MacOSX port on its way. We now have the python part working in the bundle.



commit 233dc9b8dde06c337be968e6d951173e842aa62f
Author: Bruno Coudoin <bruno ordinateur-de-bruno-coudoin local>
Date:   Wed Mar 31 22:21:02 2010 +0200

    MacOSX port on its way. We now have the python part working in the bundle.

 Makefile.am                   |    1 -
 configure.ac                  |    7 -------
 macosx/gcompris.bundle        |   19 +++++++++++++++++++
 src/gcompris/gcompris-board.h |    3 +++
 src/gcompris/gcompris.c       |    5 ++++-
 src/gcompris/gcompris_db.c    |   20 ++++++++++++++++----
 6 files changed, 42 insertions(+), 13 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index f5d18bf..bd0006d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -82,7 +82,6 @@ CONFIG_CLEAN_FILES = gcompris.desktop gcompris-edit.desktop config.h.mingw
 
 clean-local:
 	rm -f intltool-extract intltool-merge intltool-update
-	-rm -fr $(BUNDLE_APPDIR)
 
 update-voices:
 	@if test -d $(PACKAGE_DATA_DIR)/voices; then \
diff --git a/configure.ac b/configure.ac
index 29dbd22..8994800 100644
--- a/configure.ac
+++ b/configure.ac
@@ -122,13 +122,6 @@ fi
 
 _AM_DEPENDENCIES([OBJC])
 
-bundlename=GCompris
-nsbundledir=$(pwd)"/$bundlename.app"
-BUNDLE_APPDIR="$nsbundledir"
-BUNDLE_NAME="$bundlename"
-AC_SUBST(BUNDLE_APPDIR)
-AC_SUBST(BUNDLE_NAME)
-
 ### --------------------------------------------------------------------------
 ### Check to see if GDK uses the quartz backend and if we can use
 ### MacOSX integration
diff --git a/macosx/gcompris.bundle b/macosx/gcompris.bundle
index 4b22624..2db96fc 100644
--- a/macosx/gcompris.bundle
+++ b/macosx/gcompris.bundle
@@ -71,10 +71,25 @@
     ${prefix}/lib/libvorbisfile.dylib
   </binary>
 
+  <!-- Python
+  <binary>
+    ${prefix}/../local/lib/libpython2.6.dylib
+  </binary>
+  <binary>
+    ${prefix}/../local/lib/libpyglib-2.0-python.dylib
+  </binary>
+  <binary>
+    ${prefix}/../local/lib/python2.6
+  </binary>
+ -->
+
   <!-- GCompris plugins -->
   <binary>
     ${prefix}/lib/gcompris/*.so
   </binary>
+  <binary>
+    ${prefix}/lib/gcompris/*.dylib
+  </binary>
 
   <!-- Copy in GTK+ theme engines. Dunno why this is a dupe of
   modules, but that's why it's commented out. >
@@ -105,6 +120,10 @@
     ${prefix}/share/gcompris
   </data>
 
+  <data>
+    ${prefix}/lib/python2.6
+  </data>
+
   <!-- Copy in the themes data. You may want to trim this to save space
        in your bundle. -->
   <data>
diff --git a/src/gcompris/gcompris-board.h b/src/gcompris/gcompris-board.h
index 2df66c3..3b58cd4 100644
--- a/src/gcompris/gcompris-board.h
+++ b/src/gcompris/gcompris-board.h
@@ -83,6 +83,9 @@ struct _GcomprisBoard
 
   /* IM_context control */
   gboolean             disable_im_context;
+
+  /* This activity is available only in the demo version */
+  gboolean	       demo_only;
 };
 
 
diff --git a/src/gcompris/gcompris.c b/src/gcompris/gcompris.c
index 8dedbbf..afb973d 100644
--- a/src/gcompris/gcompris.c
+++ b/src/gcompris/gcompris.c
@@ -1224,7 +1224,10 @@ static void load_properties ()
     g_message("Binary relocation enabled");
   else
     {
-      g_message("Binary relocation disabled code = %d", error->code);
+      if (error->code == GBR_INIT_ERROR_DISABLED)
+	g_message("Binary relocation disabled");
+      else
+	g_message("Binary relocation start failed with error %d", error->code);
       g_error_free (error);
     }
 
diff --git a/src/gcompris/gcompris_db.c b/src/gcompris/gcompris_db.c
index 5826c24..e88a771 100644
--- a/src/gcompris/gcompris_db.c
+++ b/src/gcompris/gcompris_db.c
@@ -50,7 +50,7 @@ static sqlite3 *gcompris_db=NULL;
 #define CREATE_TABLE_BOARDS_PROFILES_CONF				\
   "CREATE TABLE board_profile_conf (profile_id INT, board_id INT, conf_key TEXT, conf_value TEXT ); "
 #define CREATE_TABLE_BOARDS						\
-  "CREATE TABLE boards (board_id INT UNIQUE, name TEXT, section_id INT, section TEXT, author TEXT, type TEXT, mode TEXT, difficulty INT, icon TEXT, boarddir TEXT, mandatory_sound_file TEXT, mandatory_sound_dataset TEXT, filename TEXT, title TEXT, description TEXT, prerequisite TEXT, goal TEXT, manual TEXT, credit TEXT);"
+  "CREATE TABLE boards (board_id INT UNIQUE, name TEXT, section_id INT, section TEXT, author TEXT, type TEXT, mode TEXT, difficulty INT, icon TEXT, boarddir TEXT, mandatory_sound_file TEXT, mandatory_sound_dataset TEXT, filename TEXT, title TEXT, description TEXT, prerequisite TEXT, goal TEXT, manual TEXT, credit TEXT, demo_only INT);"
 #define CREATE_TABLE_LOGS						\
   "CREATE TABLE logs (date TEXT, duration INT, user_id INT, board_id INT, level INT, sublevel INT, status INT, comment TEXT);"
 
@@ -383,6 +383,14 @@ gboolean gc_db_init(gboolean disable_database_)
 	  g_error("SQL error: %s\n", zErrMsg);
 	}
       }
+    if(version <= 17)
+      {
+	g_message("Upgrading from <17 schema version\n");
+	rc = sqlite3_exec(gcompris_db,CREATE_TABLE_BOARDS, NULL,  0, &zErrMsg);
+	if( rc!=SQLITE_OK ) {
+	  g_error("SQL error: %s\n", zErrMsg);
+	}
+      }
   }
 
   return TRUE;
@@ -540,7 +548,8 @@ gc_db_board_update(guint *board_id,
 		   gchar *prerequisite,
 		   gchar *goal,
 		   gchar *manual,
-		   gchar *credit
+		   gchar *credit,
+		   int demo_only
 		   )
 {
   SUPPORT_OR_RETURN(FALSE);
@@ -670,7 +679,8 @@ gc_db_board_update(guint *board_id,
 			     prerequisite,
 			     goal,
 			     manual,
-			     credit
+			     credit,
+			     demo_only
 			     );
 
   rc = sqlite3_get_table(gcompris_db,
@@ -695,7 +705,7 @@ gc_db_board_update(guint *board_id,
 
 
 #define BOARDS_READ							\
-  "SELECT board_id ,name, section_id, section, author, type, mode, difficulty, icon, boarddir, mandatory_sound_file, mandatory_sound_dataset, filename, title, description, prerequisite, goal, manual, credit FROM boards;"
+  "SELECT board_id ,name, section_id, section, author, type, mode, difficulty, icon, boarddir, mandatory_sound_file, mandatory_sound_dataset, filename, title, description, prerequisite, goal, manual, credit, demo_only FROM boards;"
 
 GList *gc_menu_load_db(GList *boards_list)
 {
@@ -764,6 +774,7 @@ GList *gc_menu_load_db(GList *boards_list)
     gcomprisBoard->goal = reactivate_newline(gettext(result[i++]));
     gcomprisBoard->manual = reactivate_newline(gettext(result[i++]));
     gcomprisBoard->credit = reactivate_newline(gettext(result[i++]));
+    gcomprisBoard->demo_only = atoi(result[i++]);
 
     boards = g_list_append(boards, gcomprisBoard);
   }
@@ -1813,6 +1824,7 @@ GcomprisBoard *gc_db_get_board_from_id(int board_id)
   gcomprisBoard->goal = reactivate_newline(gettext(result[i++]));
   gcomprisBoard->manual = reactivate_newline(gettext(result[i++]));
   gcomprisBoard->credit = reactivate_newline(gettext(result[i++]));
+  gcomprisBoard->demo_only = atoi(result[i++]);
 
   sqlite3_free_table(result);
 



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