diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | boards/mypaint.xml.in | 2 | ||||
-rw-r--r-- | src/gcompris/gcompris.c | 70 | ||||
-rw-r--r-- | src/gcompris/properties.c | 7 |
5 files changed, 56 insertions, 34 deletions
@@ -1,3 +1,10 @@ +2007-02-04 Bruno coudoin <bruno.coudoin@free.fr> + + * Makefile.am: replace CVS by .svn + * boards/mypaint.xml.in: Improved help + * src/gcompris/gcompris.c: (main): fixed support for --config-dir and --user-dir + * src/gcompris/properties.c: (gc_prop_new), (old_config_migration): - + 2007-02-04 Yves Combe <yves@ycombe.net> add MyPaint brushes and wml.in diff --git a/Makefile.am b/Makefile.am index f2c6a00..b34a86d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -54,13 +54,13 @@ install-data-local: @$(NORMAL_INSTALL) if test -d $(srcdir)/$(PACKAGE_DATA_DIR); then \ $(mkinstalldirs) $(DESTDIR)/$(pkgdatadir)/$(PACKAGE_DATA_DIR); \ - cd $(srcdir)/$(PACKAGE_DATA_DIR) ; tar cf - --exclude "Makefile.in" --exclude "*.in" --exclude "*~" --exclude "Makefile" --exclude "Makefile.am" --exclude CVS --exclude .xvpics --exclude "1[1-9].ogg" --exclude "2?.ogg" * | ( cd $(DESTDIR)/$(pkgdatadir)/$(PACKAGE_DATA_DIR) ; tar xf -) ; cd .. ; \ + cd $(srcdir)/$(PACKAGE_DATA_DIR) ; tar cf - --exclude "Makefile.in" --exclude "*.in" --exclude "*~" --exclude "Makefile" --exclude "Makefile.am" --exclude .svn --exclude .xvpics --exclude "1[1-9].ogg" --exclude "2?.ogg" * | ( cd $(DESTDIR)/$(pkgdatadir)/$(PACKAGE_DATA_DIR) ; tar xf -) ; cd .. ; \ fi dist-hook: if test -d $(PACKAGE_DATA_DIR); then \ $(mkinstalldirs) $(distdir)/$(PACKAGE_DATA_DIR); \ - cd $(srcdir)/$(PACKAGE_DATA_DIR) ; tar cf - --exclude "Makefile.in" --exclude "Makefile" --exclude "*~" --exclude ".*" --exclude CVS --exclude .xvpics * | ( cd ../$(distdir)/$(PACKAGE_DATA_DIR) ; tar xf -) ; cd .. ; \ + cd $(srcdir)/$(PACKAGE_DATA_DIR) ; tar cf - --exclude "Makefile.in" --exclude "Makefile" --exclude "*~" --exclude ".*" --exclude .svn --exclude .xvpics * | ( cd ../$(distdir)/$(PACKAGE_DATA_DIR) ; tar xf -) ; cd .. ; \ fi diff --git a/boards/mypaint.xml.in b/boards/mypaint.xml.in index da6de85..84bcdd0 100644 --- a/boards/mypaint.xml.in +++ b/boards/mypaint.xml.in @@ -4,7 +4,7 @@ <_title>MyPaint</_title> <_description>Painting application</_description> <_prerequisite>mouse manipulation</_prerequisite> - <_goal>Drawing activity (pixmap). Uses pressure device if any.</_goal> + <_goal>Painting activity. Uses pressure device if any.</_goal> <_manual>Choose brush and colors and draw. have fun!</_manual> </Board> </GCompris> diff --git a/src/gcompris/gcompris.c b/src/gcompris/gcompris.c index 0c716e0..5ce49c2 100644 --- a/src/gcompris/gcompris.c +++ b/src/gcompris/gcompris.c @@ -43,6 +43,9 @@ #include <X11/extensions/xf86vmode.h> #endif +/* get the default database name */ +#define DEFAULT_DATABASE "gcompris_sqlite.db" + static GtkWidget *window; static GnomeCanvas *canvas; static GnomeCanvas *canvas_bar; @@ -159,7 +162,7 @@ static GOptionEntry options[] = { N_("Run GCompris in administration and user-management mode"), NULL}, {"database", 'b', 0, G_OPTION_ARG_STRING, &popt_database, - N_("Use alternate database for profiles"), NULL}, + N_("Use alternate database for profiles [$HOME/.config/gcompris/gcompris_sqlite.db]"), NULL}, {"logs", 'j', 0, G_OPTION_ARG_STRING, &popt_logs_database, N_("Use alternate database for logs"), NULL}, @@ -177,9 +180,9 @@ static GOptionEntry options[] = { N_("List all available profiles. Use 'gcompris -a' to create profiles"), NULL}, {"config-dir",'\0', 0, G_OPTION_ARG_STRING, &popt_config_dir, - N_("Config directory location: [$HOME/.config/gcompris]"), NULL}, + N_("Config directory location: [$HOME/.config/gcompris]. Alternate is to set $XDG_CONFIG_HOME."), NULL}, - {"users-dir",'\0', 0, G_OPTION_ARG_STRING, &popt_user_dir, + {"user-dir",'\0', 0, G_OPTION_ARG_STRING, &popt_user_dir, N_("The location of user directories: [$HOME/My GCompris]"), NULL}, {"experimental",'\0', 0, G_OPTION_ARG_NONE, &popt_experimental, @@ -1428,18 +1431,24 @@ main (int argc, char *argv[]) gc_debug = TRUE; } - if (popt_config_dir){ - if ((!g_file_test(popt_config_dir, G_FILE_TEST_IS_DIR)) || - (g_access(popt_config_dir, popt_administration? W_OK : R_OK ) == -1)){ - printf("%s does not exists or is not %s", popt_config_dir, - popt_administration? "writable" : "readable" ); - exit(0); - } - else { - g_warning("Using %s as config directory.", popt_config_dir); - properties->config_dir = g_strdup(popt_config_dir); + if (popt_config_dir) + { + printf("popt_config_dir\n"); + if ((!g_file_test(popt_config_dir, G_FILE_TEST_IS_DIR)) || + (g_access(popt_config_dir, popt_administration? W_OK : R_OK ) == -1)) + { + printf("%s does not exists or is not %s", popt_config_dir, + popt_administration? "writable" : "readable" ); + exit(0); + } + else + { + g_warning("Using %s as config directory.", popt_config_dir); + g_free(properties->config_dir); + properties->config_dir = g_strdup(popt_config_dir); + } } - } + /* Now we know where our config file is, load the saved config */ gc_prop_load(properties); @@ -1565,22 +1574,25 @@ main (int argc, char *argv[]) } } - if (popt_user_dir){ - if ((!g_file_test(popt_user_dir, G_FILE_TEST_IS_DIR)) || - (g_access(popt_user_dir, popt_administration? R_OK : W_OK ) == -1)){ - g_warning("%s does not exists or is not %s ", popt_user_dir, - popt_administration? "readable" : "writable"); - exit(0); - } else { - g_warning("Using %s as users directory.", popt_user_dir); - g_free(properties->user_dir); - properties->user_dir = g_strdup(popt_user_dir); + if (popt_user_dir) + { + if ((!g_file_test(popt_user_dir, G_FILE_TEST_IS_DIR)) || + (g_access(popt_user_dir, popt_administration? R_OK : W_OK ) == -1)) + { + g_warning("%s does not exists or is not %s ", popt_user_dir, + popt_administration? "readable" : "writable"); + exit(0); + } + else + { + g_warning("Using %s as user directory.", popt_user_dir); + g_free(properties->user_dir); + properties->user_dir = g_strdup(popt_user_dir); + } } - } if (popt_database) { - g_free(properties->database); properties->database = g_strdup(popt_database); if (g_file_test(properties->database, G_FILE_TEST_EXISTS)) @@ -1592,6 +1604,12 @@ main (int argc, char *argv[]) } } } + else + { + /* Init the default database location */ + properties->database = g_strconcat(properties->config_dir, + "/", DEFAULT_DATABASE, NULL); + } /* config_dir initialised, now we can set the default */ printf("Infos:\n Config dir '%s'\n Users dir '%s'\n Database '%s'\n", diff --git a/src/gcompris/properties.c b/src/gcompris/properties.c index 2f889be..0d1287c 100644 --- a/src/gcompris/properties.c +++ b/src/gcompris/properties.c @@ -34,9 +34,6 @@ # include <windows.h> #endif -/* get the default database name */ -#define DEFAULT_DATABASE "gcompris_sqlite.db" - /* * return 1 if parsing OK, 0 otherwise * the return value is returned in retval @@ -183,7 +180,7 @@ gc_prop_new () tmp->config_dir = gc_prop_default_config_directory_get(); tmp->user_dir = gc_prop_default_user_directory_get(); - tmp->database = g_strconcat(tmp->config_dir, "/", DEFAULT_DATABASE, NULL); + tmp->database = NULL; return (tmp); } @@ -212,7 +209,7 @@ void old_config_migration(GcomprisProperties *props) g_free(new); /* DATA BASE FILE MIGRATION */ - new = g_strconcat(props->config_dir, "/", DEFAULT_DATABASE, NULL); + new = g_strconcat(props->config_dir, "/gcompris_sqlite.db", NULL); if (!g_file_test(new, G_FILE_TEST_IS_REGULAR)) { |