Commit 25b492fc authored by Xavier de Blas's avatar Xavier de Blas

0.6.2.9 (0.7 pre-release)

	db changed to 0.56
	Main window to 800x600

	No more use of terminal:
	-installjammer creates the executables for not being run on terminal (
	it seems can do the other way, but it's better to forget terminal now)
	Logs (new class):
	-Every Console.Write* now writes also to a file using Log.Write*
	-If chronojump crashes, at next start it points to the log of standard
	output and error log (crash trace) because it's called in linux
	redirecting error to samefile with '>>' see chronojump.sh
	mono chronojump.prg $LOG_DATE 2>>$LOG_FILE
	Pending see how to do it in windows (play with .bat file)
	-If chronojump ends ok, log is deleted
	-All Console calls to Log (except askContinueChronojump) use
	string.Format for send only one argument to Log.Write*

	New start (all without terminal):
	-if crashed before, show error window and continues with normal start
	when user closes window
	-if big problm appears, show error window and quit when user closes
	window
	-if all is ok, start normal
	-now no more control of chronojump execution two times
	-added a button for crash voluntary for testing purposes

	Done default session sport, speciallity, level:
	-creation of combos at gui/session
	-hide/show combos depending on radios
	-print label depending on combos
	-sensitive or not accept button depending on widgets
	-add sport done
	-session is recorded with sport stuff
	-shown/manage default values at gui/person add (are required)
	-shown/manage default values to add multiple (printing a label)
	-show person stuff at export, report
	-show person stuff at load session 
	-Level "Sedentary" changed to "Sedentary/Ocasional practice"
	now when selected, sport none is not automatically selected.

	dateBorn: 
	-on new person is undefined until they change it they cannot accept
	-on new person multiple is undefined and value its 01/01/0001 (DateTime.MinValue)

	Other:
	-Simulated execution shows two warning images
	-genericWin has a range selectable range for spinbutton
	-improved report: css and logo now as files (logo also as assemblie).
	-Fixes bug with stream copy. Done also on installjammer
	-Session add & edit in same class
	-Improved database moving
	-Fixed bug with path readed by script convert_database.sh (since installjammer)
	-at installjammer added readme_update_version.txt, readable with it's own component
	-Fixed bug with dates on data from really old chronojump versions


svn path=/trunk/; revision=383
parent ccf4b75b
......@@ -45,7 +45,7 @@ CHRONOJUMP_DEP_EXECUTE = src/execute/event.cs src/execute/jump.cs src/execute/ru
CHRONOJUMP_DEP_SERVER = chronojump_server/ChronojumpServer.cs
CHRONOJUMP_DEP = src/chronojump.cs src/person.cs src/event.cs src/eventType.cs src/jump.cs src/jumpType.cs src/run.cs src/runType.cs src/pulse.cs src/pulseType.cs src/reactionTime.cs src/reactionTimeType.cs src/session.cs src/exportSession.cs src/treeViewEvent.cs src/treeViewPerson.cs src/treeViewJump.cs src/treeViewRun.cs src/treeViewPulse.cs src/treeViewReactionTime.cs src/util.cs src/utilGtk.cs src/constants.cs src/report.cs src/updateProgressBar.cs src/prepareEventGraphObjects.cs src/sport.cs $(CHRONOJUMP_DEP_GUI) $(CHRONOJUMP_DEP_STATS) $(CHRONOJUMP_DEP_GRAPHS) $(CHRONOJUMP_DEP_SQLITE) $(CHRONOJUMP_DEP_REPORT) $(CHRONOJUMP_DEP_EXECUTE) $(CHRONOJUMP_DEP_SERVER)
CHRONOJUMP_DEP = src/chronojump.cs src/person.cs src/event.cs src/eventType.cs src/jump.cs src/jumpType.cs src/run.cs src/runType.cs src/pulse.cs src/pulseType.cs src/reactionTime.cs src/reactionTimeType.cs src/session.cs src/exportSession.cs src/treeViewEvent.cs src/treeViewPerson.cs src/treeViewJump.cs src/treeViewRun.cs src/treeViewPulse.cs src/treeViewReactionTime.cs src/util.cs src/utilGtk.cs src/constants.cs src/report.cs src/updateProgressBar.cs src/prepareEventGraphObjects.cs src/sport.cs src/log.cs $(CHRONOJUMP_DEP_GUI) $(CHRONOJUMP_DEP_STATS) $(CHRONOJUMP_DEP_GRAPHS) $(CHRONOJUMP_DEP_SQLITE) $(CHRONOJUMP_DEP_REPORT) $(CHRONOJUMP_DEP_EXECUTE) $(CHRONOJUMP_DEP_SERVER)
RESOURCES_GLADE = -resource:glade/chronojump.glade,chronojump.glade
......@@ -86,8 +86,10 @@ RESOURCES_IMAGES = -resource:images/mini/no_image.png,mini/no_image.png \
-resource:images/gtk-zoom-in.png,gtk-zoom-in.png \
-resource:images/gtk-zoom-in-with-text.png,gtk-zoom-in-with-text.png \
#logo is included as assemblie and as a file (with create_release.sh and installjammer)
#report_web_style.css only as a file (there were problems when copying into file at report with stream)
RESOURCES_REPORT = -resource:images/chronojump_logo.png,chronojump_logo.png \
-resource:images/report_web_style.css,report_web_style.css \
#-resource:images/report_web_style.css,report_web_style.css \
CHRONOJUMP_LIB = -pkg:gtk-sharp-2.0 -pkg:glade-sharp-2.0 -r:System.Data -r:Mono.Data.Sqlite -r:System.Web.Services
......@@ -96,7 +98,7 @@ NPLOT_LIBS = build/data/linux_dlls
#--------Dependences of CHRONOJUMP_MINI
CHRONOJUMP_MINI_DEP = src/chronojump_mini.cs src/chronopic.cs src/util.cs src/constants.cs
CHRONOJUMP_MINI_DEP = src/chronojump_mini.cs src/chronopic.cs src/util.cs src/log.cs src/constants.cs
#CHRONOJUMP_MINI_VALIDATE_DEP = src/chronojump_mini_validate.cs src/chronopic.cs src/util.cs src/constants.cs
#--------Dependences of CHRONOJUMP_SERVER
......
......@@ -51,4 +51,10 @@ fi
echo "---------------"
echo "3d: call Chronojump"
cd ../data
mono chronojump.prg
#pass LOG_FILE (same format as in src/log.cs)
LOG_DATE=`date +%d-%m-%Y_%H-%M-%S`
LOG_FILE="../../logs/chronojump_log-$LOG_DATE.txt"
#call program redirecting to a file the standard output and the error aoutput at end
mono chronojump.prg $LOG_DATE 2>>$LOG_FILE
CHRONOJUMP DETAILED CHANGELOG:
10 May 2008
0.6.2.9 (0.7 pre-release)
db changed to 0.56
Main window to 800x600
No more use of terminal:
-installjammer creates the executables for not being run on terminal (
it seems can do the other way, but it's better to forget terminal now)
Logs (new class):
-Every Console.Write* now writes also to a file using Log.Write*
-If chronojump crashes, at next start it points to the log of standard
output and error log (crash trace) because it's called in linux
redirecting error to samefile with '>>' see chronojump.sh
mono chronojump.prg $LOG_DATE 2>>$LOG_FILE
Pending see how to do it in windows (play with .bat file)
-If chronojump ends ok, log is deleted
-All Console calls to Log (except askContinueChronojump) use
string.Format for send only one argument to Log.Write*
New start (all without terminal):
-if crashed before, show error window and continues with normal start
when user closes window
-if big problm appears, show error window and quit when user closes
window
-if all is ok, start normal
-now no more control of chronojump execution two times
-added a button for crash voluntary for testing purposes
Done default session sport, speciallity, level:
-creation of combos at gui/session
-hide/show combos depending on radios
-print label depending on combos
-sensitive or not accept button depending on widgets
-add sport done
-session is recorded with sport stuff
-shown/manage default values at gui/person add (are required)
-shown/manage default values to add multiple (printing a label)
-show person stuff at export, report
-show person stuff at load session
-Level "Sedentary" changed to "Sedentary/Ocasional practice"
now when selected, sport none is not automatically selected.
dateBorn:
-on new person is undefined until they change it they cannot accept
-on new person multiple is undefined and value its 01/01/0001 (DateTime.MinValue)
Other:
-Simulated execution shows two warning images
-genericWin has a range selectable range for spinbutton
-improved report: css and logo now as files (logo also as assemblie).
-Fixes bug with stream copy. Done also on installjammer
-Session add & edit in same class
-Improved database moving
-Fixed bug with path readed by script convert_database.sh (since installjammer)
-at installjammer added readme_update_version.txt, readable with it's own component
-Fixed bug with dates on data from really old chronojump versions
23 apr 2008
Fixed bug in personAddMultiple when it's different than 10
Fixed bug in export to CSV (decimals were 0)
......
......@@ -112,12 +112,17 @@ int chronopic_get_trama_cambio(int fd, double *t, int *estado)
//-- Timeout o algun error en recepcion
if (n!=1) return n;
//printf("%c-%c-%c-%c-%c",trama[0], trama[1], trama[2], trama[3], trama[4]);
//printf("%d-%d-%d-%d-%d",trama[0], trama[1], trama[2], trama[3], trama[4]);
printf("%c-%d-%d-%d-%d",trama[0], trama[1], trama[2], trama[3], trama[4]);
printf("%f", (trama[2]*65536 + trama[3]*256 + trama[4])*8)/1000);
//-- Analizar si es una trama de cambio
if (trama[0]!='X') {
printf ("Error. Trama desconocida\n");
return -1;
}
//-- Obtener el estado
if (trama[1]!=0 && trama[1]!=1) {
printf ("Error. Estado no valido\n");
......@@ -132,6 +137,8 @@ int chronopic_get_trama_cambio(int fd, double *t, int *estado)
//-- por 8 para obtenerlo en microseungos. Finalmente hay que dividirlo
//-- entre 1000 para obtenerlo en milisegundos.
*t = (double)((trama[2]*65536 + trama[3]*256 + trama[4])*8)/1000;
printf ("%f", t);
return 1;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -3509,3 +3509,223 @@
04/16/08 10:33:45 - Windows build completed in 00m13s.
04/16/08 10:33:45 - Installer size is 78.41 MB.
04/16/08 10:33:45 - Build completed in 00m17s.
05/09/08 04:25:34 - Building message catalogs...
05/09/08 04:25:34 - Building Linux x86 install...
05/09/08 04:25:34 - Building main.tcl...
05/09/08 04:25:34 - Refreshing file groups...
05/09/08 04:25:35 - Getting file list...
05/09/08 04:25:36 - Building file manifest...
05/09/08 04:25:36 - Saving install information...
05/09/08 04:25:37 - Building install...
05/09/08 04:25:37 - Wrapping install files...
05/09/08 04:25:39 - Linux x86 build completed in 00m05s.
05/09/08 04:25:39 - Installer size is 7.58 MB.
05/09/08 04:25:39 - Building Windows install...
05/09/08 04:25:39 - Building main.tcl...
05/09/08 04:25:39 - Refreshing file groups...
05/09/08 04:25:40 - Getting file list...
05/09/08 04:25:41 - Building file manifest...
05/09/08 04:25:41 - Saving install information...
05/09/08 04:25:42 - Building install...
05/09/08 04:25:42 - Wrapping install files...
05/09/08 04:26:01 - Windows build completed in 00m22s.
05/09/08 04:26:01 - Installer size is 78.57 MB.
05/09/08 04:26:01 - Build completed in 00m27s.
05/09/08 04:30:12 - Building message catalogs...
05/09/08 04:30:12 - Building Linux x86 install...
05/09/08 04:30:12 - Building main.tcl...
05/09/08 04:30:12 - Refreshing file groups...
05/09/08 04:30:13 - Getting file list...
05/09/08 04:30:13 - Building file manifest...
05/09/08 04:30:13 - Saving install information...
05/09/08 04:30:14 - Building install...
05/09/08 04:30:15 - Wrapping install files...
05/09/08 04:30:17 - Linux x86 build completed in 00m05s.
05/09/08 04:30:17 - Installer size is 7.58 MB.
05/09/08 04:30:17 - Building Windows install...
05/09/08 04:30:17 - Building main.tcl...
05/09/08 04:30:17 - Refreshing file groups...
05/09/08 04:30:17 - Getting file list...
05/09/08 04:30:18 - Building file manifest...
05/09/08 04:30:18 - Saving install information...
05/09/08 04:30:19 - Building install...
05/09/08 04:30:19 - Wrapping install files...
05/09/08 04:30:31 - Windows build completed in 00m14s.
05/09/08 04:30:31 - Installer size is 78.57 MB.
05/09/08 04:30:31 - Build completed in 00m19s.
05/09/08 04:33:47 - Building message catalogs...
05/09/08 04:33:47 - Building Linux x86 install...
05/09/08 04:33:47 - Building main.tcl...
05/09/08 04:33:47 - Refreshing file groups...
05/09/08 04:33:48 - Getting file list...
05/09/08 04:33:48 - Building file manifest...
05/09/08 04:33:48 - Saving install information...
05/09/08 04:33:49 - Building install...
05/09/08 04:33:50 - Wrapping install files...
05/09/08 04:33:52 - Linux x86 build completed in 00m05s.
05/09/08 04:33:52 - Installer size is 7.58 MB.
05/09/08 04:33:52 - Building Windows install...
05/09/08 04:33:52 - Building main.tcl...
05/09/08 04:33:52 - Refreshing file groups...
05/09/08 04:33:52 - Getting file list...
05/09/08 04:33:53 - Building file manifest...
05/09/08 04:33:53 - Saving install information...
05/09/08 04:33:54 - Building install...
05/09/08 04:33:54 - Wrapping install files...
05/09/08 04:34:06 - Windows build completed in 00m14s.
05/09/08 04:34:06 - Installer size is 78.57 MB.
05/09/08 04:34:06 - Build completed in 00m19s.
05/09/08 04:34:49 - Building message catalogs...
05/09/08 04:34:49 - Building Linux x86 install...
05/09/08 04:34:49 - Building main.tcl...
05/09/08 04:34:49 - Refreshing file groups...
05/09/08 04:34:49 - Getting file list...
05/09/08 04:34:50 - Building file manifest...
05/09/08 04:34:50 - Saving install information...
05/09/08 04:34:51 - Building install...
05/09/08 04:34:51 - Wrapping install files...
05/09/08 04:34:54 - Linux x86 build completed in 00m05s.
05/09/08 04:34:54 - Installer size is 7.58 MB.
05/09/08 04:34:54 - Building Windows install...
05/09/08 04:34:54 - Building main.tcl...
05/09/08 04:34:54 - Refreshing file groups...
05/09/08 04:34:54 - Getting file list...
05/09/08 04:34:55 - Building file manifest...
05/09/08 04:34:55 - Saving install information...
05/09/08 04:34:56 - Building install...
05/09/08 04:34:56 - Wrapping install files...
05/09/08 04:35:07 - Windows build completed in 00m13s.
05/09/08 04:35:07 - Installer size is 78.57 MB.
05/09/08 04:35:07 - Build completed in 00m18s.
05/09/08 04:45:36 - Building message catalogs...
05/09/08 04:45:36 - Building Linux x86 install...
05/09/08 04:45:36 - Building main.tcl...
05/09/08 04:45:36 - Refreshing file groups...
05/09/08 04:45:36 - Getting file list...
05/09/08 04:45:37 - Building file manifest...
05/09/08 04:45:37 - Saving install information...
05/09/08 04:45:38 - Building install...
05/09/08 04:45:38 - Wrapping install files...
05/09/08 04:45:40 - Linux x86 build completed in 00m04s.
05/09/08 04:45:40 - Installer size is 7.58 MB.
05/09/08 04:45:40 - Building Windows install...
05/09/08 04:45:40 - Building main.tcl...
05/09/08 04:45:40 - Refreshing file groups...
05/09/08 04:45:40 - Getting file list...
05/09/08 04:45:41 - Building file manifest...
05/09/08 04:45:41 - Saving install information...
05/09/08 04:45:42 - Building install...
05/09/08 04:45:42 - Wrapping install files...
05/09/08 04:45:54 - Windows build completed in 00m14s.
05/09/08 04:45:54 - Installer size is 78.57 MB.
05/09/08 04:45:54 - Build completed in 00m18s.
05/09/08 10:34:44 - Building message catalogs...
05/09/08 10:34:44 - Building Linux x86 install...
05/09/08 10:34:44 - Building main.tcl...
05/09/08 10:34:44 - Refreshing file groups...
05/09/08 10:34:45 - Getting file list...
05/09/08 10:34:45 - Building file manifest...
05/09/08 10:34:46 - Saving install information...
05/09/08 10:34:47 - Building install...
05/09/08 10:34:47 - Wrapping install files...
05/09/08 10:34:52 - Linux x86 build completed in 00m08s.
05/09/08 10:34:52 - Installer size is 7.58 MB.
05/09/08 10:34:52 - Building Windows install...
05/09/08 10:34:52 - Building main.tcl...
05/09/08 10:34:52 - Refreshing file groups...
05/09/08 10:34:53 - Getting file list...
05/09/08 10:34:54 - Building file manifest...
05/09/08 10:34:54 - Saving install information...
05/09/08 10:34:55 - Building install...
05/09/08 10:34:56 - Wrapping install files...
05/09/08 10:35:28 - Windows build completed in 00m36s.
05/09/08 10:35:28 - Installer size is 78.57 MB.
05/09/08 10:35:28 - Build completed in 00m44s.
05/09/08 10:45:00 - Building message catalogs...
05/09/08 10:45:00 - Building Linux x86 install...
05/09/08 10:45:00 - Building main.tcl...
05/09/08 10:45:00 - Refreshing file groups...
05/09/08 10:45:00 - Getting file list...
05/09/08 10:45:01 - Building file manifest...
05/09/08 10:45:01 - Saving install information...
05/09/08 10:45:02 - Building install...
05/09/08 10:45:03 - Wrapping install files...
05/09/08 10:45:05 - Linux x86 build completed in 00m05s.
05/09/08 10:45:05 - Installer size is 7.58 MB.
05/09/08 10:45:05 - Building Windows install...
05/09/08 10:45:05 - Building main.tcl...
05/09/08 10:45:05 - Refreshing file groups...
05/09/08 10:45:05 - Getting file list...
05/09/08 10:45:06 - Building file manifest...
05/09/08 10:45:06 - Saving install information...
05/09/08 10:45:07 - Building install...
05/09/08 10:45:07 - Wrapping install files...
05/09/08 10:45:21 - Windows build completed in 00m16s.
05/09/08 10:45:21 - Installer size is 78.57 MB.
05/09/08 10:45:21 - Build completed in 00m21s.
05/09/08 11:00:17 - Building message catalogs...
05/09/08 11:00:17 - Building Linux x86 install...
05/09/08 11:00:17 - Building main.tcl...
05/09/08 11:00:17 - Refreshing file groups...
05/09/08 11:00:18 - Getting file list...
05/09/08 11:00:19 - Building file manifest...
05/09/08 11:00:19 - Saving install information...
05/09/08 11:00:20 - Building install...
05/09/08 11:00:20 - Wrapping install files...
05/09/08 11:00:23 - Linux x86 build completed in 00m06s.
05/09/08 11:00:23 - Installer size is 7.58 MB.
05/09/08 11:00:23 - Building Windows install...
05/09/08 11:00:23 - Building main.tcl...
05/09/08 11:00:23 - Refreshing file groups...
05/09/08 11:00:23 - Getting file list...
05/09/08 11:00:24 - Building file manifest...
05/09/08 11:00:24 - Saving install information...
05/09/08 11:00:25 - Building install...
05/09/08 11:00:25 - Wrapping install files...
05/09/08 11:00:37 - Windows build completed in 00m14s.
05/09/08 11:00:37 - Installer size is 78.57 MB.
05/09/08 11:00:37 - Build completed in 00m20s.
05/10/08 01:58:40 - Building message catalogs...
05/10/08 01:58:40 - Building Linux x86 install...
05/10/08 01:58:40 - Building main.tcl...
05/10/08 01:58:40 - Refreshing file groups...
05/10/08 01:58:41 - Getting file list...
05/10/08 01:58:42 - Building file manifest...
05/10/08 01:58:42 - Saving install information...
05/10/08 01:58:43 - Building install...
05/10/08 01:58:43 - Wrapping install files...
05/10/08 01:58:45 - Linux x86 build completed in 00m05s.
05/10/08 01:58:45 - Installer size is 5.94 MB.
05/10/08 01:58:45 - Building Windows install...
05/10/08 01:58:45 - Building main.tcl...
05/10/08 01:58:45 - Refreshing file groups...
05/10/08 01:58:45 - Getting file list...
05/10/08 01:58:46 - Building file manifest...
05/10/08 01:58:46 - Saving install information...
05/10/08 01:58:47 - Building install...
05/10/08 01:58:47 - Wrapping install files...
05/10/08 01:58:58 - Windows build completed in 00m13s.
05/10/08 01:58:58 - Installer size is 76.93 MB.
05/10/08 01:58:58 - Build completed in 00m18s.
05/10/08 02:23:43 - Building message catalogs...
05/10/08 02:23:43 - Building Linux x86 install...
05/10/08 02:23:43 - Building main.tcl...
05/10/08 02:23:43 - Refreshing file groups...
05/10/08 02:23:44 - Getting file list...
05/10/08 02:23:45 - Building file manifest...
05/10/08 02:23:45 - Saving install information...
05/10/08 02:23:46 - Building install...
05/10/08 02:23:46 - Wrapping install files...
05/10/08 02:23:49 - Linux x86 build completed in 00m06s.
05/10/08 02:23:49 - Installer size is 8.42 MB.
05/10/08 02:23:49 - Building Windows install...
05/10/08 02:23:49 - Building main.tcl...
05/10/08 02:23:49 - Refreshing file groups...
05/10/08 02:23:49 - Getting file list...
05/10/08 02:23:50 - Building file manifest...
05/10/08 02:23:50 - Saving install information...
05/10/08 02:23:51 - Building install...
05/10/08 02:23:52 - Wrapping install files...
05/10/08 02:24:08 - Windows build completed in 00m19s.
05/10/08 02:24:08 - Installer size is 79.41 MB.
05/10/08 02:24:08 - Build completed in 00m25s.
This diff is collapsed.
How to update version with installJammer:
-create_release.sh
at installjammer:
-Application information:
+change install version
+change version string
-Groups and files:
+add new release dir
+delete old release dir
+fix new release dir:
-uncheck svn dirs (better not for not confusing and losing time)
-uncheck tar.gz, zip and readme
-write an alias for linux/findMonoVersion.sh: "findMonoVersionLinux" (remember to press 'Enter')
if want to update some files but not version, it needs also to create_release.sh because files copied will be the found on release dir and not in build dir.
Then do the create_release.sh if you don't put the version, it will suggest version found in version.txt, but delete first the release dir of that version because, if not, create_release will not copy anything)
but this is an OBSCURE method that should'nt be used. a new version name is the correct thing
......@@ -28,8 +28,10 @@ src/jumpType.cs
src/platform.cs
src/report.cs
src/runType.cs
src/sqlite/personSession.cs
src/sqlite/speciallity.cs
src/sqlite/sport.cs
src/sqlite/session.cs
src/sqlite/stat.cs
src/statType.cs
src/stats/potency.cs
......
......@@ -35,6 +35,13 @@ public class ChronoJump
private static string progname = "Chronojump";
private string runningFileName; //useful for knowing if there are two chronojump instances
private string messageToShowOnBoot = "";
private bool chronojumpHasToExit = false;
//isFirstTime we run chronojump in this machine?
//(or is there a DB file?)
private bool isFirstTime = false;
public static void Main(string [] args)
......@@ -45,10 +52,10 @@ public class ChronoJump
public ChronoJump (string [] args)
{
//works on Linux
//Console.WriteLine("lang: {0}", System.Environment.GetEnvironmentVariable("LANG"));
//Console.WriteLine("language: {0}", System.Environment.GetEnvironmentVariable("LANGUAGE"));
bool timeLogPassedOk = Log.Start(args);
Log.WriteLine(string.Format("Time log passed: {0}", timeLogPassedOk.ToString()));
checkIfChronojumpExitAbnormally();
/* SERVER COMMUNICATION TESTS */
/*
......@@ -58,32 +65,29 @@ public class ChronoJump
//example of list a dir in server
string [] myListDir = myServer.ListDirectory("/home");
foreach (string myResult in myListDir)
Console.WriteLine(myResult);
Log.WriteLine(myResult);
Console.WriteLine(myServer.ConnectDatabase());
Log.WriteLine(myServer.ConnectDatabase());
//select name of person with uniqueid 1
Console.WriteLine(myServer.SelectPersonName(1));
Log.WriteLine(myServer.SelectPersonName(1));
}
catch {
Console.WriteLine("Unable to call server");
Log.WriteLine("Unable to call server");
}
*/
/* END OF SERVER COMMUNICATION TESTS */
//print version of chronojump
Log.WriteLine(string.Format("Chronojump version: {0}", readVersion()));
//move database to new location if chronojump version is before 0.7
moveDatabaseToInstallJammerLocationIfNeeded();
checkIfChronojumpExitAbnormally();
Sqlite.Connect();
//isFirstTime we run chronojump in this machine?
//(or is there a DB file?)
bool isFirstTime = false;
//Chech if the DB file exists
if (!Sqlite.CheckTables()) {
Console.WriteLine ( Catalog.GetString ("no tables, creating ...") );
Log.WriteLine ( Catalog.GetString ("no tables, creating ...") );
Sqlite.CreateFile();
File.Create(runningFileName);
Sqlite.CreateTables();
......@@ -94,108 +98,105 @@ public class ChronoJump
Util.BackupDirCreateIfNeeded();
Util.BackupDatabase();
Console.WriteLine ("made a database backup"); //not compressed yet, it seems System.IO.Compression.DeflateStream and
Log.WriteLine ("made a database backup"); //not compressed yet, it seems System.IO.Compression.DeflateStream and
//System.IO.Compression.GZipStream are not in mono
if(! Sqlite.IsSqlite3()) {
bool ok = Sqlite.ConvertFromSqlite2To3();
if (!ok) {
Console.WriteLine("******\n problem with sqlite \n******");
Log.WriteLine("******\n problem with sqlite \n******");
//check (spanish)
//http://mail.gnome.org/archives/chronojump-devel-list/2008-March/msg00011.html
Console.WriteLine(Catalog.GetString("Failed database conversion, ensure you have libsqlite3-0 installed. \nIf problems persist ask in chronojump-list"));
Console.ReadLine();
quitFromConsole();
string errorMessage = Catalog.GetString("Failed database conversion, ensure you have libsqlite3-0 installed. \nIf problems persist ask in chronojump-list");
Log.WriteLine(errorMessage);
messageToShowOnBoot += errorMessage;
chronojumpHasToExit = true;
}
Sqlite.Connect();
}
bool softwareIsNew = Sqlite.ConvertToLastChronojumpDBVersion();
if(! softwareIsNew) {
Console.Clear();
Console.WriteLine (
string.Format(Catalog.GetString ("Sorry, this Chronojump version ({0}) is too old for your database."), readVersion()) + "\n" +
Catalog.GetString("Please update Chronojump") + ":\n" );
Console.WriteLine ( "http://www.gnome.org/projects/chronojump/installation");
Console.WriteLine( "\n\n" + Catalog.GetString("Press any key"));
Console.ReadKey(true);
quitFromConsole();
//Console.Clear();
string errorMessage = string.Format(Catalog.GetString ("Sorry, this Chronojump version ({0}) is too old for your database."), readVersion()) + "\n" +
Catalog.GetString("Please update Chronojump") + ":\n";
errorMessage += "http://www.gnome.org/projects/chronojump/installation";
errorMessage += "\n\n" + Catalog.GetString("Press any key");
Log.WriteLine(errorMessage);
messageToShowOnBoot += errorMessage;
chronojumpHasToExit = true;
}
Console.WriteLine ( Catalog.GetString ("tables already created") );
Log.WriteLine ( Catalog.GetString ("tables already created") );
//check for bad Rjs (activate if program crashes and you use it in the same db before v.0.41)
//SqliteJump.FindBadRjs();
}
string recuperatedString = recuperateBrokenEvents();
messageToShowOnBoot += recuperateBrokenEvents();
//start as "simulated"
SqlitePreferences.Update("simulated", "True", false); //false (dbcon not opened)
//we need to connect sqlite to do the languageChange
//change language works on windows. On Linux let's change the locale
//if(Util.IsWindows())
// languageChange();
Util.IsWindows(); //only as additional info here
Application.Init();
Util.IsWindows(); //only as additional info here
/*
//if firstTime on windows, then ask for the language
if(Util.IsWindows() && isFirstTime) {
//show language dialog (only first time)
LanguageWindow languageWin = LanguageWindow.Show();
languageWin.ButtonAccept.Clicked += new EventHandler(on_language_clicked);
Application.Run();
if(messageToShowOnBoot.Length > 0) {
ErrorWindow errorWin;
if(chronojumpHasToExit) {
messageToShowOnBoot += "\n<b>" + string.Format(Catalog.GetString("Chronojump will exit now.")) + "</b>\n";
errorWin = ErrorWindow.Show(messageToShowOnBoot);
errorWin.Button_accept.Clicked += new EventHandler(on_message_boot_accepted_quit);
Application.Run();
} else {
errorWin = ErrorWindow.Show(messageToShowOnBoot);
errorWin.Button_accept.Clicked += new EventHandler(on_message_boot_accepted_continue);
Application.Run();
}
} else {
*/
chronoJumpWin = new ChronoJumpWindow(recuperatedString, isFirstTime,
authors, readVersion(), progname, runningFileName);
startChronojump();
Application.Run();
/*
}
*/
}
private void on_message_boot_accepted_continue (object o, EventArgs args) {
startChronojump();
}
private void on_message_boot_accepted_quit (object o, EventArgs args) {
try {
File.Delete(runningFileName);
} catch {
//done because if database dir is moved in a chronojump conversion (eg from before installer to installjammer) maybe it will not find this runningFileName
}
Log.End();
Log.Delete();
Application.Quit();
}
private bool askContinueChronojump() {
private void startChronojump() {
chronoJumpWin = new ChronoJumpWindow(isFirstTime, authors, readVersion(), progname, runningFileName);
}
private void chronojumpCrashedBeforeMessage() {
Console.Clear();
Console.WriteLine(Catalog.GetString("Chronojump is already running (program opened two times) or it crashed before"));
Console.WriteLine("\n" +
string.Format(Catalog.GetString("Please, if crashed, write an email to {0} including what you done when Chronojump crashed."), "xaviblas@gmail.com") + "\n" +
Catalog.GetString("Subject should be something like \"bug in Chronojump\". Your help is needed.")
);
bool success = false;
bool launchChronojump = true;
ConsoleKeyInfo myKey;
do {
Console.WriteLine("\n" + Catalog.GetString("Please press key") + ":");
Console.WriteLine("[ Q " + Catalog.GetString("or") + " q ] " +
Catalog.GetString("to exit program if it's already opened"));
Console.WriteLine("[ Y " + Catalog.GetString("or") + " y ] " +
Catalog.GetString("to launch Chronojump"));
myKey = Console.ReadKey(true);
if(myKey.KeyChar == 'Q' || myKey.KeyChar == 'q') {
Console.WriteLine("Quit");
launchChronojump = false;
success = true;
} else if(myKey.KeyChar == 'Y' || myKey.KeyChar == 'y') {
Console.WriteLine("Launch Chronojump");
launchChronojump = true;
success = true;
}
} while (!success);
string errorMessage = "\n" +
string.Format(Catalog.GetString("Chronojump crashed before. Please, <b>write an email</b> to {0} including this file:"), "xaviblas@gmail.com") + "\n\n" +
Log.GetLast() + "\n\n" +
Catalog.GetString("Subject should be something like \"bug in Chronojump\". Your help is needed.") + "\n";
return launchChronojump;
/*
* This are the only outputs to Console. Other's use Log that prints to console and to log file
* this doesn't go to log because it talks about log
*/
Console.WriteLine(errorMessage);
messageToShowOnBoot += errorMessage;
return;
}
//recuperate temp jumpRj or RunI if chronojump hangs
......@@ -239,15 +240,6 @@ public class ChronoJump
return returnString;
}
private void quitFromConsole() {
try {
File.Delete(runningFileName);
} catch {
//done because if database dir is moved in a chronojump conversion (eg from before installer to installjammer) maybe it will not find this runningFileName
}
Environment.Exit(1);
}
private string readVersion() {
string version = "";
try {
......@@ -265,14 +257,11 @@ public class ChronoJump
private void checkIfChronojumpExitAbnormally() {
runningFileName = Util.GetDatabaseDir() + Path.DirectorySeparatorChar + "chronojump_running";
if(File.Exists(runningFileName)) {
bool continueChronojump = askContinueChronojump();
if(!continueChronojump)
quitFromConsole();
} else {
if (Sqlite.CheckTables()) {
if(File.Exists(runningFileName))
chronojumpCrashedBeforeMessage();
else {
if (Sqlite.CheckTables())
File.Create(runningFileName);
}
}
}
......@@ -280,34 +269,84 @@ public class ChronoJump
private void moveDatabaseToInstallJammerLocationIfNeeded() {
string oldDB = Util.GetOldDatabaseDir();
string newDB = Util.GetDatabaseDir();
string problemsMoving = string.Format(Catalog.GetString("Problems moving database from {0} to {1}\n Please, do it manually and the execute Chronojump.\n\n Chronojump will exit."), oldDB, newDB);
if(Directory.Exists(oldDB)) {
//check if there's anything on newDB, and if there's anything move it to a newly created "old" dir
//this doesn't work because there's no Directory.Copy. maybe it's done by File.Copy, ?
//with a move has no sense because it's the same problem (newDB is already created)
/*
if(Directory.Exists(newDB)) {
if(! Directory.Exists(newDB) && Directory.Exists(oldDB)) {
try {
Directory.Move(oldDB, newDB);
}
catch {
string feedback = "";
feedback += string.Format(Catalog.GetString("Cannot move database directory from {0} to {1}"),
oldDB, Path.GetFullPath(newDB)) + "\n";
feedback += string.Format(Catalog.GetString("Trying to move/copy each file now")) + "\n";
int fileMoveProblems = 0;
int fileCopyProblems = 0;
try {
Directory.Copy(newDB, newDB + "-old-" + DateTime.Now.ToString());
Directory.CreateDirectory(newDB);
Directory.CreateDirectory(newDB + Path.DirectorySeparatorChar + "backup");
string [] filesToMove = Directory.GetFiles(oldDB);
foreach (string oldFile in filesToMove) {