Commit b7bad2d4 authored by Bruno Coudoin's avatar Bruno Coudoin

More work on the makefiles.

Made a function of the lock file creation, move it downstairs in the startup sequence
to avoid gcompris -v to complain about the lock file

svn path=/branches/gcomprixo/; revision=2848
parent ac5d86ea
SUBDIRS = gcompris
xmldir = $(pkgdatadir)/@PACKAGE_DATA_DIR@
xml_in_files = \
algebra_group.xml.in \
algebramenu.xml.in \
chess.xml.in \
colors_group.xml.in \
computer.xml.in \
discovery.xml.in \
experience.xml.in \
experimental.xml.in \
fun.xml.in \
geometry.xml.in \
gnumchmenu.xml.in \
keyboard.xml.in \
Makefile.in \
math.xml.in \
mazeMenu.xml.in \
memory_group.xml.in \
memory_op_group_tux.xml.in \
memory_op_group.xml.in \
menu.xml.in \
miscelaneous.xml.in \
mouse.xml.in \
numeration.xml.in \
puzzle.xml.in \
reading.xml.in \
sound_group.xml.in \
strategy.xml.in \
writing_tutor.xml.in
xml_DATA = $(xml_in_files:.xml.in=.xml)
# Do not use the INTLTOOL_XML_RULE, we don't need to embed the translations
# in the file themselves. GCompris pick the translations from the po file at
# runtime.
#
$(xml_DATA): %.xml: %.xml.in
sed -e "s/\(<\{1\}\/*\)_/\1/g" $< > $@
# Use this directive and instead of the one above to embed the translations
# in the xml files directly, this is needed for the tool gcompris2spip
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="210mm"
height="297mm"
id="svg1896"
sodipodi:version="0.32"
inkscape:version="0.44.1"
sodipodi:docbase="/home/mat"
sodipodi:docname="bonnefemmeti-lu.svg">
<defs
id="defs1898">
<linearGradient
inkscape:collect="always"
id="linearGradient8143">
<stop
style="stop-color:#840000;stop-opacity:1;"
offset="0"
id="stop8145" />
<stop
style="stop-color:#840000;stop-opacity:0;"
offset="1"
id="stop8147" />
</linearGradient>
<linearGradient
id="linearGradient8123">
<stop
style="stop-color:#a90000;stop-opacity:1;"
offset="0"
id="stop8125" />
<stop
style="stop-color:#5c0000;stop-opacity:0"
offset="1"
id="stop8127" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient8143"
id="linearGradient8149"
x1="259.28571"
y1="464.12531"
x2="259.28571"
y2="495.21841"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="375"
inkscape:cy="520"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:window-width="1430"
inkscape:window-height="880"
inkscape:window-x="0"
inkscape:window-y="0" />
<metadata
id="metadata1901">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1">
<path
sodipodi:type="arc"
style="opacity:1;fill:#e9c29a;fill-opacity:1;fill-rule:nonzero;stroke:black;stroke-width:2.01703691;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path1904"
sodipodi:cx="269.28571"
sodipodi:cy="500.21933"
sodipodi:rx="30.714285"
sodipodi:ry="82.14286"
d="M 299.99999,500.21933 A 30.714285,82.14286 0 1 1 299.98822,497.94507"
sodipodi:start="0"
sodipodi:end="6.2554951"
sodipodi:open="true"
transform="matrix(2.232014,0,0,0.991101,-340.3352,-67.69137)" />
<path
style="fill:#3d1512;fill-opacity:1;fill-rule:evenodd;stroke:black;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="M 258.57143,346.6479 C 252.5,346.11218 262.85714,352.36218 251.42857,372.36218 C 240,392.36218 227.14285,392.36219 212.85714,405.21933 C 198.57142,418.07647 188.57143,433.79075 190,439.50504 C 191.42857,445.21933 208.57142,479.50504 214.28571,490.93361 C 220,502.36218 230,522.36218 220,532.36218 C 210,542.36218 169.99999,545.21933 167.14285,550.93361 C 164.2857,556.6479 182.14287,552.36217 179.28572,573.79075 C 176.42858,595.21933 165.71429,588.07648 160,595.21933 C 154.28571,602.36218 172.85714,583.79075 171.42857,573.79075 C 170,563.79075 151.29718,564.48058 154.28572,548.79075 C 157.14285,533.79075 165.71429,536.6479 180,518.07647 C 194.28571,499.50504 147.85714,454.50503 150,423.79075 C 152.09327,393.78726 179.28571,380.21933 191.42857,349.50504 C 203.3276,319.40749 221.42857,305.21933 238.57143,310.93361 C 254.86278,316.36406 248.57143,336.6479 260,330.93361 C 271.42857,325.21933 321.42857,305.21933 331.42857,328.07647 C 341.42857,350.93361 336.29,391.36011 345.71429,410.93361 C 355.00001,430.21932 336.06633,465.57137 348.57143,478.07647 C 361.42857,490.93361 374.28572,479.50504 385.71429,496.6479 C 396.59397,512.96742 385.71429,543.79075 384.28571,556.6479 C 382.85713,569.50505 391.78571,588.43362 387.14286,586.6479 C 382.5,584.86219 367.14287,572.36218 365.71429,549.50504 C 364.28571,526.6479 358.57143,520.93361 337.14286,509.50504 C 315.71429,498.07647 304.28571,493.79075 308.57143,476.6479 C 312.85715,459.50504 327.14286,448.07647 327.14286,438.07647 C 327.14286,428.07647 327.14286,395.21933 320,382.36218 C 312.85714,369.50504 310,386.6479 294.28571,376.6479 C 278.57142,366.6479 264.64286,347.18361 258.57143,346.6479 z "
id="path2801"
sodipodi:nodetypes="czzzzzzzzzzzzzzzzzzzzzzzzzzzz" />
<path
sodipodi:type="arc"
style="opacity:1;fill:black;fill-opacity:1;fill-rule:nonzero;stroke:black;stroke-width:3.08630443;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path2803"
sodipodi:cx="231.42857"
sodipodi:cy="418.79074"
sodipodi:rx="11.428572"
sodipodi:ry="10.714286"
d="M 242.85715,418.79074 A 11.428572,10.714286 0 1 1 242.85276,418.4941"
sodipodi:start="0"
sodipodi:end="6.2554951"
sodipodi:open="true"
transform="matrix(1.001264,0.426277,-0.389409,0.914668,160.2883,-62.91627)" />
<path
sodipodi:type="arc"
style="opacity:1;fill:black;fill-opacity:1;fill-rule:nonzero;stroke:black;stroke-width:2.66726732;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path2805"
sodipodi:cx="295"
sodipodi:cy="418.79074"
sodipodi:rx="10.714286"
sodipodi:ry="9.2857141"
d="M 305.71429,418.79074 A 10.714286,9.2857141 0 1 1 305.71018,418.53365"
sodipodi:start="0"
sodipodi:end="6.2554951"
sodipodi:open="true"
transform="matrix(1.052737,-0.37001,0.375921,1.069555,-86.56111,-22.83306)" />
<path
sodipodi:type="arc"
style="opacity:1;fill:url(#linearGradient8149);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:5.4000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path2807"
sodipodi:cx="259.28571"
sodipodi:cy="473.07648"
sodipodi:rx="19.285715"
sodipodi:ry="9.2857141"
d="M 266.21781,464.41135 A 19.285715,9.2857141 0 1 1 254.15574,464.12529 L 259.28571,473.07648 z"
sodipodi:start="5.0800591"
sodipodi:end="10.726335"
transform="matrix(0.718883,0,0,0.444539,75.74658,269.6546)" />
<g
id="g8151"
transform="translate(159.2857,-57.85714)">
<path
transform="translate(-1.428571,-4.285716)"
sodipodi:open="true"
sodipodi:end="6.2554951"
sodipodi:start="0"
d="M 304.28571,424.86218 A 11.785714,8.9285717 0 1 1 304.2812,424.61498"
sodipodi:ry="8.9285717"
sodipodi:rx="11.785714"
sodipodi:cy="424.86218"
sodipodi:cx="292.5"
id="path6349"
style="opacity:1;fill:#fff3ff;fill-opacity:1;fill-rule:nonzero;stroke:black;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
sodipodi:type="arc" />
<path
transform="translate(-61.78572,-3.928571)"
sodipodi:open="true"
sodipodi:end="6.2554951"
sodipodi:start="0"
d="M 304.28571,424.86218 A 11.785714,8.9285717 0 1 1 304.2812,424.61498"
sodipodi:ry="8.9285717"
sodipodi:rx="11.785714"
sodipodi:cy="424.86218"
sodipodi:cx="292.5"
id="path7236"
style="opacity:1;fill:#fff3ff;fill-opacity:1;fill-rule:nonzero;stroke:black;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
sodipodi:type="arc" />
<path
transform="translate(-1.428571,-1.428571)"
sodipodi:end="10.726335"
sodipodi:start="5.0800591"
d="M 234.16884,417.69635 A 4.6428571,5 0 1 1 231.26501,417.54232 L 232.5,422.36218 z"
sodipodi:ry="5"
sodipodi:rx="4.6428571"
sodipodi:cy="422.36218"
sodipodi:cx="232.5"
id="path8137"
style="opacity:1;fill:#840000;fill-opacity:1;fill-rule:nonzero;stroke:#5c0000;stroke-width:5.4000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0"
sodipodi:type="arc" />
<path
transform="translate(58.21429,-1.519172)"
sodipodi:end="10.726335"
sodipodi:start="5.0800591"
d="M 234.16884,417.69635 A 4.6428571,5 0 1 1 231.26501,417.54232 L 232.5,422.36218 z"
sodipodi:ry="5"
sodipodi:rx="4.6428571"
sodipodi:cy="422.36218"
sodipodi:cx="232.5"
id="path8139"
style="opacity:1;fill:#840000;fill-opacity:1;fill-rule:nonzero;stroke:#5c0000;stroke-width:5.4000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0"
sodipodi:type="arc" />
</g>
<path
sodipodi:type="arc"
style="opacity:1;fill:black;fill-opacity:1;fill-rule:nonzero;stroke:black;stroke-width:3.08630443;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path8175"
sodipodi:cx="231.42857"
sodipodi:cy="418.79074"
sodipodi:rx="11.428572"
sodipodi:ry="10.714286"
d="M 242.85715,418.79074 A 11.428572,10.714286 0 1 1 242.85276,418.4941"
sodipodi:start="0"
sodipodi:end="6.2554951"
sodipodi:open="true"
transform="matrix(-1.001264,0.426277,0.389409,0.914668,357.2129,-62.91641)" />
</g>
</svg>
......@@ -792,7 +792,6 @@ src/ballcatch-activity/resources/ballcatch/Makefile
src/canal_lock-activity/activity/Makefile
src/canal_lock-activity/Makefile
src/canal_lock-activity/resources/Makefile
src/canal_lock-activity/resources/canal_Makefile
src/canal_lock-activity/resources/canal_lock/Makefile
src/memory_add_minus-activity/activity/Makefile
src/memory_add_minus-activity/Makefile
......
......@@ -15,11 +15,12 @@ all: $(doc)
# FIXME: Is it possible to have I18N info files installed ?
#info_TEXINFOS = gcompris.texi
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(gcompris_helpdir)
$(INSTALL_DATA) gcompris.html $(DESTDIR)$(gcompris_helpdir)
$(INSTALL_DATA) $(srcdir)/overview.jpg $(DESTDIR)$(gcompris_helpdir)
$(INSTALL_DATA) $(srcdir)/topic.dat $(DESTDIR)$(gcompris_helpdir)
# No more install the documentation, it's not accurate enough
#install-data-local:
# $(mkinstalldirs) $(DESTDIR)$(gcompris_helpdir)
# $(INSTALL_DATA) gcompris.html $(DESTDIR)$(gcompris_helpdir)
# $(INSTALL_DATA) $(srcdir)/overview.jpg $(DESTDIR)$(gcompris_helpdir)
# $(INSTALL_DATA) $(srcdir)/topic.dat $(DESTDIR)$(gcompris_helpdir)
%.html: %.texi
texi2html -monolithic $<
......
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = advanced_colors.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = algebra_by.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = algebra_guesscount.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = algebra_minus.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = algebra_plus.svg
SUBDIRS = activity
pythondir = \$(PYTHON_PLUGIN_DIR)
pythondir = $(PYTHON_PLUGIN_DIR)
dist_python_DATA= anim.py
......
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = anim.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = awele.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = babymatch.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = babyshapes.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = ballcatch.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = bargame.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = foot.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = canal_lock.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = chat.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = chess_computer.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = chess_movelearn.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = chess_partyend.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = chronos.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = click_on_letter.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = clickanddraw.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = clickgame.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = clockgame.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = colors.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = connect4.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = crane.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = doubleentry.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = draw.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = drawnumber.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = electric.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = enumerate.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = erase.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = erase_clic.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = fifteen.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = followline.svg
......@@ -133,7 +133,6 @@ static gchar *popt_user_dir = NULL;
static gint popt_experimental = FALSE;
static gint popt_no_quit = FALSE;
static gint popt_no_config = FALSE;
static gint popt_display_resource = FALSE;
static gchar *popt_server = NULL;
static gint *popt_web_only = NULL;
static gchar *popt_cache_dir = NULL;
......@@ -218,13 +217,6 @@ static GOptionEntry options[] = {
{"disable-config",'\0', 0, G_OPTION_ARG_NONE, &popt_no_config,
N_("Disable the config button"), NULL},
#if 0 /* Never completed, this option means we should document resources
of each activities which is boring to do */
{"display-resource",'\0', 0, G_OPTION_ARG_NONE, &popt_display_resource,
N_("Display the resources on stdout based on the selected activities"), NULL},
#endif
{"server", '\0', 0, G_OPTION_ARG_STRING, &popt_server,
N_("GCompris will get images, sounds and activity data from this server if not found locally."), NULL},
......@@ -1218,6 +1210,51 @@ start_bg_music (gchar *file)
gc_sound_bg_reopen();
}
/* Single instance Check */
static void
single_instance_check()
{
lock_file = g_strdup_printf("%s/%s", properties->config_dir, GC_LOCK_FILE);
if(!popt_nolockcheck)
{
GTimeVal current_time;
g_get_current_time(&current_time);
if (g_file_test (lock_file, G_FILE_TEST_EXISTS))
{
char *result;
gsize length;
glong seconds;
/* Read it's content */
g_file_get_contents(lock_file,
&result,
&length,
NULL);
sscanf(result, "%ld", &seconds);
if(current_time.tv_sec - seconds < GC_LOCK_LIMIT)
{
printf(_("GCompris won't start because the lock file is less than %d seconds old.\n"),
GC_LOCK_LIMIT);
printf(_("The lock file is: %s\n"),
lock_file);
exit(0);
}
}
{
/* Update the date in it (in seconds) */
char date_str[64];
sprintf(date_str, "%ld", current_time.tv_sec);
g_file_set_contents(lock_file,
date_str,
strlen(date_str),
NULL);
}
}
g_free(lock_file);
}
/*****************************************
* Main
*
......@@ -1304,47 +1341,6 @@ main (int argc, char *argv[])
*/
gc_prop_load(properties, GC_PROP_FROM_SYSTEM_CONF);
/* Single instance Check */
lock_file = g_strdup_printf("%s/%s", properties->config_dir, GC_LOCK_FILE);
if(!popt_nolockcheck)
{
GTimeVal current_time;
g_get_current_time(&current_time);
if (g_file_test (lock_file, G_FILE_TEST_EXISTS))
{
char *result;
gsize length;
glong seconds;
/* Read it's content */
g_file_get_contents(lock_file,
&result,
&length,
NULL);
sscanf(result, "%ld", &seconds);
if(current_time.tv_sec - seconds < GC_LOCK_LIMIT)
{
printf(_("GCompris won't start because the lock file is less than %d seconds old.\n"),
GC_LOCK_LIMIT);
printf(_("The lock file is: %s\n"),
lock_file);
exit(0);
}
}
{
/* Update the date in it (in seconds) */
char date_str[64];
sprintf(date_str, "%ld", current_time.tv_sec);
g_file_set_contents(lock_file,
date_str,
strlen(date_str),
NULL);
}
}
g_free(lock_file);
/* Set the locale */
#if defined WIN32
gc_user_default_locale = g_win32_getlocale();
......@@ -1660,21 +1656,13 @@ main (int argc, char *argv[])
}
g_list_free(profile_list);
exit(0);
}
/* An alternate profile is requested, check it does exists */
if (popt_display_resource){
properties->display_resource = TRUE;
properties->reread_menu = TRUE;
printf("Resources for selected activities (as selected by gcompris --administration):\n");
gc_menu_load();
exit(0);
}
/*------------------------------------------------------------*/
single_instance_check();
gc_skin_load(properties->skin);
if(properties->music || properties->fx)
......
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = globe.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = gletters.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = gnumch-equal.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = gnumch-factors.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@
CLEANFILES = $(xml_DATA)
EXTRA_DIST = gnumch-inequal.svg
......@@ -18,3 +18,5 @@ $(xml_DATA): %.xml: %.xml.in
#@INTLTOOL_XML_RULE@