Commit 744e839a authored by Bruno Coudoin's avatar Bruno Coudoin

Added support for the --package_skin_dir, -S option to GCompris.

There is no more need for the skin link in each activity resource dir.
the runit and bundleit scripts have been updated to use this option.

svn path=/branches/gcomprixogoo/; revision=3339
parent 940b5620
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
......@@ -92,6 +92,9 @@ if [ -f "$extra_bin" ]; then
cp $extra_bin $activity_dir/bin
fi
# Add the skin directory
ln -s ../../../boards/skins -t $activity_dir/resources/
# Add the locale translation file
dir=$activity_dir/locale/$lang/LC_MESSAGES
mkdir -p $dir
......
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
......@@ -559,6 +559,7 @@ gc_file_find_absolute(const gchar *format, ...)
*/
dir_to_search[i++] = properties->package_data_dir;
dir_to_search[i++] = properties->package_skin_dir;
dir_to_search[i++] = NULL;
absolute_filename = g_strdup(filename);
......
......@@ -121,6 +121,7 @@ static gint popt_debug = FALSE;
static gint popt_nolockcheck = FALSE;
static gchar *popt_root_menu = NULL;
static gchar *popt_package_data_dir = NULL;
static gchar *popt_package_skin_dir = NULL;
static gchar *popt_plugin_dir = NULL;
static gchar *popt_python_plugin_dir = NULL;
static gchar *popt_locale_dir = NULL;
......@@ -176,6 +177,9 @@ static GOptionEntry options[] = {
{"package_data_dir", 'A', 0, G_OPTION_ARG_STRING, &popt_package_data_dir,
N_("GCompris will find the data dir in this directory"), NULL},
{"package_skin_dir", 'S', 0, G_OPTION_ARG_STRING, &popt_package_skin_dir,
N_("GCompris will find the skins in this directory"), NULL},
{"plugin_dir", 'L', 0, G_OPTION_ARG_STRING, &popt_plugin_dir,
N_("GCompris will find the activity plugins in this directory"), NULL},
......@@ -1086,6 +1090,7 @@ static void load_properties ()
gchar *pkg_clib_dir = gbr_find_lib_dir(PACKAGE_CLIB_DIR);
properties->package_data_dir = g_strconcat(pkg_data_dir, "/gcompris/boards", NULL);
properties->package_skin_dir = g_strconcat(pkg_data_dir, "/gcompris/boards/skins", NULL);
properties->package_locale_dir = gbr_find_locale_dir(PACKAGE_LOCALE_DIR);
properties->package_plugin_dir = g_strconcat(pkg_clib_dir, "/gcompris", NULL);
properties->package_python_plugin_dir = g_strconcat(pkg_data_dir, "/gcompris/python",
......@@ -1098,6 +1103,7 @@ static void load_properties ()
/* Display the directory value we have */
printf("package_data_dir = %s\n", properties->package_data_dir);
printf("package_skin_dir = %s\n", properties->package_skin_dir);
printf("package_menu_dir = %s\n", properties->menu_dir);
printf("package_locale_dir = %s\n", properties->package_locale_dir);
printf("package_plugin_dir = %s\n", properties->package_plugin_dir);
......@@ -1443,6 +1449,12 @@ main (int argc, char *argv[])
properties->package_data_dir = g_strdup(popt_package_data_dir);
}
if (popt_package_skin_dir) {
printf("Overloaded package_skin_dir = %s\n", popt_package_skin_dir);
g_free(properties->package_skin_dir);
properties->package_skin_dir = g_strdup(popt_package_skin_dir);
}
if (popt_menu_dir) {
printf("Overloaded menu_dir = %s\n", popt_menu_dir);
g_free(properties->menu_dir);
......
......@@ -169,6 +169,7 @@ gc_prop_new ()
tmp->server = NULL;
tmp->package_data_dir = NULL;
tmp->package_skin_dir = NULL;
tmp->package_locale_dir = NULL;
tmp->package_plugin_dir = NULL;
tmp->package_python_plugin_dir = NULL;
......@@ -517,6 +518,7 @@ gc_prop_destroy (GcomprisProperties *props)
if(!props)
return;
g_free(props->package_data_dir);
g_free(props->package_skin_dir);
g_free(props->package_locale_dir);
g_free(props->package_plugin_dir);
g_free(props->package_python_plugin_dir);
......
......@@ -42,6 +42,7 @@ typedef struct {
gint display_resource;
gchar *root_menu;
gchar *package_data_dir;
gchar *package_skin_dir;
gchar *package_locale_dir;
gchar *package_plugin_dir;
gchar *package_python_plugin_dir;
......
......@@ -62,9 +62,10 @@ gc_skin_image_get(gchar *pixmapfile)
gchar *filename;
/* First, test if pixmapfile is in the current skin dir */
filename = g_strdup_printf("%s/skins/%s/%s",
filename = g_strdup_printf("%s/%s/%s",
properties->package_data_dir,
properties->skin, pixmapfile);
properties->skin,
pixmapfile);
if (g_file_test ((filename), G_FILE_TEST_EXISTS)) {
g_free(filename);
......
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
......@@ -30,6 +30,7 @@ fi
$gcompris -L $plugindir \
-P $pythonplugindir \
-A $resourcedir \
-S $menudir/../../boards/skins \
-M $menudir \
--locale_dir=$path/locale \
-l $section/$activity $*
......
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
../../../boards/skins/
\ No newline at end of file
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