chronojump r444 - in trunk: . build/data chronojump_server chronojump_server/bin glade images images/mini sqlite_diagrams src src/gui src/sqlite



Author: xaviblas
Date: Tue Jan 27 17:19:44 2009
New Revision: 444
URL: http://svn.gnome.org/viewvc/chronojump?rev=444&view=rev

Log:
	0.8.1.4
	new src/gui/server.cs with gui of session upload.
	
	thread on server session update

	when user upload a session:
	-session is uploaded
	-person and personSession is uploaded
	-tests are uploaded
	-uploadingState change all the time
	session can be uploaded more times (with new data)
	-checks are done in (if no ok, user should edit): 
	-sports, speciallity, level, weight

	person uploads sport if user defined and not found in server database

	a silent ping is done at start
	added "chronojump" to version on ping
	repetitive conditions not shown at start

	started maria ginà test

	fixed bugs:
	-gui/person (edit) crash on accept because serverUniqueID was unassigned
	-fixed HasWeight bug in jumpType
	-fixed crash on person add/edit when a ' is found



Added:
   trunk/images/mini/mtgug.png   (contents, props changed)
   trunk/images/mtgug.png   (contents, props changed)
   trunk/src/gui/server.cs
Modified:
   trunk/Makefile
   trunk/build/data/chronojump.prg
   trunk/build/data/chronojump_mini.prg
   trunk/build/data/version.txt
   trunk/changelog.txt
   trunk/chronojump_server/ChronojumpServer.cs
   trunk/chronojump_server/bin/chronojumpServer.dll
   trunk/glade/chronojump.glade
   trunk/sqlite_diagrams/chronojump_sqlite.dia
   trunk/src/constants.cs
   trunk/src/event.cs
   trunk/src/eventType.cs
   trunk/src/exportSession.cs
   trunk/src/gui/chronojump.cs
   trunk/src/gui/person.cs
   trunk/src/gui/repetitiveConditions.cs
   trunk/src/gui/session.cs
   trunk/src/jump.cs
   trunk/src/jumpType.cs
   trunk/src/person.cs
   trunk/src/pulse.cs
   trunk/src/reactionTime.cs
   trunk/src/report.cs
   trunk/src/run.cs
   trunk/src/runType.cs
   trunk/src/serverPing.cs
   trunk/src/session.cs
   trunk/src/sport.cs
   trunk/src/sqlite/event.cs
   trunk/src/sqlite/jump.cs
   trunk/src/sqlite/jumpRj.cs
   trunk/src/sqlite/jumpType.cs
   trunk/src/sqlite/main.cs
   trunk/src/sqlite/person.cs
   trunk/src/sqlite/personSession.cs
   trunk/src/sqlite/pulse.cs
   trunk/src/sqlite/reactionTime.cs
   trunk/src/sqlite/run.cs
   trunk/src/sqlite/runInterval.cs
   trunk/src/sqlite/runType.cs
   trunk/src/sqlite/sport.cs
   trunk/src/util.cs
   trunk/version.txt

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	(original)
+++ trunk/Makefile	Tue Jan 27 17:19:44 2009
@@ -33,7 +33,7 @@
 #--------Dependences of CHRONOJUMP
 
 
-CHRONOJUMP_DEP_GUI = src/gui/chronojump.cs src/gui/confirm.cs src/gui/error.cs src/gui/eventExecute.cs src/gui/eventGraphConfigure.cs src/gui/event.cs src/gui/jump.cs src/gui/jumpType.cs src/gui/run.cs src/gui/runType.cs src/gui/reactionTime.cs src/gui/pulse.cs src/gui/person.cs src/gui/preferences.cs src/gui/session.cs src/gui/stats.cs src/gui/report.cs src/gui/about.cs src/gui/helpPorts.cs src/gui/dialogMessage.cs src/gui/dialogCalendar.cs src/gui/dialogImageTest.cs src/gui/language.cs src/gui/repetitiveConditions.cs src/gui/chronopicConnection.cs src/gui/convertWeight.cs src/gui/genericWindow.cs src/gui/splash.cs
+CHRONOJUMP_DEP_GUI = src/gui/chronojump.cs src/gui/confirm.cs src/gui/error.cs src/gui/eventExecute.cs src/gui/eventGraphConfigure.cs src/gui/event.cs src/gui/jump.cs src/gui/jumpType.cs src/gui/run.cs src/gui/runType.cs src/gui/reactionTime.cs src/gui/pulse.cs src/gui/person.cs src/gui/preferences.cs src/gui/session.cs src/gui/stats.cs src/gui/report.cs src/gui/about.cs src/gui/helpPorts.cs src/gui/dialogMessage.cs src/gui/dialogCalendar.cs src/gui/dialogImageTest.cs src/gui/language.cs src/gui/repetitiveConditions.cs src/gui/chronopicConnection.cs src/gui/convertWeight.cs src/gui/genericWindow.cs src/gui/splash.cs src/gui/server.cs
 
 CHRONOJUMP_DEP_STATS = src/statType.cs src/stats/main.cs src/stats/global.cs src/stats/sjCmjAbk.cs src/stats/sjCmjAbkPlus.cs src/stats/djIndex.cs src/stats/djQ.cs src/stats/rjIndex.cs src/stats/rjPotencyBosco.cs src/stats/rjEvolution.cs src/stats/ieIub.cs src/stats/fv.cs src/stats/potency.cs src/stats/rjAVGSD.cs
 
@@ -71,6 +71,7 @@
 		-resource:images/run_interval.png,run_interval.png 		-resource:images/mini/run_interval.png,mini/run_interval.png \
 		-resource:images/pulse_free.png,pulse_free.png 			-resource:images/mini/pulse_free.png,mini/pulse_free.png \
 		-resource:images/pulse_custom.png,pulse_custom.png		-resource:images/mini/pulse_custom.png,mini/pulse_custom.png \
+		-resource:images/mtgug.png,mtgug.png				-resource:images/mini/mtgug.png,mini/mtgug.png \
 		-resource:images/stock_bell.png,stock_bell.png \
 		-resource:images/stock_bell_green.png,stock_bell_green.png \
 		-resource:images/stock_bell_red.png,stock_bell_red.png \

Modified: trunk/build/data/chronojump.prg
==============================================================================
Binary files. No diff available.

Modified: trunk/build/data/chronojump_mini.prg
==============================================================================
Binary files. No diff available.

Modified: trunk/build/data/version.txt
==============================================================================
--- trunk/build/data/version.txt	(original)
+++ trunk/build/data/version.txt	Tue Jan 27 17:19:44 2009
@@ -1 +1 @@
-0.8.1.3
+0.8.1.4

Modified: trunk/changelog.txt
==============================================================================
--- trunk/changelog.txt	(original)
+++ trunk/changelog.txt	Tue Jan 27 17:19:44 2009
@@ -1,22 +1,69 @@
-write a version compatibility thing for each server method, and if not
+TODO (sorted)
+
+0.- doing the intervalDistancesString change !!!!!!!!!!!
+
+1.- upload SEvaluator and edit it and re-upload
+2.- on stats show data updated by user
+3.- write a version compatibility thing for each server method, and if not
 compatible, tell user to update it's chronojump version
+4.- Add the Maria Ginéest
+
+"questionnaire acabar
+cercar abstract google
+fer distancies diferents
+pending insert type in sql
+
+
+5.- do something with user created:
+-sports DONE!
+-testsTypes
++jumpType done
++...
+
+Add hexagon test
+
+Add Cabedo's tests
+
+record ip in SPing
+
+add "chronopic3" to ping. maybe need to ask to user
+
+add a link to the server page
+
+develop web stats and survey on web site
+
+maybe server URL can be selected by client on preferences
+
+all this will be release as 0.8.2 or 0.9
+
+
+27 jan 2008
+	0.8.1.4
+	new src/gui/server.cs with gui of session upload.
+	
+	thread on server session update
+
+	when user upload a session:
+	-session is uploaded
+	-person and personSession is uploaded
+	-tests are uploaded
+	-uploadingState change all the time
+	session can be uploaded more times (with new data)
+	-checks are done in (if no ok, user should edit): 
+	-sports, speciallity, level, weight
+
+	person uploads sport if user defined and not found in server database
 
-check if server is online in a separate place on gui/chronojump.cs
+	a silent ping is done at start
+	added "chronojump" to version on ping
+	repetitive conditions not shown at start
 
+	started maria ginéest
 
-Add the Maria Ginéest
-todo: record ip in SPing
-todo: upload a test (will upload it's person if not done before)
-
-todo: upload a session (except already uploaded tests, also check don't upload
-already uploaded persons)
-created server/session table (need to test)
-
-user can upload a session:
--session will be uploaded
--person and personSession will be uploaded
--tests will be uploaded
--uploadingState will change all the time
+	fixed bugs:
+	-gui/person (edit) crash on accept because serverUniqueID was unassigned
+	-fixed HasWeight bug in jumpType
+	-fixed crash on person add/edit when a ' is found
 
 23 jan 2008
 	0.8.1.3

Modified: trunk/chronojump_server/ChronojumpServer.cs
==============================================================================
--- trunk/chronojump_server/ChronojumpServer.cs	(original)
+++ trunk/chronojump_server/ChronojumpServer.cs	Tue Jan 27 17:19:44 2009
@@ -19,19 +19,19 @@
 /// <remarks>
 ///ChronojumpServer
 ///</remarks>
-[System.Web.Services.WebServiceBinding(Name="ChronojumpServerSoap", Namespace="http://80.32.81.197:8080/";)]
+[System.Web.Services.WebServiceBinding(Name="ChronojumpServerSoap", Namespace="http://localhost:8080/";)]
 [System.Diagnostics.DebuggerStepThroughAttribute()]
 [System.ComponentModel.DesignerCategoryAttribute("code")]
 public class ChronojumpServer : System.Web.Services.Protocols.SoapHttpClientProtocol {
     
     public ChronojumpServer() {
-        this.Url = "http://80.32.81.197:8080/chronojumpServer.asmx";;
+        this.Url = "http://localhost:8080/chronojumpServer.asmx";;
     }
     
     /// <remarks>
 ///Conecta BBDD
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/ConnectDatabase";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/ConnectDatabase";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public string ConnectDatabase() {
         object[] results = this.Invoke("ConnectDatabase", new object[0]);
         return ((string)(results[0]));
@@ -49,7 +49,7 @@
     /// <remarks>
 ///DisConecta BBDD
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/DisConnectDatabase";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/DisConnectDatabase";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public string DisConnectDatabase() {
         object[] results = this.Invoke("DisConnectDatabase", new object[0]);
         return ((string)(results[0]));
@@ -63,190 +63,324 @@
         object[] results = this.EndInvoke(asyncResult);
         return ((string)(results[0]));
     }
+   
+    /// <remarks>
+///Stats
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/Stats";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public ArrayList Stats() {
+        object[] results = this.Invoke("Stats", new object[0]);
+        return ((ArrayList)(results[0]));
+    }
     
+    public System.IAsyncResult BeginStats(System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("Stats", new object[0], callback, asyncState);
+    }
+    
+    public ArrayList EndStats(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((ArrayList)(results[0]));
+    }
+
     /// <remarks>
-///Select person name
+///Upload session
 ///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/SelectPersonName";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
-    public string SelectPersonName(int personID) {
-        object[] results = this.Invoke("SelectPersonName", new object[] {
-            personID});
-        return ((string)(results[0]));
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadSession";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadSession(ServerSession mySession) {
+        object[] results = this.Invoke("UploadSession", new object[] {
+            mySession});
+        return ((int)(results[0]));
     }
     
-    public System.IAsyncResult BeginSelectPersonName(int personID, System.AsyncCallback callback, object asyncState) {
-        return this.BeginInvoke("SelectPersonName", new object[] {
-            personID}, callback, asyncState);
+    public System.IAsyncResult BeginUploadSession(ServerSession mySession, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadSession", new object[] {
+            mySession}, callback, asyncState);
     }
     
-    public string EndSelectPersonName(System.IAsyncResult asyncResult) {
+    public int EndUploadSession(System.IAsyncResult asyncResult) {
         object[] results = this.EndInvoke(asyncResult);
-        return ((string)(results[0]));
+        return ((int)(results[0]));
+    }
+
+    /// <remarks>
+///Update session
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UpdateSession";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UpdateSession(int sessionID, Constants.ServerSessionStates state) {
+        object[] results = this.Invoke("UpdateSession", new object[] {
+            sessionID, state});
+        return ((int)(results[0]));
     }
     
+    public System.IAsyncResult BeginUpdateSession(int sessionID, Constants.ServerSessionStates state, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UpdateSession", new object[] {
+            sessionID, state}, callback, asyncState);
+    }
+    
+    public int EndUpdateSession(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+
     /// <remarks>
-///See all persons
+///Upload an sport (user defined)
 ///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/SelectAllPersons";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
-    public ArrayList SelectAllPersons() {
-        object[] results = this.Invoke("SelectAllPersons", new object[0]);
-        return ((ArrayList)(results[0]));
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadSport";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadSport(Sport mySport) {
+        object[] results = this.Invoke("UploadSport", new object[] {
+            mySport});
+        return ((int)(results[0]));
     }
     
-    public System.IAsyncResult BeginSelectAllPersons(System.AsyncCallback callback, object asyncState) {
-        return this.BeginInvoke("SelectAllPersons", new object[0], callback, asyncState);
+    public System.IAsyncResult BeginUploadSport(Sport mySport, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadSport", new object[] {
+            mySport}, callback, asyncState);
     }
     
-//public string[] EndSelectAllPersons(System.IAsyncResult asyncResult) {
-    public ArrayList EndSelectAllPersons(System.IAsyncResult asyncResult) {
+    public int EndUploadSport(System.IAsyncResult asyncResult) {
         object[] results = this.EndInvoke(asyncResult);
-//return ((string[])(results[0]));
-        return ((ArrayList)(results[0]));
+        return ((int)(results[0]));
+    }
+
+    /// <remarks>
+///Upload a jump type (user defined)
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadJumpType";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public string UploadJumpType(JumpType type, int evalSID) {
+        object[] results = this.Invoke("UploadJumpType", new object[] {
+            type, evalSID});
+        return ((string)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginUploadJumpType(JumpType type, int evalSID, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadJumpType", new object[] {
+            type, evalSID}, callback, asyncState);
     }
     
+    public string EndUploadJumpType(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((string)(results[0]));
+    }
+
     /// <remarks>
-///Stats
+///Upload person
 ///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/Stats";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
-    public ArrayList Stats() {
-        object[] results = this.Invoke("Stats", new object[0]);
-        return ((ArrayList)(results[0]));
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadPerson";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadPerson(Person myPerson, int sessionID) {
+        object[] results = this.Invoke("UploadPerson", new object[] {
+            myPerson, sessionID});
+        return ((int)(results[0]));
     }
     
-    public System.IAsyncResult BeginStats(System.AsyncCallback callback, object asyncState) {
-        return this.BeginInvoke("Stats", new object[0], callback, asyncState);
+    public System.IAsyncResult BeginUploadPerson(Person myPerson, int sessionID, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadPerson", new object[] {
+            myPerson, sessionID}, callback, asyncState);
     }
     
-    public ArrayList EndStats(System.IAsyncResult asyncResult) {
+    public int EndUploadPerson(System.IAsyncResult asyncResult) {
         object[] results = this.EndInvoke(asyncResult);
-        return ((ArrayList)(results[0]));
+        return ((int)(results[0]));
+    }
+
+    /// <remarks>
+///Upload person session if needed
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadPersonSessionIfNeeded";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadPersonSessionIfNeeded(int personServerID, int sessionServerID, int weight) {
+        object[] results = this.Invoke("UploadPersonSessionIfNeeded", new object[] {
+            personServerID, sessionServerID, weight});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginUploadPersonSessionIfNeeded(int personServerID, int sessionServerID, int weight, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadPersonSessionIfNeeded", new object[] {
+            personServerID, sessionServerID, weight}, callback, asyncState);
     }
     
+    public int EndUploadPersonSessionIfNeeded(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+
+
     /// <remarks>
-///Select events from all persons
+///Upload ping
 ///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/SelectAllPersonEvents";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
-    public object[] SelectAllPersonEvents(int personID) {
-        object[] results = this.Invoke("SelectAllPersonEvents", new object[] {
-            personID});
-        return ((object[])(results[0]));
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadPing";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadPing(ServerPing myPing, bool doInsertion) {
+        object[] results = this.Invoke("UploadPing", new object[] {
+            myPing, doInsertion});
+        return ((int)(results[0]));
     }
     
-    public System.IAsyncResult BeginSelectAllPersonEvents(int personID, System.AsyncCallback callback, object asyncState) {
-        return this.BeginInvoke("SelectAllPersonEvents", new object[] {
-            personID}, callback, asyncState);
+    public System.IAsyncResult BeginUploadPing(ServerPing myPing, bool doInsertion, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadPing", new object[] {
+            myPing, doInsertion}, callback, asyncState);
     }
     
-    public object[] EndSelectAllPersonEvents(System.IAsyncResult asyncResult) {
+    public int EndUploadPing(System.IAsyncResult asyncResult) {
         object[] results = this.EndInvoke(asyncResult);
-        return ((object[])(results[0]));
+        return ((int)(results[0]));
+    }
+
+    /// <remarks>
+///Upload evaluator
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadEvaluator";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadEvaluator(ServerEvaluator myEval) {
+        object[] results = this.Invoke("UploadEvaluator", new object[] {
+            myEval});
+        return ((int)(results[0]));
     }
     
+    public System.IAsyncResult BeginUploadEvaluator(ServerEvaluator myEval, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadEvaluator", new object[] {
+            myEval}, callback, asyncState);
+    }
+    
+    public int EndUploadEvaluator(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+
+
     /// <remarks>
-///Insert session
+///Upload a jump
 ///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///also don't pass a Event expecting that server can use polymorphism like if it's jump
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/InsertSession";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
-    public int InsertSession(ServerSession mySession) {
-        object[] results = this.Invoke("InsertSession", new object[] {
-            mySession});
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadJump";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadJump(Jump myTest) {
+        object[] results = this.Invoke("UploadJump", new object[] {
+            myTest});
         return ((int)(results[0]));
     }
     
-    public System.IAsyncResult BeginInsertSession(ServerSession mySession, System.AsyncCallback callback, object asyncState) {
-        return this.BeginInvoke("InsertSession", new object[] {
-            mySession}, callback, asyncState);
+    public System.IAsyncResult BeginUploadJump(Jump myTest, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadJump", new object[] {
+            myTest}, callback, asyncState);
     }
     
-    public int EndInsertSession(System.IAsyncResult asyncResult) {
+    public int EndUploadJump(System.IAsyncResult asyncResult) {
         object[] results = this.EndInvoke(asyncResult);
         return ((int)(results[0]));
     }
 
     /// <remarks>
-///Insert person
+///Upload a jumpRj
 ///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///also don't pass a Event expecting that server can use polymorphism like if it's jump
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/InsertPerson";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
-    public int InsertPerson(Person myPerson, int sessionID) {
-        object[] results = this.Invoke("InsertPerson", new object[] {
-            myPerson, sessionID});
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadJumpRj";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadJumpRj(JumpRj myTest) {
+        object[] results = this.Invoke("UploadJumpRj", new object[] {
+            myTest});
         return ((int)(results[0]));
     }
     
-    public System.IAsyncResult BeginInsertPerson(Person myPerson, int sessionID, System.AsyncCallback callback, object asyncState) {
-        return this.BeginInvoke("InsertPerson", new object[] {
-            myPerson, sessionID}, callback, asyncState);
+    public System.IAsyncResult BeginUploadJumpRj(JumpRj myTest, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadJumpRj", new object[] {
+            myTest}, callback, asyncState);
     }
     
-    public int EndInsertPerson(System.IAsyncResult asyncResult) {
+    public int EndUploadJumpRj(System.IAsyncResult asyncResult) {
         object[] results = this.EndInvoke(asyncResult);
         return ((int)(results[0]));
     }
 
     /// <remarks>
-///Insert ping
+///Upload a run
 ///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///also don't pass a Event expecting that server can use polymorphism like if it's jump
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/InsertPing";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
-    public int InsertPing(ServerPing myPing) {
-        object[] results = this.Invoke("InsertPing", new object[] {
-            myPing});
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadRun";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadRun(Run myTest) {
+        object[] results = this.Invoke("UploadRun", new object[] {
+            myTest});
         return ((int)(results[0]));
     }
     
-    public System.IAsyncResult BeginInsertPing(ServerPing myPing, System.AsyncCallback callback, object asyncState) {
-        return this.BeginInvoke("InsertPing", new object[] {
-            myPing}, callback, asyncState);
+    public System.IAsyncResult BeginUploadRun(Run myTest, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadRun", new object[] {
+            myTest}, callback, asyncState);
     }
     
-    public int EndInsertPing(System.IAsyncResult asyncResult) {
+    public int EndUploadRun(System.IAsyncResult asyncResult) {
         object[] results = this.EndInvoke(asyncResult);
         return ((int)(results[0]));
     }
 
     /// <remarks>
-///Insert evaluator
+///Upload a run interval
 ///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///also don't pass a Event expecting that server can use polymorphism like if it's jump
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/InsertEvaluator";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
-    public int InsertEvaluator(ServerEvaluator myEval) {
-        object[] results = this.Invoke("InsertEvaluator", new object[] {
-            myEval});
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadRunI";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadRunI(RunInterval myTest) {
+        object[] results = this.Invoke("UploadRunI", new object[] {
+            myTest});
         return ((int)(results[0]));
     }
     
-    public System.IAsyncResult BeginInsertEvaluator(ServerEvaluator myEval, System.AsyncCallback callback, object asyncState) {
-        return this.BeginInvoke("InsertEvaluator", new object[] {
-            myEval}, callback, asyncState);
+    public System.IAsyncResult BeginUploadRunI(RunInterval myTest, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadRunI", new object[] {
+            myTest}, callback, asyncState);
     }
     
-    public int EndInsertEvaluator(System.IAsyncResult asyncResult) {
+    public int EndUploadRunI(System.IAsyncResult asyncResult) {
         object[] results = this.EndInvoke(asyncResult);
         return ((int)(results[0]));
     }
 
     /// <remarks>
-///Update session
+///Upload a reaction time
 ///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///also don't pass a Event expecting that server can use polymorphism like if it's jump
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/UpdateSession";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
-    public int UpdateSession(int sessionID, Constants.ServerSessionStates state) {
-        object[] results = this.Invoke("UpdateSession", new object[] {
-            sessionID, state});
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadRT";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadRT(ReactionTime myTest) {
+        object[] results = this.Invoke("UploadRT", new object[] {
+            myTest});
         return ((int)(results[0]));
     }
     
-    public System.IAsyncResult BeginUpdateSession(int sessionID, Constants.ServerSessionStates state, System.AsyncCallback callback, object asyncState) {
-        return this.BeginInvoke("UpdateSession", new object[] {
-            sessionID, state}, callback, asyncState);
+    public System.IAsyncResult BeginUploadRT(ReactionTime myTest, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadRT", new object[] {
+            myTest}, callback, asyncState);
     }
     
-    public int EndUpdateSession(System.IAsyncResult asyncResult) {
+    public int EndUploadRT(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((int)(results[0]));
+    }
+
+    /// <remarks>
+///Upload a pulse
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///also don't pass a Event expecting that server can use polymorphism like if it's jump
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/UploadPulse";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public int UploadPulse(Pulse myTest) {
+        object[] results = this.Invoke("UploadPulse", new object[] {
+            myTest});
+        return ((int)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginUploadPulse(Pulse myTest, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("UploadPulse", new object[] {
+            myTest}, callback, asyncState);
+    }
+    
+    public int EndUploadPulse(System.IAsyncResult asyncResult) {
         object[] results = this.EndInvoke(asyncResult);
         return ((int)(results[0]));
     }
@@ -255,7 +389,7 @@
 ///List directory files (only as a sample)
 ///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
 ///</remarks>
-    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://80.32.81.197:8080/ListDirectory";, RequestNamespace="http://80.32.81.197:8080/";, ResponseNamespace="http://80.32.81.197:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/ListDirectory";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
     public string[] ListDirectory(string path) {
         object[] results = this.Invoke("ListDirectory", new object[] {
             path});
@@ -271,4 +405,72 @@
         object[] results = this.EndInvoke(asyncResult);
         return ((string[])(results[0]));
     }
+   
+    /* 
+    /// <remarks>
+///Select person name
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/SelectPersonName";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public string SelectPersonName(int personID) {
+        object[] results = this.Invoke("SelectPersonName", new object[] {
+            personID});
+        return ((string)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginSelectPersonName(int personID, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("SelectPersonName", new object[] {
+            personID}, callback, asyncState);
+    }
+    
+    public string EndSelectPersonName(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((string)(results[0]));
+    }
+    
+    /// <remarks>
+///See all persons
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/SelectAllPersons";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public ArrayList SelectAllPersons() {
+        object[] results = this.Invoke("SelectAllPersons", new object[0]);
+        return ((ArrayList)(results[0]));
+    }
+    
+    public System.IAsyncResult BeginSelectAllPersons(System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("SelectAllPersons", new object[0], callback, asyncState);
+    }
+    
+//public string[] EndSelectAllPersons(System.IAsyncResult asyncResult) {
+    public ArrayList EndSelectAllPersons(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+//return ((string[])(results[0]));
+        return ((ArrayList)(results[0]));
+    }
+    */
+
+/*    
+    /// <remarks>
+///Select events from all persons
+///important: variable names here have to be the same than in ChronojumpServerCSharp.cs
+///</remarks>
+    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost:8080/SelectAllPersonEvents";, RequestNamespace="http://localhost:8080/";, ResponseNamespace="http://localhost:8080/";, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+    public object[] SelectAllPersonEvents(int personID) {
+        object[] results = this.Invoke("SelectAllPersonEvents", new object[] {
+            personID});
+        return ((object[])(results[0]));
+    }
+    
+    public System.IAsyncResult BeginSelectAllPersonEvents(int personID, System.AsyncCallback callback, object asyncState) {
+        return this.BeginInvoke("SelectAllPersonEvents", new object[] {
+            personID}, callback, asyncState);
+    }
+    
+    public object[] EndSelectAllPersonEvents(System.IAsyncResult asyncResult) {
+        object[] results = this.EndInvoke(asyncResult);
+        return ((object[])(results[0]));
+    }
+  */
+
 }

Modified: trunk/chronojump_server/bin/chronojumpServer.dll
==============================================================================
Binary files. No diff available.

Modified: trunk/glade/chronojump.glade
==============================================================================
--- trunk/glade/chronojump.glade	(original)
+++ trunk/glade/chronojump.glade	Tue Jan 27 17:19:44 2009
@@ -8244,7 +8244,7 @@
 		      <signal name="activate" handler="on_new_activate" last_modification_time="Wed, 22 Sep 2004 23:55:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3598">
+			<widget class="GtkImage" id="image3768">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8265,7 +8265,7 @@
 		      <signal name="activate" handler="on_open_activate" last_modification_time="Wed, 22 Sep 2004 23:55:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3599">
+			<widget class="GtkImage" id="image3769">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8286,7 +8286,7 @@
 		      <signal name="activate" handler="on_edit_session_activate" last_modification_time="Tue, 26 Jul 2005 19:12:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3600">
+			<widget class="GtkImage" id="image3770">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8308,7 +8308,7 @@
 		      <signal name="activate" handler="on_delete_session_activate" last_modification_time="Thu, 28 Jul 2005 13:37:42 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3601">
+			<widget class="GtkImage" id="image3771">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8336,7 +8336,7 @@
 		      <signal name="activate" handler="on_export_session_activate" last_modification_time="Sat, 12 Feb 2005 21:57:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3602">
+			<widget class="GtkImage" id="image3772">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-convert</property>
 			  <property name="icon_size">1</property>
@@ -8372,7 +8372,7 @@
 		      <signal name="activate" handler="on_preferences_activate" last_modification_time="Mon, 04 Oct 2004 19:19:19 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3603">
+			<widget class="GtkImage" id="image3773">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -8410,50 +8410,11 @@
 			  </child>
 
 			  <child>
-			    <widget class="GtkSeparatorMenuItem" id="separador19">
+			    <widget class="GtkMenuItem" id="menuitem_server_upload_session">
 			      <property name="visible">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="menuitem_server_insert_person">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Insert current person</property>
-			      <property name="use_underline">True</property>
-			      <signal name="activate" handler="on_menuitem_server_insert_person" last_modification_time="Wed, 14 Jan 2009 02:03:56 GMT"/>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="menuitem_server_insert_evaluator">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Insert evaluator</property>
-			      <property name="use_underline">True</property>
-			      <signal name="activate" handler="on_menuitem_server_insert_evaluator" last_modification_time="Wed, 21 Jan 2009 13:35:37 GMT"/>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="menuitem_server_insert_session">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Insert current session</property>
-			      <property name="use_underline">True</property>
-			      <signal name="activate" handler="on_menuitem_server_insert_session" last_modification_time="Thu, 22 Jan 2009 11:41:40 GMT"/>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkSeparatorMenuItem" id="separador20">
-			      <property name="visible">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="menuitem_server_see_all">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">See all persons</property>
+			      <property name="label" translatable="yes">Upload (or update) session to server</property>
 			      <property name="use_underline">True</property>
-			      <signal name="activate" handler="on_menuitem_server_see_all" last_modification_time="Wed, 14 Jan 2009 02:03:41 GMT"/>
+			      <signal name="activate" handler="on_menuitem_server_upload_session" last_modification_time="Mon, 26 Jan 2009 09:16:30 GMT"/>
 			    </widget>
 			  </child>
 
@@ -8484,7 +8445,7 @@
 		      <signal name="activate" handler="on_quit1_activate" last_modification_time="Wed, 22 Sep 2004 23:17:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3604">
+			<widget class="GtkImage" id="image3774">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-quit</property>
 			  <property name="icon_size">1</property>
@@ -8518,7 +8479,7 @@
 		      <signal name="activate" handler="on_person_add_single_activate" last_modification_time="Thu, 18 Aug 2005 23:07:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3605">
+			<widget class="GtkImage" id="image3775">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8539,7 +8500,7 @@
 		      <signal name="activate" handler="on_person_add_multiple_activate" last_modification_time="Thu, 18 Aug 2005 23:01:23 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3606">
+			<widget class="GtkImage" id="image3776">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8566,7 +8527,7 @@
 		      <signal name="activate" handler="on_recuperate_person_activate" last_modification_time="Sun, 12 Dec 2004 00:40:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3607">
+			<widget class="GtkImage" id="image3777">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8587,7 +8548,7 @@
 		      <signal name="activate" handler="on_recuperate_persons_from_session_activate" last_modification_time="Tue, 26 Jul 2005 19:12:07 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3608">
+			<widget class="GtkImage" id="image3778">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8614,7 +8575,7 @@
 		      <signal name="activate" handler="on_edit_current_person_clicked" last_modification_time="Sun, 17 Oct 2004 11:43:33 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3609">
+			<widget class="GtkImage" id="image3779">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8635,7 +8596,7 @@
 		      <signal name="activate" handler="on_show_all_person_events_activate" last_modification_time="Mon, 29 Aug 2005 09:51:24 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3610">
+			<widget class="GtkImage" id="image3780">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-index</property>
 			  <property name="icon_size">1</property>
@@ -8662,7 +8623,7 @@
 		      <signal name="activate" handler="on_delete_current_person_from_session_activate" last_modification_time="Thu, 28 Jul 2005 15:49:38 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3611">
+			<widget class="GtkImage" id="image3781">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8774,7 +8735,7 @@
 			      <signal name="activate" handler="on_button_more_clicked" last_modification_time="Thu, 10 Mar 2005 18:52:25 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3612">
+				<widget class="GtkImage" id="image3782">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -8799,7 +8760,7 @@
 		      <signal name="activate" handler="on_edit_selected_jump_clicked" last_modification_time="Sun, 17 Oct 2004 11:47:42 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3613">
+			<widget class="GtkImage" id="image3783">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8820,7 +8781,7 @@
 		      <signal name="activate" handler="on_delete_selected_jump_clicked" last_modification_time="Tue, 19 Oct 2004 11:54:17 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3614">
+			<widget class="GtkImage" id="image3784">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8886,7 +8847,7 @@
 			      <signal name="activate" handler="on_button_more_rj_clicked" last_modification_time="Fri, 11 Mar 2005 14:45:23 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3615">
+				<widget class="GtkImage" id="image3785">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -8911,7 +8872,7 @@
 		      <signal name="activate" handler="on_edit_selected_jump_rj_clicked" last_modification_time="Sun, 07 Nov 2004 17:37:37 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3616">
+			<widget class="GtkImage" id="image3786">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8932,7 +8893,7 @@
 		      <signal name="activate" handler="on_repair_selected_reactive_jump_clicked" last_modification_time="Wed, 07 Dec 2005 01:14:11 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3617">
+			<widget class="GtkImage" id="image3787">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -8953,7 +8914,7 @@
 		      <signal name="activate" handler="on_delete_selected_jump_rj_clicked" last_modification_time="Sun, 07 Nov 2004 17:37:37 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3618">
+			<widget class="GtkImage" id="image3788">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8980,7 +8941,7 @@
 		      <signal name="activate" handler="on_jump_type_add_activate" last_modification_time="Thu, 10 Mar 2005 18:52:25 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3619">
+			<widget class="GtkImage" id="image3789">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -9125,7 +9086,7 @@
 			      <signal name="activate" handler="on_button_run_more_clicked" last_modification_time="Fri, 22 Apr 2005 14:37:06 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3620">
+				<widget class="GtkImage" id="image3790">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -9150,7 +9111,7 @@
 		      <signal name="activate" handler="on_edit_selected_run_clicked" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3621">
+			<widget class="GtkImage" id="image3791">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -9171,7 +9132,7 @@
 		      <signal name="activate" handler="on_delete_selected_run_clicked" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3622">
+			<widget class="GtkImage" id="image3792">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -9230,6 +9191,15 @@
 			  </child>
 
 			  <child>
+			    <widget class="GtkMenuItem" id="menu_run_interval_mtgug">
+			      <property name="visible">True</property>
+			      <property name="label" translatable="yes">MTGUG</property>
+			      <property name="use_underline">True</property>
+			      <signal name="activate" handler="on_run_interval_activate" last_modification_time="Tue, 27 Jan 2009 16:21:55 GMT"/>
+			    </widget>
+			  </child>
+
+			  <child>
 			    <widget class="GtkImageMenuItem" id="more_interval_runs">
 			      <property name="visible">True</property>
 			      <property name="label" translatable="yes">More intervallic runs</property>
@@ -9237,7 +9207,7 @@
 			      <signal name="activate" handler="on_button_run_interval_more_clicked" last_modification_time="Tue, 16 Aug 2005 01:18:41 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image3623">
+				<widget class="GtkImage" id="image3793">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -9262,7 +9232,7 @@
 		      <signal name="activate" handler="on_edit_selected_run_interval_clicked" last_modification_time="Tue, 16 Aug 2005 12:33:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3624">
+			<widget class="GtkImage" id="image3794">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -9283,7 +9253,7 @@
 		      <signal name="activate" handler="on_repair_selected_run_interval_clicked" last_modification_time="Wed, 03 May 2006 15:15:38 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3625">
+			<widget class="GtkImage" id="image3795">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -9304,7 +9274,7 @@
 		      <signal name="activate" handler="on_delete_selected_run_interval_clicked" last_modification_time="Tue, 16 Aug 2005 12:33:39 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3626">
+			<widget class="GtkImage" id="image3796">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -9331,7 +9301,7 @@
 		      <signal name="activate" handler="on_run_type_add_activate" last_modification_time="Fri, 22 Apr 2005 14:34:58 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3627">
+			<widget class="GtkImage" id="image3797">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -9411,7 +9381,7 @@
 		      <signal name="activate" handler="on_menuitem_view_stats_activate" last_modification_time="Tue, 26 Jul 2005 23:54:29 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3628">
+			<widget class="GtkImage" id="image3798">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-refresh</property>
 			  <property name="icon_size">1</property>
@@ -9432,7 +9402,7 @@
 		      <signal name="activate" handler="on_show_report_activate" last_modification_time="Tue, 06 Sep 2005 09:10:32 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3629">
+			<widget class="GtkImage" id="image3799">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-refresh</property>
 			  <property name="icon_size">1</property>
@@ -9463,7 +9433,7 @@
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">Simulated</property>
 		      <property name="use_underline">True</property>
-		      <property name="active">True</property>
+		      <property name="active">False</property>
 		      <signal name="toggled" handler="on_radiobutton_simulated" last_modification_time="Tue, 09 May 2006 19:55:19 GMT"/>
 		    </widget>
 		  </child>
@@ -9500,7 +9470,7 @@
 		      <signal name="activate" handler="on_menuitem_manual_activate" last_modification_time="Wed, 03 Oct 2007 23:31:41 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3630">
+			<widget class="GtkImage" id="image3800">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-info</property>
 			  <property name="icon_size">1</property>
@@ -9536,7 +9506,7 @@
 		      <signal name="activate" handler="on_about1_activate" last_modification_time="Wed, 22 Sep 2004 23:17:31 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3631">
+			<widget class="GtkImage" id="image3801">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-about</property>
 			  <property name="icon_size">1</property>
@@ -9563,7 +9533,7 @@
 		      <signal name="activate" handler="on_debug_crash_activate" last_modification_time="Thu, 23 Oct 2008 22:57:02 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image3632">
+			<widget class="GtkImage" id="image3802">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-dialog-error</property>
 			  <property name="icon_size">1</property>
@@ -11775,6 +11745,25 @@
 				      </child>
 
 				      <child>
+					<widget class="GtkButton" id="button_run_interval_mtgug">
+					  <property name="visible">True</property>
+					  <property name="tooltip" translatable="yes">Intervallic run unlimited (until &quot;finish&quot; button is clicked)</property>
+					  <property name="can_focus">True</property>
+					  <property name="label" translatable="yes">MTGUG</property>
+					  <property name="use_underline">True</property>
+					  <property name="relief">GTK_RELIEF_NORMAL</property>
+					  <property name="focus_on_click">True</property>
+					  <signal name="clicked" handler="on_run_interval_activate" last_modification_time="Tue, 16 Aug 2005 13:32:42 GMT"/>
+					  <signal name="enter" handler="on_button_enter" last_modification_time="Wed, 02 May 2007 12:57:33 GMT"/>
+					</widget>
+					<packing>
+					  <property name="padding">0</property>
+					  <property name="expand">False</property>
+					  <property name="fill">False</property>
+					</packing>
+				      </child>
+
+				      <child>
 					<widget class="GtkAlignment" id="alignment_runIntervak_more">
 					  <property name="visible">True</property>
 					  <property name="xalign">0.5</property>
@@ -18026,7 +18015,6 @@
 
 <widget class="GtkWindow" id="repetitive_conditions">
   <property name="border_width">10</property>
-  <property name="visible">True</property>
   <property name="title" translatable="yes">Conditions in repetive test</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_NONE</property>
@@ -22180,4 +22168,633 @@
   </child>
 </widget>
 
+<widget class="GtkWindow" id="session_upload">
+  <property name="border_width">10</property>
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">Upload session to server</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">True</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+  <signal name="delete_event" handler="on_session_upload_delete_event" last_modification_time="Sat, 24 Jan 2009 16:06:31 GMT"/>
+
+  <child>
+    <widget class="GtkVBox" id="vbox147">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">8</property>
+
+      <child>
+	<widget class="GtkTable" id="table48">
+	  <property name="visible">True</property>
+	  <property name="n_rows">2</property>
+	  <property name="n_columns">2</property>
+	  <property name="homogeneous">False</property>
+	  <property name="row_spacing">6</property>
+	  <property name="column_spacing">8</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="label533">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;b&gt;Persons&lt;/b&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
+	      <property name="top_attach">0</property>
+	      <property name="bottom_attach">1</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label534">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;b&gt;Tests&lt;/b&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">0</property>
+	      <property name="bottom_attach">1</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkTable" id="table49">
+	      <property name="visible">True</property>
+	      <property name="n_rows">2</property>
+	      <property name="n_columns">6</property>
+	      <property name="homogeneous">False</property>
+	      <property name="row_spacing">4</property>
+	      <property name="column_spacing">8</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label536">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Jumps</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">0</property>
+		  <property name="bottom_attach">1</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label537">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Jumps
+reactive</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">1</property>
+		  <property name="right_attach">2</property>
+		  <property name="top_attach">0</property>
+		  <property name="bottom_attach">1</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label538">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Runs</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">2</property>
+		  <property name="right_attach">3</property>
+		  <property name="top_attach">0</property>
+		  <property name="bottom_attach">1</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label539">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Runs
+intervallic</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">3</property>
+		  <property name="right_attach">4</property>
+		  <property name="top_attach">0</property>
+		  <property name="bottom_attach">1</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label540">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Reaction
+times</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">4</property>
+		  <property name="right_attach">5</property>
+		  <property name="top_attach">0</property>
+		  <property name="bottom_attach">1</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label541">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Pulses</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">5</property>
+		  <property name="right_attach">6</property>
+		  <property name="top_attach">0</property>
+		  <property name="bottom_attach">1</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTreeView" id="treeview_jumps_rj">
+		  <property name="visible">True</property>
+		  <property name="headers_visible">True</property>
+		  <property name="rules_hint">False</property>
+		  <property name="reorderable">False</property>
+		  <property name="enable_search">False</property>
+		  <property name="fixed_height_mode">False</property>
+		  <property name="hover_selection">False</property>
+		  <property name="hover_expand">False</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">1</property>
+		  <property name="right_attach">2</property>
+		  <property name="top_attach">1</property>
+		  <property name="bottom_attach">2</property>
+		  <property name="x_options"></property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTreeView" id="treeview_runs">
+		  <property name="visible">True</property>
+		  <property name="headers_visible">True</property>
+		  <property name="rules_hint">False</property>
+		  <property name="reorderable">False</property>
+		  <property name="enable_search">False</property>
+		  <property name="fixed_height_mode">False</property>
+		  <property name="hover_selection">False</property>
+		  <property name="hover_expand">False</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">2</property>
+		  <property name="right_attach">3</property>
+		  <property name="top_attach">1</property>
+		  <property name="bottom_attach">2</property>
+		  <property name="x_options"></property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTreeView" id="treeview_runs_i">
+		  <property name="visible">True</property>
+		  <property name="headers_visible">True</property>
+		  <property name="rules_hint">False</property>
+		  <property name="reorderable">False</property>
+		  <property name="enable_search">False</property>
+		  <property name="fixed_height_mode">False</property>
+		  <property name="hover_selection">False</property>
+		  <property name="hover_expand">False</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">3</property>
+		  <property name="right_attach">4</property>
+		  <property name="top_attach">1</property>
+		  <property name="bottom_attach">2</property>
+		  <property name="x_options"></property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTreeView" id="treeview_rts">
+		  <property name="visible">True</property>
+		  <property name="headers_visible">True</property>
+		  <property name="rules_hint">False</property>
+		  <property name="reorderable">False</property>
+		  <property name="enable_search">False</property>
+		  <property name="fixed_height_mode">False</property>
+		  <property name="hover_selection">False</property>
+		  <property name="hover_expand">False</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">4</property>
+		  <property name="right_attach">5</property>
+		  <property name="top_attach">1</property>
+		  <property name="bottom_attach">2</property>
+		  <property name="x_options"></property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTreeView" id="treeview_pulses">
+		  <property name="visible">True</property>
+		  <property name="headers_visible">True</property>
+		  <property name="rules_hint">False</property>
+		  <property name="reorderable">False</property>
+		  <property name="enable_search">False</property>
+		  <property name="fixed_height_mode">False</property>
+		  <property name="hover_selection">False</property>
+		  <property name="hover_expand">False</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">5</property>
+		  <property name="right_attach">6</property>
+		  <property name="top_attach">1</property>
+		  <property name="bottom_attach">2</property>
+		  <property name="x_options"></property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTreeView" id="treeview_jumps">
+		  <property name="visible">True</property>
+		  <property name="headers_visible">True</property>
+		  <property name="rules_hint">False</property>
+		  <property name="reorderable">False</property>
+		  <property name="enable_search">False</property>
+		  <property name="fixed_height_mode">False</property>
+		  <property name="hover_selection">False</property>
+		  <property name="hover_expand">False</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">1</property>
+		  <property name="bottom_attach">2</property>
+		  <property name="x_options"></property>
+		  <property name="y_options">fill</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkVBox" id="vbox148">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">4</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label535">
+		  <property name="visible">True</property>
+		  <property name="label">
+</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTreeView" id="treeview_persons">
+		  <property name="visible">True</property>
+		  <property name="headers_visible">True</property>
+		  <property name="rules_hint">False</property>
+		  <property name="reorderable">False</property>
+		  <property name="enable_search">False</property>
+		  <property name="fixed_height_mode">False</property>
+		  <property name="hover_selection">False</property>
+		  <property name="hover_expand">False</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">0</property>
+	      <property name="right_attach">1</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">True</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkHBox" id="hbox285">
+	  <property name="visible">True</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="label542">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">Names will be hidden</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0.5</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkHBox" id="hbox283">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label543">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Codes:</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label544">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;i&gt;U&lt;/i&gt; Uploaded.
+&lt;i&gt;E&lt;/i&gt; Not uploaded. Already Exists.
+&lt;i&gt;S&lt;/i&gt; Not uploaded. Simulated test.</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">True</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label_thanks">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;i&gt;Thanks for your time.&lt;/i&gt;</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">True</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0.5</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkHButtonBox" id="hbuttonbox43">
+	  <property name="visible">True</property>
+	  <property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkButton" id="button_close">
+	      <property name="visible">True</property>
+	      <property name="can_default">True</property>
+	      <property name="has_default">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="has_focus">True</property>
+	      <property name="label">gtk-close</property>
+	      <property name="use_stock">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+	      <signal name="clicked" handler="on_button_close_clicked" last_modification_time="Sat, 24 Jan 2009 15:25:54 GMT"/>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
 </glade-interface>

Added: trunk/images/mini/mtgug.png
==============================================================================
Binary file. No diff available.

Added: trunk/images/mtgug.png
==============================================================================
Binary file. No diff available.

Modified: trunk/sqlite_diagrams/chronojump_sqlite.dia
==============================================================================
Binary files. No diff available.

Modified: trunk/src/constants.cs
==============================================================================
--- trunk/src/constants.cs	(original)
+++ trunk/src/constants.cs	Tue Jan 27 17:19:44 2009
@@ -42,6 +42,9 @@
 	public const string IeIndexFormula = "IE (cmj-sj)/sj *100";
 	public const string IubIndexFormula = "IUB (abk-cmj)/cmj *100";
 
+	//tests types
+	public enum TestTypes { JUMP, JUMP_RJ, RUN, RUN_I, RT, PULSE }
+
 	//sqlite tables
 	//instead of typing the tableName directly (that can crash if it's bad written and it's not detected by compiler)
 	//use the following consts, and if it's misspelled, compiler will know
@@ -77,10 +80,14 @@
 	public const string ServerEvaluatorTable = "SEvaluator"; 
 	public const string IPUnknown = "Unknown"; 
 	public static int ServerUndefinedID = -1;
-	public static string ServerOffline = Catalog.GetString("Server is currently offline.");
+	public static string ServerOffline = Catalog.GetString("Sorry, server is currently offline.");
 	public enum ServerSessionStates {
-		NOTHING, UPLOADINGSESSION, UPLOADINGPERSONS, UPLOADINGTESTS, DONE
+		NOTHING, UPLOADINGSESSION, UPLOADINGDATA, DONE
 	}
+	public enum UploadCodes {
+		EXISTS, SIMULATED, OK
+	}
+
 
 /*	OLD, check this
 	public static string PotencyLewisCMJFormula = Catalog.GetString("Peak Power")+ " CMJ (Lewis) " +

Modified: trunk/src/event.cs
==============================================================================
--- trunk/src/event.cs	(original)
+++ trunk/src/event.cs	Tue Jan 27 17:19:44 2009
@@ -35,14 +35,15 @@
 	protected int simulated;
 
 	public Event() {
-		//simulated = false;
 	}
-
+	
 	//used to select an event at Sqlite.addSimulatedInEventTables
 	public Event(string [] eventString) {
 	}
-
-	public virtual void InsertAtDB (bool dbconOpened, string tableName) {
+	
+	public virtual int InsertAtDB (bool dbconOpened, string tableName) {
+		Console.WriteLine("++++++++");
+		return -1;
 	}	
 
 	public string Type
@@ -66,11 +67,13 @@
 	public int SessionID
 	{
 		get { return sessionID; }
+		set { sessionID = value; }
 	}
 
 	public int PersonID
 	{
 		get { return personID; }
+		set { personID = value; }
 	}
 	
 	public string PersonName

Modified: trunk/src/eventType.cs
==============================================================================
--- trunk/src/eventType.cs	(original)
+++ trunk/src/eventType.cs	Tue Jan 27 17:19:44 2009
@@ -43,6 +43,10 @@
 		longDescription = ""; //needed initalization because is not defined in lots of events
 	}
 
+	public override string ToString() {
+		return type + ", " + name + ", " + isPredefined + ", " + description;
+	}
+
 	public Types Type
 	{
 		get { return type; }
@@ -67,6 +71,7 @@
 	public string Description
 	{
 		get { return description; }
+		set { description = value; }
 	}
 	
 	public string LongDescription

Modified: trunk/src/exportSession.cs
==============================================================================
--- trunk/src/exportSession.cs	(original)
+++ trunk/src/exportSession.cs	Tue Jan 27 17:19:44 2009
@@ -166,10 +166,10 @@
 		myPersons = SqlitePersonSession.SelectCurrentSession(mySession.UniqueID, false, false); //not onlyIDAndName, not reversed
 		myJumps= SqliteJump.SelectJumps(mySession.UniqueID, -1, "");
 		myJumpsRj = SqliteJumpRj.SelectJumps(mySession.UniqueID, -1, "");
-		myRuns= SqliteRun.SelectAllRuns(mySession.UniqueID);
-		myRunsInterval = SqliteRunInterval.SelectAllRuns(mySession.UniqueID);
-		myReactionTimes = SqliteReactionTime.SelectAllReactionTimes(mySession.UniqueID);
-		myPulses = SqlitePulse.SelectAllPulses(mySession.UniqueID);
+		myRuns= SqliteRun.SelectAllRuns(mySession.UniqueID, -1);
+		myRunsInterval = SqliteRunInterval.SelectAllRuns(mySession.UniqueID, -1);
+		myReactionTimes = SqliteReactionTime.SelectAllReactionTimes(mySession.UniqueID, -1);
+		myPulses = SqlitePulse.SelectAllPulses(mySession.UniqueID, -1);
 	}
 
 	protected virtual void printTitles(string title) {

Modified: trunk/src/gui/chronojump.cs
==============================================================================
--- trunk/src/gui/chronojump.cs	(original)
+++ trunk/src/gui/chronojump.cs	Tue Jan 27 17:19:44 2009
@@ -58,8 +58,7 @@
 	[Widget] Gtk.ComboBox combo_runs_interval;
 	[Widget] Gtk.ComboBox combo_pulses;
 
-	[Widget] Gtk.MenuItem menuitem_server_insert_session;
-	[Widget] Gtk.MenuItem menuitem_server_insert_person;
+	[Widget] Gtk.MenuItem menuitem_server_upload_session;
 
 	[Widget] Gtk.MenuItem menuitem_edit_selected_jump;
 	[Widget] Gtk.MenuItem menuitem_delete_selected_jump;
@@ -123,6 +122,7 @@
 	[Widget] Gtk.Button button_run_interval_by_laps;
 	[Widget] Gtk.Button button_run_interval_by_time;
 	[Widget] Gtk.Button button_run_interval_unlimited;
+	[Widget] Gtk.Button button_run_interval_mtgug;
 	[Widget] Gtk.Button button_reaction_time_execute;
 	[Widget] Gtk.Button button_pulse_free;
 	[Widget] Gtk.Button button_pulse_custom;
@@ -173,6 +173,7 @@
 	[Widget] Gtk.MenuItem menuitem_run_interval_by_laps;
 	[Widget] Gtk.MenuItem menuitem_run_interval_by_time;
 	[Widget] Gtk.MenuItem menuitem_run_interval_unlimited;
+	[Widget] Gtk.MenuItem menuitem_run_interval_mtgug;
 
 	[Widget] Gtk.Button button_edit_current_person;
 	[Widget] Gtk.MenuItem menuitem_edit_current_person;
@@ -205,24 +206,6 @@
 	[Widget] Gtk.Image image_reaction_time_delete;
 	[Widget] Gtk.Image image_pulse_delete;
 
-	/*	
-	[Widget] Gtk.Image image_tv_collapse;
-	[Widget] Gtk.Image image_tv_rj_collapse;
-	[Widget] Gtk.Image image_tv_run_collapse;
-	[Widget] Gtk.Image image_tv_run_interval_collapse;
-	[Widget] Gtk.Image image_reaction_time_collapse;
-	[Widget] Gtk.Image image_pulse_collapse;
-	[Widget] Gtk.Image image_tv_expand;
-	[Widget] Gtk.Image image_tv_rj_expand;
-	[Widget] Gtk.Image image_tv_run_expand;
-	[Widget] Gtk.Image image_tv_run_interval_expand;
-	[Widget] Gtk.Image image_reaction_time_expand;
-	[Widget] Gtk.Image image_pulse_expand;
-	[Widget] Gtk.Image image_tv_rj_fit;
-	[Widget] Gtk.Image image_tv_run_interval_fit;
-	[Widget] Gtk.Image image_pulse_fit;
-	*/
-	
 	[Widget] Gtk.Image image_jumps_zoom;
 	[Widget] Gtk.Image image_jumps_rj_zoom;
 	[Widget] Gtk.Image image_runs_zoom;
@@ -338,6 +321,8 @@
 	ChronopicConnection chronopicWin;
 	GenericWindow genericWin;
 	
+	SessionUploadWindow sessionUploadWin;
+
 	static EventExecuteWindow eventExecuteWin;
 
 	//platform state variables
@@ -361,8 +346,8 @@
 	
 	private bool preferencesLoaded;
 
-	private string progversion;
-	private string progname;
+	private string progVersion;
+	private string progName;
 
 	private string runningFileName; //useful for knowing if there are two chronojump instances
 
@@ -407,10 +392,10 @@
 	}
 */
 	
-	public ChronoJumpWindow(string progversion, string progname, string runningFileName)
+	public ChronoJumpWindow(string progVersion, string progName, string runningFileName)
 	{
-		this.progversion = progversion;
-		this.progname = progname;
+		this.progVersion = progVersion;
+		this.progName = progName;
 		this.runningFileName = runningFileName;
 
 		Glade.XML gxml;
@@ -457,13 +442,13 @@
 		createComboPulses();
 		createdStatsWin = false;
 
-
-
+		
 		repetitiveConditionsWin = RepetitiveConditionsWindow.Create();
 
+
 		//We have no session, mark some widgets as ".Sensitive = false"
 		sensitiveGuiNoSession();
-
+		
 		//if(recuperatedString == "")
 			appbar2.Push ( 1, Catalog.GetString ("Ready.") );
 		//else
@@ -473,6 +458,9 @@
 		//volumeOn = true;
 	
 		putNonStandardIcons();	
+	
+		//connect to server to Ping
+		serverPing(true, false); //do insertion, don't display message to user
 		
 		if(chronopicPort != Constants.ChronopicDefaultPortWindows &&
 			chronopicPort != Constants.ChronopicDefaultPortLinux) {
@@ -495,8 +483,6 @@
 
 	private void putNonStandardIcons() {
 		Pixbuf pixbuf;
-		//pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "audio-volume-high.png");
-		//image_volume.Pixbuf = pixbuf;
 		
 		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "stock_bell.png");
 		image_jump_reactive_bell.Pixbuf = pixbuf;
@@ -517,29 +503,6 @@
 		
 		//zoom icons, done like this because there's one zoom icon created ad-hoc, 
 		//and is not nice that the other are different for an user theme change
-
-		/*
-		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameZoomOutIcon);
-		image_tv_collapse.Pixbuf = pixbuf;
-		image_tv_rj_collapse.Pixbuf = pixbuf;
-		image_tv_run_collapse.Pixbuf = pixbuf;
-		image_tv_run_interval_collapse.Pixbuf = pixbuf;
-		image_reaction_time_collapse.Pixbuf = pixbuf;
-		image_pulse_collapse.Pixbuf = pixbuf;
-
-		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameZoomInIcon);
-		image_tv_expand.Pixbuf = pixbuf;
-		image_tv_rj_expand.Pixbuf = pixbuf;
-		image_tv_run_expand.Pixbuf = pixbuf;
-		image_tv_run_interval_expand.Pixbuf = pixbuf;
-		image_reaction_time_expand.Pixbuf = pixbuf;
-		image_pulse_expand.Pixbuf = pixbuf;
-
-		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameZoomFitIcon);
-		image_tv_rj_fit.Pixbuf = pixbuf;
-		image_tv_run_interval_fit.Pixbuf = pixbuf;
-		image_pulse_fit.Pixbuf = pixbuf;
-		*/
 	
 		pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameZoomFitIcon);
 		image_jumps_zoom.Pixbuf = pixbuf;
@@ -752,7 +715,7 @@
 		report.PrefsDigitsNumber = prefsDigitsNumber;
 		report.HeightPreferred = heightPreferred;
 		report.WeightStatsPercent = weightPercentPreferred;
-		report.Progversion = progversion;
+		report.Progversion = progVersion;
 		
 		
 		Log.WriteLine ( Catalog.GetString ("Preferences loaded") );
@@ -819,7 +782,7 @@
 				}
 			} else if(myTv == treeview_runs_interval) {
 				if (myTreeViewRunsInterval.EventSelectedID > 0) {
-					RunInterval myRun = SqliteRunInterval.SelectRunData( "runInterval", myTreeViewRunsInterval.EventSelectedID );
+					RunInterval myRun = SqliteRunInterval.SelectRunData( Constants.RunIntervalTable, myTreeViewRunsInterval.EventSelectedID );
 					treeviewRunsIntervalContextMenu(myRun);
 				}
 			} else if(myTv == treeview_reaction_times) {
@@ -918,15 +881,6 @@
 		myItem.Activated += on_delete_current_person_from_session_activate;
 		myMenu.Attach( myItem, 0, 1, 3, 4 );
 
-		/*
-		Gtk.SeparatorMenuItem mySep2 = new SeparatorMenuItem();
-		myMenu.Attach( mySep2, 0, 1, 4, 5 );
-
-		myItem = new MenuItem ( "Upload to server (experimental)");
-		myItem.Activated += on_person_upload_to_server_activate;
-		myMenu.Attach( myItem, 0, 1, 5, 6 );
-		*/
-
 		myMenu.Popup();
 		myMenu.ShowAll();
 	}
@@ -935,154 +889,559 @@
 	 * ----------------  SERVER CALLS --------------------------
 	 *  --------------------------------------------------------
 	 */
+	
+	bool serverSessionError;
+	bool needUpdateServerSession;
+	bool updatingServerSession;
+	SessionUploadPersonData sessionUploadPersonData;
+
+	/* 
+	 * SERVER CALLBACKS
+	 */
 
 	// upload session and it's persons (callback)
-	private void on_menuitem_server_insert_session (object o, EventArgs args) 
+	private void on_menuitem_server_upload_session (object o, EventArgs args) 
 	{
 		int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
-		if(evalSID == Constants.ServerUndefinedID) {
-			new DialogMessage(Constants.MessageTypes.WARNING, "Evaluator not in server.\n Nothing done!.");
-			return;
-		}
-	
-		try {	
-			if(currentSession.ServerUniqueID == Constants.ServerUndefinedID) {
-				ChronojumpServer myServer = new ChronojumpServer();
+		if(evalSID == Constants.ServerUndefinedID) 
+			serverUploadEvaluator();
 
-				Log.WriteLine(myServer.ConnectDatabase());
+		if(!checkPersonsMissingData()) {
+			string message1 = ""; 
+			if(currentSession.ServerUniqueID == Constants.ServerUndefinedID) 
+				message1 =  
+						Catalog.GetString("Session will be uploaded to server.") + "\n" +  
+						Catalog.GetString("All names of persons in session will be hidden.") + "\n" + 
+						Catalog.GetString("You can upload again this session if you add more data or persons.");
+			else
+				message1 =  
+						Catalog.GetString("Session has been uploaded to server before.") + "\n" +  
+						Catalog.GetString("Uploading new data.");
+
+			ConfirmWindow confirmWin = ConfirmWindow.Show(message1, 
+						Catalog.GetString("Are you sure you want to upload this session to server?"));
+			confirmWin.Button_accept.Clicked += new EventHandler(on_server_upload_session_accepted);
+		}
+	}
 
-				ServerSession serverSession = new ServerSession(currentSession, evalSID, progversion, 
-						Util.GetOS(), Util.DateParse(DateTime.Now.ToString()), Constants.ServerSessionStates.UPLOADINGSESSION); 
+	private void on_menuitem_server_stats (object o, EventArgs args) {
+		try {
+			ChronojumpServer myServer = new ChronojumpServer();
+			Log.WriteLine(myServer.ConnectDatabase());
+			ArrayList stats = myServer.Stats();
+			Log.WriteLine(myServer.DisConnectDatabase());
 
-				int idAtServer = myServer.InsertSession(serverSession);
+			new DialogMessage(Constants.MessageTypes.INFO, "Stats in server:\n" + 
+					Util.ArrayListToSingleString(stats) + "\n" + Util.DateParse(DateTime.Now.ToString()));
+		} catch {
+			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+		}
+	}
+	
+	private void on_menuitem_server_ping (object o, EventArgs args) {
+		serverPing(true, true); //do insertion, display message to user
+	}
 
-				Log.WriteLine(myServer.DisConnectDatabase());
+	/* 
+	 * SERVER THREAD GTK
+	 */
+	
+	private bool PulseGTKServer ()
+	{
+		if(! thread.IsAlive) {
+			sessionUploadWin.UploadFinished();
+			Log.Write("dying");
+			return false;
+		}
 
-				//update session (serverUniqueID) on client database
-				currentSession.ServerUniqueID = idAtServer;
-				SqliteSession.UpdateServerUniqueID(currentSession.UniqueID, currentSession.ServerUniqueID);
+		if (serverSessionError) {
+			new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("Error uploading session to server"));
+			return false;
+		}
 
-				new DialogMessage(Constants.MessageTypes.INFO, "Inserted (" + currentSession.UniqueID + ") " + 
-						" into server BD as ID: " + currentSession.ServerUniqueID);
+		//need to do this, if not it crashes because chronopicWin gets died by thread ending
+		sessionUploadWin = SessionUploadWindow.Show(app1);
 
-				myServer.UpdateSession(currentSession.ServerUniqueID, Constants.ServerSessionStates.UPLOADINGPERSONS); 
+		if(needUpdateServerSession && !updatingServerSession) {
+			//prevent that FillData is called again with same data
+			updatingServerSession = true;
+
+			//fill data
+			sessionUploadWin.FillData(sessionUploadPersonData);
+
+			//not need to update until there'm more data coming from the other thread
+			updatingServerSession = false;
+			needUpdateServerSession = false;
+		}
+		
+		Thread.Sleep (50);
+		Log.Write(thread.ThreadState.ToString());
+		return true;
+	}
+			
+	/* 
+	 * SERVER CODE
+	 */
 
-				//adding the persons
-				string [] myPersons = SqlitePersonSession.SelectCurrentSession(serverSession.UniqueID, true, false); //onlyIDAndName, not reversed
-				foreach(string personStr in myPersons) {
-					Person person = SqlitePersonSession.PersonSelect(Util.FetchID(personStr), serverSession.UniqueID); 
-					serverUploadPerson(person, false);
-				}
+	private bool checkPersonsMissingData() 
+	{
+		ArrayList impossibleWeight = new ArrayList(1);
+		ArrayList undefinedCountry = new ArrayList(1); //country is required for server
+		ArrayList undefinedSport = new ArrayList(1);
+		
+		ArrayList persons = SqlitePersonSession.SelectCurrentSessionPersons(currentSession.UniqueID);
+		foreach (Person person in persons) 
+		{
+			if(person.Weight <= 10 || person.Weight >= 300)
+				impossibleWeight.Add(person);
+			if(person.CountryID == Constants.CountryUndefinedID)
+				undefinedCountry.Add(person);
+			if(person.SportID == Constants.SportUndefinedID)
+				undefinedSport.Add(person);
+			//speciallity and level not required, because person gui obligates to select them when sport is selected
+		}
+
+		string weightString = "";
+		string countryString = "";
+		string sportString = "";
+
+		if(impossibleWeight.Count > 0) {
+			weightString += "\n\n" + Catalog.GetString("<b>Weight</b> of the following persons is not ok:") + "\n";
+			string separator = "";
+			foreach(Person person in impossibleWeight)
+				weightString += separator + person.Name + " (" + person.Weight + "Kg.)";
+				separator = ", ";
+		}
+
+		if(undefinedCountry.Count > 0) {
+			countryString += "\n\n" + Catalog.GetString("<b>Country</b> of the following persons is undefined:") + "\n";
+			string separator = "";
+			foreach(Person person in undefinedCountry) {
+				countryString += separator + person.Name;
+				separator = ", ";
+			}
+		}
 
-				myServer.UpdateSession(currentSession.ServerUniqueID, Constants.ServerSessionStates.UPLOADINGTESTS); 
-				
-			} else {
-				new DialogMessage(Constants.MessageTypes.WARNING, "(" + currentSession.UniqueID + ") " + 
-						" already exists in the BD as ID: " + currentSession.ServerUniqueID + ".\n Nothing done!.");
+		if(undefinedSport.Count > 0) {
+			sportString += "\n\n" + Catalog.GetString("<b>Sport</b> of the following persons is undefined:") + "\n";
+			string separator = "";
+			foreach(Person person in undefinedSport) {
+				sportString += separator + person.Name;
+				separator = ", ";
 			}
-		} catch {
-			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
 		}
 
+		if(weightString.Length > 0 || countryString.Length > 0 || sportString.Length > 0) {
+			new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("Please, fix this before uploading:") +
+						weightString + countryString + sportString);
+			return true; //data is missing
+		}
+		else
+			return false; //data is ok
+
 	}
 
-	//upload selected person (callback)
-	private void on_menuitem_server_insert_person (object o, EventArgs args) {
-		try {
-			//on_person_upload_to_server_activate(o, args);
-			serverUploadPerson(currentPerson, true);
-		} catch {
+
+	private void on_server_upload_session_accepted (object o, EventArgs args) 
+	{
+		if(serverPing(false, false)) { //don't do insertion, don't display message to user
+			serverSessionError = false;
+			needUpdateServerSession = false;
+			updatingServerSession = false;
+			sessionUploadPersonData = new SessionUploadPersonData();
+
+			thread = new Thread(new ThreadStart(on_server_upload_session_started));
+			GLib.Idle.Add (new GLib.IdleHandler (PulseGTKServer));
+			thread.Start(); 
+		} else {
 			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
 		}
 	}
 	
-	//upload a person
-	private void serverUploadPerson(Person person, bool showDialogIfOk) {
-		if(person.ServerUniqueID == Constants.ServerUndefinedID) {
+	//private void on_server_upload_session_started (object o, EventArgs args) 
+	private void on_server_upload_session_started () 
+	{
+		int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
 
+		try {	
 			ChronojumpServer myServer = new ChronojumpServer();
-
 			Log.WriteLine(myServer.ConnectDatabase());
-			Log.WriteLine(myServer.SelectPersonName(1));
+		
+			//create ServerSession based on Session currentSession
+			ServerSession serverSession = new ServerSession(currentSession, evalSID, progName + " " + progVersion, 
+					Util.GetOS(), Util.DateParse(DateTime.Now.ToString()), Constants.ServerSessionStates.UPLOADINGSESSION); 
+
+			//if uploading session for first time
+			if(currentSession.ServerUniqueID == Constants.ServerUndefinedID) 
+			{
+				//upload ServerSession
+				int idAtServer = myServer.UploadSession(serverSession);
 
-			//this inserts also in personSession using client session
-			//this maybe have to be changed in future to server session
+				//update session currentSession (serverUniqueID) on client database
+				currentSession.ServerUniqueID = idAtServer;
+				SqliteSession.UpdateServerUniqueID(currentSession.UniqueID, currentSession.ServerUniqueID);
+			}
 
-			int idAtServer = myServer.InsertPerson(person, currentSession.UniqueID);
+			myServer.UpdateSession(currentSession.ServerUniqueID, Constants.ServerSessionStates.UPLOADINGDATA); 
 
-			Log.WriteLine(myServer.DisConnectDatabase());
+			//upload persons (updating also person.serverUniqueID locally)
+			string [] myPersons = SqlitePersonSession.SelectCurrentSession(serverSession.UniqueID, true, false); //onlyIDAndName, not reversed
+			Constants.UploadCodes uCode;
+			foreach(string personStr in myPersons) {
+				Person person = SqlitePersonSession.PersonSelect(Util.FetchID(personStr), serverSession.UniqueID); 
+				//check person if exists
+				if(person.ServerUniqueID != Constants.ServerUndefinedID) 
+					uCode = Constants.UploadCodes.EXISTS;
+				else {
+					uCode = Constants.UploadCodes.OK;
+
+					//if sport is user defined, upload it
+					//and when upload the person, do it with new sportID
+					Sport sport = SqliteSport.Select(person.SportID);
+					if(sport.UserDefined) 
+						person.SportID = myServer.UploadSport(sport);
 
-			//update person (serverUniqueID) on client database
-			person.ServerUniqueID = idAtServer;
-			SqlitePerson.Update(person);
-
-			if(showDialogIfOk)
-				new DialogMessage(Constants.MessageTypes.INFO, "Inserted (" + person.UniqueID + ") " + 
-						person.Name + " into server BD as ID: " + idAtServer);
-		} else {
-			new DialogMessage(Constants.MessageTypes.WARNING, "(" + person.UniqueID + ") " + 
-					person.Name + " already exists in the BD as ID: " + person.ServerUniqueID + ".\n Nothing done!.");
+					person = serverUploadPerson(myServer, person, serverSession.UniqueID);
+				}
+
+				//a person can be in the database for one session, 
+				//but maybe now we add jumps from another session and we should add an entry at personsessionweight
+				serverUploadPersonSessionIfNeeded(myServer, person.ServerUniqueID, currentSession.ServerUniqueID, person.Weight);
+
+				//other thread updates the gui:
+				sessionUploadPersonData.person = person;
+				sessionUploadPersonData.personCode = uCode;
+
+				//upload jumps
+				int countU = 0;					
+				int countE = 0;					
+				int countS = 0;					
+
+				string [] jumps = SqliteJump.SelectJumps(currentSession.UniqueID, person.UniqueID, "");
+				foreach(string myJump in jumps) {
+					string [] js = myJump.Split(new char[] {':'});
+					//select jump
+					Jump test = SqliteJump.SelectJumpData(Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+
+					//if test is not simulated and has not been uploaded,
+					//see if it's type is not predefined and is not in the database
+					//then upload it first
+					if(test.Simulated == 0) {
+						//upload jumpType if is user defined and doesn't exists in server database
+						//JumpType type = new JumpType(test.Type);
+						JumpType type = SqliteJumpType.SelectAndReturnJumpType(test.Type);
+						if( ! type.IsPredefined) {
+							//Console.WriteLine("USER DEFINED TEST: " + test.Type);
+							//
+							//this uploads the new type, as it's user created, it will be like this
+							//eg: for user defined jumpType: "supra" of evaluatorServerID: 9
+							//at server will be "supra-9"
+							//then two problems get solved:
+							//1.- every evaluator that uploads a type will have a different name 
+							//than other evaluator uploading a type that is named the same but could be different 
+							//(one can think that "supra" is another thing
+							//2- when the same evaluator upload some supra's, only a new type is created
+					
+							test.Type = myServer.UploadJumpType(type, evalSID);
+					
+							//test.Type in the server will have the correct name "supra-9" 
+						}
+					}
+
+					//upload... (if not because of simulated or uploaded before, report also the user)
+					uCode = serverUploadTest(myServer, Constants.TestTypes.JUMP, Constants.JumpTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.jumpsU = countU;
+				sessionUploadPersonData.jumpsE = countE;
+				sessionUploadPersonData.jumpsS = countS;
+
+				//upload jumpsRj
+				countU = 0;					
+				countE = 0;					
+				countS = 0;					
+
+				string [] jumpsRj = SqliteJumpRj.SelectJumps(currentSession.UniqueID, person.UniqueID, "");
+				foreach(string myJump in jumpsRj) {
+					string [] js = myJump.Split(new char[] {':'});
+					//select jump
+					JumpRj test = SqliteJumpRj.SelectJumpData(Constants.JumpRjTable, Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+					//upload...
+					uCode = serverUploadTest(myServer, Constants.TestTypes.JUMP_RJ, Constants.JumpRjTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.jumpsRjU = countU;
+				sessionUploadPersonData.jumpsRjE = countE;
+				sessionUploadPersonData.jumpsRjS = countS;
+
+				//upload runs
+				countU = 0;					
+				countE = 0;					
+				countS = 0;					
+
+				string [] runs = SqliteRun.SelectAllRuns(currentSession.UniqueID, person.UniqueID);
+				foreach(string myRun in runs) {
+					string [] js = myRun.Split(new char[] {':'});
+					//select run
+					Run test = SqliteRun.SelectRunData(Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+					//upload...
+					uCode = serverUploadTest(myServer, Constants.TestTypes.RUN, Constants.RunTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.runsU = countU;
+				sessionUploadPersonData.runsE = countE;
+				sessionUploadPersonData.runsS = countS;
+
+				//upload runs intervallic
+				countU = 0;					
+				countE = 0;					
+				countS = 0;					
+
+				string [] runsI = SqliteRunInterval.SelectAllRuns(currentSession.UniqueID, person.UniqueID);
+				foreach(string myRun in runsI) {
+					string [] js = myRun.Split(new char[] {':'});
+					//select run
+					RunInterval test = SqliteRunInterval.SelectRunData(Constants.RunIntervalTable, Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+					//upload...
+					uCode = serverUploadTest(myServer, Constants.TestTypes.RUN_I, Constants.RunIntervalTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.runsIU = countU;
+				sessionUploadPersonData.runsIE = countE;
+				sessionUploadPersonData.runsIS = countS;
+
+				//upload reaction times
+				countU = 0;					
+				countE = 0;					
+				countS = 0;					
+
+				string [] rts = SqliteReactionTime.SelectAllReactionTimes(currentSession.UniqueID, person.UniqueID);
+				foreach(string myRt in rts) {
+					string [] js = myRt.Split(new char[] {':'});
+					//select rt
+					ReactionTime test = SqliteReactionTime.SelectReactionTimeData(Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+					//upload...
+					uCode = serverUploadTest(myServer, Constants.TestTypes.RT, Constants.ReactionTimeTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.rtsU = countU;
+				sessionUploadPersonData.rtsE = countE;
+				sessionUploadPersonData.rtsS = countS;
+
+				//upload pulses
+				countU = 0;					
+				countE = 0;					
+				countS = 0;					
+
+				string [] pulses = SqlitePulse.SelectAllPulses(currentSession.UniqueID, person.UniqueID);
+				foreach(string myPulse in pulses) {
+					string [] js = myPulse.Split(new char[] {':'});
+					//select pulse
+					Pulse test = SqlitePulse.SelectPulseData(Convert.ToInt32(js[1])); //uniqueID
+					//fix it to server person, session keys
+					test.PersonID = person.ServerUniqueID;
+					test.SessionID = currentSession.ServerUniqueID;
+					//upload...
+					uCode = serverUploadTest(myServer, Constants.TestTypes.PULSE, Constants.PulseTable, test);
+
+					if(uCode == Constants.UploadCodes.OK)
+						countU ++;
+					else if(uCode == Constants.UploadCodes.EXISTS)
+						countE ++;
+					else //SIMULATED
+						countS ++;
+				}
+
+				//other thread updates the gui:
+				sessionUploadPersonData.pulsesU = countU;
+				sessionUploadPersonData.pulsesE = countE;
+				sessionUploadPersonData.pulsesS = countS;
+
+				needUpdateServerSession = true;
+				while(needUpdateServerSession) {
+					//wait until data is printed on the other thread
+				}
+
+			}
+
+			myServer.UpdateSession(currentSession.ServerUniqueID, Constants.ServerSessionStates.DONE); 
+
+			Log.WriteLine(myServer.DisConnectDatabase());
+		} catch {
+			//other thread updates the gui:
+			serverSessionError = true;
 		}
 	}
+	
+	//upload a person
+	private Person serverUploadPerson(ChronojumpServer myServer, Person person, int serverSessionID) 
+	{
+		int idAtServer = myServer.UploadPerson(person, serverSessionID);
 
-	/*
-	private void on_person_upload_to_server_activate (object o, EventArgs args) 
+		//update person (serverUniqueID) on client database
+		person.ServerUniqueID = idAtServer;
+		SqlitePerson.Update(person);
+
+		return person;
+	}
+	
+	private void serverUploadPersonSessionIfNeeded(ChronojumpServer myServer, int personServerID, int sessionServerID, int weight)
 	{
-		serverUploadPerson(currentPerson);
+		myServer.UploadPersonSessionIfNeeded(personServerID, sessionServerID, weight);
 	}
-	*/
 
-	private void on_menuitem_server_stats (object o, EventArgs args) {
-		try {
-			ChronojumpServer myServer = new ChronojumpServer();
-			Log.WriteLine(myServer.ConnectDatabase());
-			ArrayList stats = myServer.Stats();
-			Log.WriteLine(myServer.DisConnectDatabase());
+	//upload a test
+	private Constants.UploadCodes serverUploadTest(ChronojumpServer myServer, Constants.TestTypes type, string tableName, Event myTest) 
+	{
+		Constants.UploadCodes uCode;
 
-			new DialogMessage(Constants.MessageTypes.INFO, "Stats in server:\n" + 
-					Util.ArrayListToSingleString(stats) + "\n" + Util.DateParse(DateTime.Now.ToString()));
-		} catch {
-			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+		if(myTest.Simulated == Constants.Simulated) {
+			//Test is simulated, don't upload
+			uCode = Constants.UploadCodes.SIMULATED;
+		} else if(myTest.Simulated > 0) {
+			//Test is already uploaded, don't upload
+			uCode = Constants.UploadCodes.EXISTS;
+		} else {
+			int idAtServer = -1;
+			
+			switch (type) {
+				case Constants.TestTypes.JUMP:
+					idAtServer = myServer.UploadJump((Jump) myTest);
+					break;
+				case Constants.TestTypes.JUMP_RJ:
+					idAtServer = myServer.UploadJumpRj((JumpRj) myTest);
+					break;
+				case Constants.TestTypes.RUN:
+					idAtServer = myServer.UploadRun((Run) myTest);
+					break;
+				case Constants.TestTypes.RUN_I:
+					idAtServer = myServer.UploadRunI((RunInterval) myTest);
+					break;
+				case Constants.TestTypes.RT:
+					idAtServer = myServer.UploadRT((ReactionTime) myTest);
+					break;
+				case Constants.TestTypes.PULSE:
+					idAtServer = myServer.UploadPulse((Pulse) myTest);
+					break;
+			}
+
+			//update test (simulated) on client database
+			myTest.Simulated = idAtServer;
+			SqliteEvent.UpdateSimulated(false, tableName, myTest.UniqueID, idAtServer);
+			
+			uCode = Constants.UploadCodes.OK;
 		}
+		return uCode;
 	}
-	
 
-	private void on_menuitem_server_see_all (object o, EventArgs args) {
+	private bool serverPing(bool doInsertion, bool showMessage) {
 		try {
 			ChronojumpServer myServer = new ChronojumpServer();
 			Log.WriteLine(myServer.ConnectDatabase());
-			ArrayList persons = myServer.SelectAllPersons();
+		
+			int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
+
+			ServerPing myPing = new ServerPing(evalSID, progName + " " + progVersion, Util.GetOS(), Constants.IPUnknown, Util.DateParse(DateTime.Now.ToString())); //evaluator, ip, date
+			//if !doIsertion nothing will be uploaded,
+			//is ok for uploadPerson to know if server is online
+			myPing.UniqueID = myServer.UploadPing(myPing, doInsertion);
+			
 			Log.WriteLine(myServer.DisConnectDatabase());
 
-			new DialogMessage(Constants.MessageTypes.INFO, "Persons in server:\n" + Util.ArrayListToSingleString(persons));
+			if(showMessage)
+				new DialogMessage(Constants.MessageTypes.INFO, "Uploaded" + myPing.ToString());
+
+			return true; //connected
 		} catch {
-			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+			if(showMessage)
+				new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
+			
+			return false;
 		}
-	}
-	
-	private void on_menuitem_server_ping (object o, EventArgs args) {
+	}	
+
+	private void serverUploadEvaluator () {
 		try {
 			ChronojumpServer myServer = new ChronojumpServer();
 			Log.WriteLine(myServer.ConnectDatabase());
-		
-			int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
+			
+			//get Data, TODO: do it in a gui/window
+			ServerEvaluator myEval = new ServerEvaluator("myName", "myEmail", "myDateBorn", Constants.CountryUndefinedID, false);
+			//upload
+			myEval.UniqueID = myServer.UploadEvaluator(myEval);
+			//update evaluatorServerID locally
+			SqlitePreferences.Update("evaluatorServerID", myEval.UniqueID.ToString(), false);
 
-			ServerPing myPing = new ServerPing(evalSID, progversion, Util.GetOS(), Constants.IPUnknown, Util.DateParse(DateTime.Now.ToString())); //evaluator, ip, date
-			myPing.UniqueID = myServer.InsertPing(myPing);
+			new DialogMessage(Constants.MessageTypes.INFO, "Uploaded with ID: " + myEval.UniqueID);
 			
 			Log.WriteLine(myServer.DisConnectDatabase());
-
-			new DialogMessage(Constants.MessageTypes.INFO, "Inserted" + myPing.ToString());
 		} catch {
 			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
 		}
 	}
 
-	private void on_menuitem_server_insert_evaluator (object o, EventArgs args) {
+	/*
+	private void on_menuitem_server_upload_evaluator (object o, EventArgs args) {
 		try {
 			ChronojumpServer myServer = new ChronojumpServer();
 			Log.WriteLine(myServer.ConnectDatabase());
 			
+
 			int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
 			if(evalSID != Constants.ServerUndefinedID) {
 				//exists, nothing done
@@ -1093,12 +1452,12 @@
 			} else {
 				//get Data, TODO: do it in a gui/window
 				ServerEvaluator myEval = new ServerEvaluator("myName", "myEmail", "myDateBorn", Constants.CountryUndefinedID, false);
-				//insert
-				myEval.UniqueID = myServer.InsertEvaluator(myEval);
+				//upload
+				myEval.UniqueID = myServer.UploadEvaluator(myEval);
 				//update evaluatorServerID locally
 				SqlitePreferences.Update("evaluatorServerID", myEval.UniqueID.ToString(), false);
 
-				new DialogMessage(Constants.MessageTypes.INFO, "Inserted with ID: " + myEval.UniqueID);
+				new DialogMessage(Constants.MessageTypes.INFO, "Uploaded with ID: " + myEval.UniqueID);
 			}
 			
 			Log.WriteLine(myServer.DisConnectDatabase());
@@ -1106,7 +1465,7 @@
 			new DialogMessage(Constants.MessageTypes.WARNING, Constants.ServerOffline);
 		}
 	}
-
+	*/
 	
 
 	/* ---------------------------------------------------------
@@ -1140,20 +1499,6 @@
 			treeview_jumps.ExpandAll();
 	}
 	
-	/*
-	private void on_button_tv_collapse_clicked (object o, EventArgs args) {
-		myTreeViewJumps.ExpandState = 
-			TreeViewEvent.ExpandStates.MINIMIZED;
-		treeview_jumps.CollapseAll();
-	}
-	
-	private void on_button_tv_expand_clicked (object o, EventArgs args) {
-		myTreeViewJumps.ExpandState = 
-			TreeViewEvent.ExpandStates.MAXIMIZED;
-		treeview_jumps.ExpandAll();
-	}
-	*/
-
 	private void treeview_jumps_storeReset() {
 		myTreeViewJumps.RemoveColumns();
 		
@@ -1223,27 +1568,6 @@
 			treeview_jumps_rj.ExpandAll();
 	}
 
-	/*	
-	private void on_button_tv_rj_collapse_clicked (object o, EventArgs args) {
-		myTreeViewJumpsRj.ExpandState = 
-			TreeViewEvent.ExpandStates.MINIMIZED;
-		treeview_jumps_rj.CollapseAll();
-	}
-	
-	private void on_button_tv_rj_optimal_clicked (object o, EventArgs args) {
-		myTreeViewJumpsRj.ExpandState = 
-			TreeViewEvent.ExpandStates.OPTIMAL;
-		treeview_jumps_rj.CollapseAll();
-		myTreeViewJumpsRj.ExpandOptimal();
-	}
-	
-	private void on_button_tv_rj_expand_clicked (object o, EventArgs args) {
-		myTreeViewJumpsRj.ExpandState = 
-			TreeViewEvent.ExpandStates.MAXIMIZED;
-		treeview_jumps_rj.ExpandAll();
-	}
-	*/
-
 	private void treeview_jumps_rj_storeReset() {
 		myTreeViewJumpsRj.RemoveColumns();
 		myTreeViewJumpsRj = new TreeViewJumpsRj( treeview_jumps_rj, showHeight, showInitialSpeed, showQIndex, showDjIndex, prefsDigitsNumber, weightPercentPreferred, metersSecondsPreferred, myTreeViewJumpsRj.ExpandState );
@@ -1300,7 +1624,7 @@
 	}
 
 	private void fillTreeView_runs (string filter) {
-		string [] myRuns = SqliteRun.SelectAllRuns(currentSession.UniqueID);
+		string [] myRuns = SqliteRun.SelectAllRuns(currentSession.UniqueID, -1);
 		myTreeViewRuns.Fill(myRuns, filter);
 
 		expandOrMinimizeTreeView((TreeViewEvent) myTreeViewRuns, treeview_runs);
@@ -1315,20 +1639,6 @@
 			treeview_runs.ExpandAll();
 	}
 	
-	/*
-	private void on_button_tv_run_collapse_clicked (object o, EventArgs args) {
-		myTreeViewRuns.ExpandState = 
-			TreeViewEvent.ExpandStates.MINIMIZED;
-		treeview_runs.CollapseAll();
-	}
-	
-	private void on_button_tv_run_expand_clicked (object o, EventArgs args) {
-		myTreeViewRuns.ExpandState = 
-			TreeViewEvent.ExpandStates.MAXIMIZED;
-		treeview_runs.ExpandAll();
-	}
-	*/
-	
 	private void treeview_runs_storeReset() {
 		myTreeViewRuns.RemoveColumns();
 		myTreeViewRuns = new TreeViewRuns( treeview_runs, prefsDigitsNumber, metersSecondsPreferred, myTreeViewRuns.ExpandState );
@@ -1378,7 +1688,7 @@
 	}
 
 	private void fillTreeView_runs_interval (string filter) {
-		string [] myRuns = SqliteRunInterval.SelectAllRuns(currentSession.UniqueID);
+		string [] myRuns = SqliteRunInterval.SelectAllRuns(currentSession.UniqueID, -1);
 		myTreeViewRunsInterval.Fill(myRuns, filter);
 		expandOrMinimizeTreeView((TreeViewEvent) myTreeViewRunsInterval, treeview_runs_interval);
 	}
@@ -1394,27 +1704,6 @@
 			treeview_runs_interval.ExpandAll();
 	}
 
-	/*
-	private void on_button_tv_run_interval_collapse_clicked (object o, EventArgs args) {
-		myTreeViewRunsInterval.ExpandState = 
-			TreeViewEvent.ExpandStates.MINIMIZED;
-		treeview_runs_interval.CollapseAll();
-	}
-	
-	private void on_button_tv_run_interval_optimal_clicked (object o, EventArgs args) {
-		myTreeViewRunsInterval.ExpandState = 
-			TreeViewEvent.ExpandStates.OPTIMAL;
-		treeview_runs_interval.CollapseAll();
-		myTreeViewRunsInterval.ExpandOptimal();
-	}
-	
-	private void on_button_tv_run_interval_expand_clicked (object o, EventArgs args) {
-		myTreeViewRunsInterval.ExpandState = 
-			TreeViewEvent.ExpandStates.MAXIMIZED;
-		treeview_runs_interval.ExpandAll();
-	}
-	*/
-
 	private void treeview_runs_interval_storeReset() {
 		myTreeViewRunsInterval.RemoveColumns();
 		myTreeViewRunsInterval = new TreeViewRunsInterval( treeview_runs_interval,  
@@ -1473,7 +1762,7 @@
 
 	//private void fillTreeView_reaction_times (string filter) {
 	private void fillTreeView_reaction_times () {
-		string [] myRTs = SqliteReactionTime.SelectAllReactionTimes(currentSession.UniqueID);
+		string [] myRTs = SqliteReactionTime.SelectAllReactionTimes(currentSession.UniqueID, -1);
 		myTreeViewReactionTimes.Fill(myRTs, "");
 		expandOrMinimizeTreeView((TreeViewEvent) myTreeViewReactionTimes, treeview_reaction_times);
 	}
@@ -1487,20 +1776,6 @@
 			treeview_reaction_times.ExpandAll();
 	}
 	
-	/*
-	private void on_button_reaction_time_collapse_clicked (object o, EventArgs args) {
-		myTreeViewReactionTimes.ExpandState = 
-			TreeViewEvent.ExpandStates.MINIMIZED;
-		treeview_reaction_times.CollapseAll();
-	}
-	
-	private void on_button_reaction_time_expand_clicked (object o, EventArgs args) {
-		myTreeViewReactionTimes.ExpandState = 
-			TreeViewEvent.ExpandStates.MAXIMIZED;
-		treeview_reaction_times.ExpandAll();
-	}
-	*/
-
 	private void treeview_reaction_times_storeReset() {
 		myTreeViewReactionTimes.RemoveColumns();
 		myTreeViewReactionTimes = new TreeViewReactionTimes( treeview_reaction_times, prefsDigitsNumber, myTreeViewReactionTimes.ExpandState );
@@ -1550,7 +1825,7 @@
 	}
 
 	private void fillTreeView_pulses (string filter) {
-		string [] myPulses = SqlitePulse.SelectAllPulses(currentSession.UniqueID);
+		string [] myPulses = SqlitePulse.SelectAllPulses(currentSession.UniqueID, -1);
 		myTreeViewPulses.Fill(myPulses, filter);
 		expandOrMinimizeTreeView((TreeViewEvent) myTreeViewPulses, treeview_pulses);
 	}
@@ -1566,27 +1841,6 @@
 			treeview_pulses.ExpandAll();
 	}
 
-	/*
-	private void on_button_pulse_collapse_clicked (object o, EventArgs args) {
-		myTreeViewPulses.ExpandState = 
-			TreeViewEvent.ExpandStates.MINIMIZED;
-		treeview_pulses.CollapseAll();
-	}
-	
-	private void on_button_pulse_optimal_clicked (object o, EventArgs args) {
-		myTreeViewPulses.ExpandState = 
-			TreeViewEvent.ExpandStates.OPTIMAL;
-		treeview_pulses.CollapseAll();
-		myTreeViewPulses.ExpandOptimal();
-	}
-	
-	private void on_button_pulse_expand_clicked (object o, EventArgs args) {
-		myTreeViewPulses.ExpandState = 
-			TreeViewEvent.ExpandStates.MAXIMIZED;
-		treeview_pulses.ExpandAll();
-	}
-	*/
-
 	private void treeview_pulses_storeReset() {
 		myTreeViewPulses.RemoveColumns();
 		myTreeViewPulses = new TreeViewPulses( treeview_pulses, prefsDigitsNumber, myTreeViewPulses.ExpandState );
@@ -1822,7 +2076,7 @@
 			//serverUniqueID is undefined until session is updated
 			currentSession.ServerUniqueID = Constants.ServerUndefinedID;
 
-			app1.Title = progname + " - " + currentSession.Name;
+			app1.Title = progName + " - " + currentSession.Name;
 
 			if(createdStatsWin) {
 				statsWin.InitializeSession(currentSession);
@@ -1890,7 +2144,7 @@
 		if(sessionAddEditWin.CurrentSession != null) 
 		{
 			currentSession = sessionAddEditWin.CurrentSession;
-			app1.Title = progname + " - " + currentSession.Name;
+			app1.Title = progName + " - " + currentSession.Name;
 
 			if(createdStatsWin) {
 				statsWin.InitializeSession(currentSession);
@@ -1908,7 +2162,7 @@
 	private void on_load_session_accepted (object o, EventArgs args) {
 		currentSession = sessionLoadWin.CurrentSession;
 		//currentSession = SqliteSession.Select("1");
-		app1.Title = progname + " - " + currentSession.Name;
+		app1.Title = progName + " - " + currentSession.Name;
 		
 		if(createdStatsWin) {
 			statsWin.InitializeSession(currentSession);
@@ -1977,7 +2231,7 @@
 		SqliteSession.DeleteWithJumps(currentSession.UniqueID.ToString());
 		
 		sensitiveGuiNoSession();
-		app1.Title = progname + "";
+		app1.Title = progName + "";
 	}
 
 	
@@ -2564,6 +2818,8 @@
 			currentEventType = new RunType("byTime");
 		} else 	if(o == (object) button_run_interval_unlimited) {
 			currentEventType = new RunType("unlimited");
+		} else 	if(o == (object) button_run_interval_mtgug) {
+			currentEventType = new RunType("MTGUG");
 		//reactionTime
 		//pulse
 		} else 	if(o == (object) button_pulse_free) {
@@ -3258,7 +3514,7 @@
 				runsIntervalMoreWin.SelectedLimitedValue,
 				runsIntervalMoreWin.SelectedUnlimited,
 				runsIntervalMoreWin.SelectedDescription,
-				SqliteEvent.GraphLinkSelectFileName("runInterval", runsMoreWin.SelectedEventName)
+				SqliteEvent.GraphLinkSelectFileName(Constants.RunIntervalTable, runsMoreWin.SelectedEventName)
 				);
 
 		bool unlimited = false;
@@ -3302,6 +3558,9 @@
 		} else if(o == (object) button_run_interval_unlimited || o == (object) menuitem_run_interval_unlimited) 
 		{
 			currentRunType = new RunType("unlimited");
+		} else if(o == (object) button_run_interval_mtgug || o == (object) menuitem_run_interval_mtgug) 
+		{
+			currentRunType = new RunType("MTGUG");
 		}
 		
 			
@@ -3356,7 +3615,7 @@
 			Catalog.GetString("Tracks"),  	  //name of the different moments
 			currentPerson.UniqueID, currentPerson.Name, 
 			currentSession.UniqueID, 
-			"runInterval", //tableName
+			Constants.RunIntervalTable, //tableName
 			currentRunType.Name, 
 			prefsDigitsNumber, myLimit, simulated);
 
@@ -3832,7 +4091,7 @@
 		//2.- check that this line is a run and not a person (check also if it's not a individual subrun, the pass the parent run)
 		if (myTreeViewRunsInterval.EventSelectedID > 0) {
 			//3.- obtain the data of the selected run
-			RunInterval myRun = SqliteRunInterval.SelectRunData( "runInterval", myTreeViewRunsInterval.EventSelectedID );
+			RunInterval myRun = SqliteRunInterval.SelectRunData( Constants.RunIntervalTable, myTreeViewRunsInterval.EventSelectedID );
 			eventOldPerson = myRun.PersonID;
 		
 			//4.- edit this run
@@ -3861,7 +4120,7 @@
 	private void on_edit_selected_run_interval_accepted (object o, EventArgs args) {
 		Log.WriteLine("edit selected run interval accepted");
 		
-		RunInterval myRun = SqliteRunInterval.SelectRunData( "runInterval", myTreeViewRunsInterval.EventSelectedID );
+		RunInterval myRun = SqliteRunInterval.SelectRunData( Constants.RunIntervalTable, myTreeViewRunsInterval.EventSelectedID );
 
 		//if person changed, fill treeview again, if not, only update it's line
 		if(eventOldPerson == myRun.PersonID)
@@ -4068,7 +4327,7 @@
 	private void on_delete_selected_run_interval_accepted (object o, EventArgs args) {
 		Log.WriteLine("accept delete selected run");
 		
-		SqliteRun.Delete( "runInterval", (myTreeViewRunsInterval.EventSelectedID).ToString() );
+		SqliteRun.Delete( Constants.RunIntervalTable, (myTreeViewRunsInterval.EventSelectedID).ToString() );
 		
 		appbar2.Push( 1, Catalog.GetString ( "Deleted intervallic run" ));
 	
@@ -4237,7 +4496,7 @@
 		//(check also if it's not a individual run interval, then pass the parent run interval)
 		if (myTreeViewRunsInterval.EventSelectedID > 0) {
 			//3.- obtain the data of the selected run
-			RunInterval myRun = SqliteRunInterval.SelectRunData( "runInterval", myTreeViewRunsInterval.EventSelectedID );
+			RunInterval myRun = SqliteRunInterval.SelectRunData( Constants.RunIntervalTable, myTreeViewRunsInterval.EventSelectedID );
 		
 			//4.- edit this run
 			repairRunIntervalWin = RepairRunIntervalWindow.Show(app1, myRun, prefsDigitsNumber);
@@ -4325,7 +4584,7 @@
 		if(translator_credits == "translator-credits") 
 			translator_credits = "";
 
-		new About(progversion, translator_credits);
+		new About(progVersion, translator_credits);
 	}
 
 	private void on_checkbutton_volume_clicked(object o, EventArgs args) {
@@ -4406,8 +4665,7 @@
 		
 //		button_last_delete.Sensitive = false;
 		
-		menuitem_server_insert_session.Sensitive = false;
-		menuitem_server_insert_person.Sensitive = false;
+		menuitem_server_upload_session.Sensitive = false;
 	}
 	
 	private void sensitiveGuiYesSession () {
@@ -4426,7 +4684,7 @@
 		menuitem_delete_session.Sensitive = true;
 		menu_persons.Sensitive = true;
 		
-		menuitem_server_insert_session.Sensitive = true;
+		menuitem_server_upload_session.Sensitive = true;
 	}
 
 	//only called by delete person functions (if we run out of persons)
@@ -4447,8 +4705,6 @@
 		
 		//menuitem_jump_type_add.Sensitive = false;
 //		button_last_delete.Sensitive = false;
-		
-		menuitem_server_insert_person.Sensitive = false;
 	}
 	
 	private void sensitiveGuiYesPerson () {
@@ -4473,8 +4729,6 @@
 		combo_runs.Sensitive = true;
 		combo_runs_interval.Sensitive = true;
 		combo_pulses.Sensitive = true;
-
-		menuitem_server_insert_person.Sensitive = true;
 	}
 	
 	private void sensitiveGuiYesEvent () {

Modified: trunk/src/gui/person.cs
==============================================================================
--- trunk/src/gui/person.cs	(original)
+++ trunk/src/gui/person.cs	Tue Jan 27 17:19:44 2009
@@ -657,6 +657,7 @@
 	private string sex = "M";
 	private int weightIni;
 	
+	private int serverUniqueID;
 	
 	//
 	//if we are adding a person, personID it's -1
@@ -702,7 +703,7 @@
 				UtilGtk.ComboGetActive(combo_sports) != Catalog.GetString(Constants.SportUndefined) &&
 				(! label_speciallity.Visible || UtilGtk.ComboGetActive(combo_speciallities) != Catalog.GetString(Constants.SpeciallityUndefined)) &&
 				Util.FetchID(UtilGtk.ComboGetActive(combo_levels)) != Constants.LevelUndefinedID 
-				//countries is not required
+				//countries is not required to create a person here, but will be required for server
 				//&& 
 				//UtilGtk.ComboGetActive(combo_continents) != Catalog.GetString(Constants.ContinentUndefined) &&
 				//UtilGtk.ComboGetActive(combo_countries) != Catalog.GetString(Constants.CountryUndefined)
@@ -899,6 +900,8 @@
 				combo_countries.Active = UtilGtk.ComboMakeActive(countriesTranslated, 
 						Catalog.GetString(countryString[1]));
 			}
+
+			serverUniqueID = myPerson.ServerUniqueID;
 		}
 			
 		sport = SqliteSport.Select(mySportID);
@@ -1088,7 +1091,7 @@
 							Catalog.GetString("Sorry, this sport '{0}' already exists in database"), 
 							newSportName));
 		else {
-			int myID = SqliteSport.Insert(false, newSportName, true, //dbconOpened, , userDefined
+			int myID = SqliteSport.Insert(false, "-1", newSportName, true, //dbconOpened, , userDefined
 					false, "");	//hasSpeciallities, graphLink 
 
 			Sport mySport = new Sport(myID, newSportName, true, 
@@ -1196,8 +1199,8 @@
 					textview2.Buffer.Text,
 					Constants.RaceUndefinedID,
 					Convert.ToInt32(Util.FindOnArray(':', 2, 0, UtilGtk.ComboGetActive(combo_countries), countries)),
-					currentPerson.ServerUniqueID);
-
+					serverUniqueID);
+			
 			SqlitePerson.Update (currentPerson); 
 		
 			//change weight if needed

Modified: trunk/src/gui/repetitiveConditions.cs
==============================================================================
--- trunk/src/gui/repetitiveConditions.cs	(original)
+++ trunk/src/gui/repetitiveConditions.cs	Tue Jan 27 17:19:44 2009
@@ -94,6 +94,9 @@
 		gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "repetitive_conditions", null);
 		gladeXML.Autoconnect(this);
 		
+		//don't show until View is called
+		repetitive_conditions.Hide ();
+
 		//put an icon to window
 		UtilGtk.IconWindow(repetitive_conditions);
 		
@@ -107,7 +110,7 @@
 		}
 	
 		//don't show until View is called
-		RepetitiveConditionsWindowBox.repetitive_conditions.Hide ();
+		//RepetitiveConditionsWindowBox.repetitive_conditions.Hide ();
 		
 		return RepetitiveConditionsWindowBox;
 	}

Added: trunk/src/gui/server.cs
==============================================================================
--- (empty file)
+++ trunk/src/gui/server.cs	Tue Jan 27 17:19:44 2009
@@ -0,0 +1,243 @@
+/*
+ * This file is part of ChronoJump
+ *
+ * ChronoJump is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or   
+ *    (at your option) any later version.
+ *    
+ * ChronoJump is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+ *    GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Xavier de Blas: 
+ * http://www.xdeblas.com, http://www.deporteyciencia.com (parleblas)
+ */
+
+using System;
+using Gtk;
+using Glade;
+using GLib; //for Value
+using System.Text; //StringBuilder
+using Mono.Unix;
+
+
+//object that will be uploaded to SessionUploadWindow
+public class SessionUploadPersonData {
+	public Person person;
+	public Constants.UploadCodes personCode;
+	public int jumpsU;
+	public int jumpsE;
+	public int jumpsS;
+	public int jumpsRjU;
+	public int jumpsRjE;
+	public int jumpsRjS;
+	public int runsU;
+	public int runsE;
+	public int runsS;
+	public int runsIU;
+	public int runsIE;
+	public int runsIS;
+	public int rtsU;
+	public int rtsE;
+	public int rtsS;
+	public int pulsesU;
+	public int pulsesE;
+	public int pulsesS;
+
+	public SessionUploadPersonData () {
+	}
+
+	public SessionUploadPersonData (Person person, Constants.UploadCodes personCode, 
+			int jumpsU, int jumpsE, int jumpsS, 
+			int jumpsRjU, int jumpsRjE, int jumpsRjS, 
+			int runsU, int runsE, int runsS, 
+			int runsIU, int runsIE, int runsIS, 
+			int rtsU, int rtsE, int rtsS, 
+			int pulsesU, int pulsesE, int pulsesS) {
+	}
+}
+
+public class SessionUploadWindow {
+	
+	[Widget] Gtk.Window session_upload;
+	
+	private TreeStore store_persons;
+	private TreeStore store_j;
+	private TreeStore store_jr;
+	private TreeStore store_r;
+	private TreeStore store_ri;
+	private TreeStore store_rts;
+	private TreeStore store_pulses;
+
+	[Widget] Gtk.TreeView treeview_persons;
+	[Widget] Gtk.TreeView treeview_jumps;
+	[Widget] Gtk.TreeView treeview_jumps_rj;
+	[Widget] Gtk.TreeView treeview_runs;
+	[Widget] Gtk.TreeView treeview_runs_i;
+	[Widget] Gtk.TreeView treeview_rts;
+	[Widget] Gtk.TreeView treeview_pulses;
+	
+	[Widget] Gtk.Label label_thanks;
+
+	[Widget] Gtk.Button button_close;
+
+	static SessionUploadWindow SessionUploadWindowBox;
+	Gtk.Window parent;
+	
+	SessionUploadWindow (Gtk.Window parent) {
+		Glade.XML gladeXML;
+		gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "session_upload", null);
+		gladeXML.Autoconnect(this);
+		this.parent = parent;
+		
+		//put an icon to window
+		UtilGtk.IconWindow(session_upload);
+		
+		createTreeViews(
+				treeview_persons,
+				treeview_jumps,
+				treeview_jumps_rj,
+				treeview_runs,
+				treeview_runs_i,
+				treeview_rts,
+				treeview_pulses
+				);
+
+		store_persons 	= new TreeStore(typeof (string), typeof (string), typeof (string), typeof (string) );
+		store_j  	= new TreeStore(typeof (string), typeof (string), typeof (string) );
+		store_jr 	= new TreeStore(typeof (string), typeof (string), typeof (string) );
+		store_r  	= new TreeStore(typeof (string), typeof (string), typeof (string) );
+		store_ri	= new TreeStore(typeof (string), typeof (string), typeof (string) );
+		store_rts	= new TreeStore(typeof (string), typeof (string), typeof (string) );
+		store_pulses	 = new TreeStore(typeof (string), typeof (string), typeof (string) );
+
+		treeview_persons.Model = 	store_persons;
+		treeview_jumps.Model = 		store_j;
+		treeview_jumps_rj.Model = 	store_jr;
+		treeview_runs.Model = 		store_r;
+		treeview_runs_i.Model = 	store_ri;
+		treeview_rts.Model = 		store_rts;
+		treeview_pulses.Model = 	store_pulses;
+
+		label_thanks.Hide();
+		button_close.Sensitive = false;
+
+	}
+	
+	static public SessionUploadWindow Show (Gtk.Window parent)
+	{
+		if (SessionUploadWindowBox == null) {
+			SessionUploadWindowBox = new SessionUploadWindow (parent);
+		}
+		SessionUploadWindowBox.session_upload.Show ();
+		
+		return SessionUploadWindowBox;
+	}
+	
+	private void createTreeViews (Gtk.TreeView treeview_persons, Gtk.TreeView treeview_jumps, Gtk.TreeView treeview_jumps_rj, 
+			Gtk.TreeView treeview_runs, Gtk.TreeView treeview_runs_i, Gtk.TreeView treeview_rts, Gtk.TreeView treeview_pulses) 
+	{
+		String [] personCols = {"ID", Catalog.GetString("Name"), "U", "E"};
+		String [] testCols = {"U", "E", "S"};
+		createTreeView(treeview_persons, personCols, 3);
+		createTreeView(treeview_jumps, testCols, 1);
+		createTreeView(treeview_jumps_rj, testCols, 1);
+		createTreeView(treeview_runs, testCols, 1);
+		createTreeView(treeview_runs_i, testCols, 1);
+		createTreeView(treeview_rts, testCols, 1);
+		createTreeView(treeview_pulses, testCols, 1);
+	}
+
+	private void createTreeView (Gtk.TreeView tv, String [] cols, int existsPos) {
+		int count = 0;
+		foreach(string col in cols) {
+			//paint in red the non uploaded cols
+			if(count >= existsPos) {
+				CellRendererText crt1 = new CellRendererText();
+				crt1.Foreground = "red";
+				//crt1.Background = "blue";
+				tv.AppendColumn ( col, crt1, "text", count++);
+			} else 
+				tv.AppendColumn ( col, new CellRendererText(), "text", count++);
+		}
+	}
+
+	public void FillData (SessionUploadPersonData p) {
+		fillPerson (p.person, p.personCode);
+		fillTest (Constants.TestTypes.JUMP, 	p.jumpsU, p.jumpsE, p.jumpsS);
+		fillTest (Constants.TestTypes.JUMP_RJ,	p.jumpsRjU, p.jumpsRjE, p.jumpsRjS);
+		fillTest (Constants.TestTypes.RUN,	p.runsU, p.runsE, p.runsS);
+		fillTest (Constants.TestTypes.RUN_I,	p.runsIU, p.runsIE, p.runsIS);
+		fillTest (Constants.TestTypes.RT,	p.rtsU, p.rtsE, p.rtsS);
+		fillTest (Constants.TestTypes.PULSE,	p.pulsesU, p.pulsesE, p.pulsesS);
+	}
+
+	private void fillPerson (Person person, Constants.UploadCodes uCode) {
+		string okCol = "";
+		string existCol = "";
+		if(uCode == Constants.UploadCodes.OK) 
+			okCol = "*";
+		else
+			existCol = "*";
+
+		store_persons.AppendValues (person.UniqueID.ToString(), person.Name, okCol, existCol);
+	}
+
+	private void fillTest (Constants.TestTypes type, int countU, int countE, int countS) {
+		string u = countU.ToString();
+		string e = countE.ToString();
+		string s = countS.ToString();
+		if(u=="0")
+			u = "";
+		if(e=="0")
+			e = "";
+		if(s=="0")
+			s = "";
+
+		switch (type) {
+			case Constants.TestTypes.JUMP:
+				store_j.AppendValues (u, e, s);
+				break;
+			case Constants.TestTypes.JUMP_RJ:
+				store_jr.AppendValues (u, e, s);
+				break;
+			case Constants.TestTypes.RUN:
+				store_r.AppendValues (u, e, s);
+				break;
+			case Constants.TestTypes.RUN_I:
+				store_ri.AppendValues (u, e, s);
+				break;
+			case Constants.TestTypes.RT:
+				store_rts.AppendValues (u, e, s);
+				break;
+			case Constants.TestTypes.PULSE:
+				store_pulses.AppendValues (u, e, s);
+				break;
+		}
+	}
+
+	public void UploadFinished() {
+		label_thanks.Show();
+		button_close.Sensitive = true;
+	}
+
+
+	void on_button_close_clicked (object o, EventArgs args)
+	{
+		SessionUploadWindowBox.session_upload.Hide();
+		SessionUploadWindowBox = null;
+	}
+	
+	void on_session_upload_delete_event (object o, DeleteEventArgs args)
+	{
+		SessionUploadWindowBox.session_upload.Hide();
+		SessionUploadWindowBox = null;
+	}
+	
+}

Modified: trunk/src/gui/session.cs
==============================================================================
--- trunk/src/gui/session.cs	(original)
+++ trunk/src/gui/session.cs	Tue Jan 27 17:19:44 2009
@@ -540,7 +540,7 @@
 							Catalog.GetString("Sorry, this sport '{0}' already exists in database"), 
 							newSportName));
 		else {
-			int myID = SqliteSport.Insert(false, newSportName, true, //dbconOpened, , userDefined
+			int myID = SqliteSport.Insert(false, "-1", newSportName, true, //dbconOpened, , userDefined
 					false, "");	//hasSpeciallities, graphLink 
 
 			Sport mySport = new Sport(myID, newSportName, true, 

Modified: trunk/src/jump.cs
==============================================================================
--- trunk/src/jump.cs	(original)
+++ trunk/src/jump.cs	Tue Jan 27 17:19:44 2009
@@ -71,8 +71,8 @@
 		this.simulated = Convert.ToInt32(eventString[10]);
 	}
 
-	public override void InsertAtDB (bool dbconOpened, string tableName) {
-		SqliteJump.Insert(dbconOpened, tableName, 
+	public override int InsertAtDB (bool dbconOpened, string tableName) {
+		return SqliteJump.Insert(dbconOpened, tableName, 
 				uniqueID.ToString(), 
 				personID, sessionID, 
 				type, tv, tc, fall, 
@@ -183,8 +183,8 @@
 		this.simulated = Convert.ToInt32(eventString[17]);
 	}
 
-	public override void InsertAtDB (bool dbconOpened, string tableName) {
-		SqliteJumpRj.Insert(dbconOpened, tableName, 
+	public override int InsertAtDB (bool dbconOpened, string tableName) {
+		return SqliteJumpRj.Insert(dbconOpened, tableName, 
 				uniqueID.ToString(),
 				personID, sessionID, 
 				type, TvMax, TcMax, fall, weight,

Modified: trunk/src/jumpType.cs
==============================================================================
--- trunk/src/jumpType.cs	(original)
+++ trunk/src/jumpType.cs	Tue Jan 27 17:19:44 2009
@@ -184,9 +184,9 @@
 				return hasWeight; 
 			} else {
 				if(isRepetitive)
-					return SqliteJumpType.HasWeight("jumpType", name);
-				else
 					return SqliteJumpType.HasWeight("jumpRjType", name);
+				else
+					return SqliteJumpType.HasWeight("jumpType", name);
 			}
 		}
 		set { hasWeight = value; }

Modified: trunk/src/person.cs
==============================================================================
--- trunk/src/person.cs	(original)
+++ trunk/src/person.cs	Tue Jan 27 17:19:44 2009
@@ -51,6 +51,10 @@
 		       int race, int countryID, int serverUniqueID	
 			) 
 	{
+		//needed by the return of gui/personAddModifyWindow
+		name = Util.RemoveTildeAndColon(name);
+		description = Util.RemoveTildeAndColon(description);
+
 		this.uniqueID = uniqueID;
 		this.sex = sex;
 		this.name = name;
@@ -72,6 +76,9 @@
 		       int race, int countryID, int serverUniqueID,	
 			int sessionID) 
 	{
+		name = Util.RemoveTildeAndColon(name);
+		description = Util.RemoveTildeAndColon(description);
+		
 		this.name = name;
 		this.sex = sex;
 		this.dateBorn = dateBorn;
@@ -86,9 +93,6 @@
 		this.serverUniqueID = serverUniqueID; //remember don't do this on server
 		this.sessionID = sessionID;
 
-		name = Util.RemoveTildeAndColon(name);
-		description = Util.RemoveTildeAndColon(description);
-		
 		//insert in the person table
 		/*
 		uniqueID = SqlitePerson.Insert (false, //dbconOpened

Modified: trunk/src/pulse.cs
==============================================================================
--- trunk/src/pulse.cs	(original)
+++ trunk/src/pulse.cs	Tue Jan 27 17:19:44 2009
@@ -65,8 +65,8 @@
 		this.simulated = Convert.ToInt32(eventString[8]);
 	}
 
-	public override void InsertAtDB (bool dbconOpened, string tableName) {
-		SqlitePulse.Insert(dbconOpened, tableName, 
+	public override int InsertAtDB (bool dbconOpened, string tableName) {
+		return SqlitePulse.Insert(dbconOpened, tableName, 
 				uniqueID.ToString(), 
 				personID, sessionID, 
 				type, fixedPulse, totalPulsesNum, timesString,

Modified: trunk/src/reactionTime.cs
==============================================================================
--- trunk/src/reactionTime.cs	(original)
+++ trunk/src/reactionTime.cs	Tue Jan 27 17:19:44 2009
@@ -51,8 +51,8 @@
 		this.simulated = Convert.ToInt32(eventString[6]);
 	}
 
-	public override void InsertAtDB (bool dbconOpened, string tableName) {
-		SqliteReactionTime.Insert(dbconOpened, tableName, 
+	public override int InsertAtDB (bool dbconOpened, string tableName) {
+		return SqliteReactionTime.Insert(dbconOpened, tableName, 
 				uniqueID.ToString(), 
 				personID, sessionID, 
 				"", time, //type, time

Modified: trunk/src/report.cs
==============================================================================
--- trunk/src/report.cs	(original)
+++ trunk/src/report.cs	Tue Jan 27 17:19:44 2009
@@ -120,16 +120,16 @@
 			myJumpsRj = SqliteJumpRj.SelectJumps(sessionID, -1, "");
 		}
 		if(ShowSimpleRuns) {
-			myRuns= SqliteRun.SelectAllRuns(sessionID);
+			myRuns= SqliteRun.SelectAllRuns(sessionID, -1);
 		}
 		if (ShowIntervalRuns) {
-			myRunsInterval = SqliteRunInterval.SelectAllRuns(sessionID);
+			myRunsInterval = SqliteRunInterval.SelectAllRuns(sessionID, -1);
 		}
 		if(ShowReactionTimes) {
-			myReactionTimes= SqliteReactionTime.SelectAllReactionTimes(sessionID);
+			myReactionTimes= SqliteReactionTime.SelectAllReactionTimes(sessionID, -1);
 		}
 		if(ShowPulses) {
-			myPulses= SqlitePulse.SelectAllPulses(sessionID);
+			myPulses= SqlitePulse.SelectAllPulses(sessionID, -1);
 		}
 	}
 	

Modified: trunk/src/run.cs
==============================================================================
--- trunk/src/run.cs	(original)
+++ trunk/src/run.cs	Tue Jan 27 17:19:44 2009
@@ -76,8 +76,8 @@
 		this.simulated = Convert.ToInt32(eventString[7]);
 	}
 
-	public override void InsertAtDB (bool dbconOpened, string tableName) {
-		SqliteRun.Insert(dbconOpened, tableName, 
+	public override int InsertAtDB (bool dbconOpened, string tableName) {
+		return SqliteRun.Insert(dbconOpened, tableName, 
 				uniqueID.ToString(), 
 				personID, sessionID, 
 				type, distance, time, 
@@ -166,8 +166,8 @@
 		this.simulated = Convert.ToInt32(eventString[11]);
 	}
 
-	public override void InsertAtDB (bool dbconOpened, string tableName) {
-		SqliteRunInterval.Insert(dbconOpened, tableName, 
+	public override int InsertAtDB (bool dbconOpened, string tableName) {
+		return SqliteRunInterval.Insert(dbconOpened, tableName, 
 				uniqueID.ToString(), 
 				personID, sessionID, 
 				type, distanceTotal, timeTotal, 

Modified: trunk/src/runType.cs
==============================================================================
--- trunk/src/runType.cs	(original)
+++ trunk/src/runType.cs	Tue Jan 27 17:19:44 2009
@@ -288,7 +288,33 @@
 			isPredefined	= true;
 			description	= Catalog.GetString("Continue running in 20m distance");
 			imageFileName = "run_interval.png";
+		} else if(name == "MTGUG") {
+			hasIntervals 	= true; 
+			distance 	= -1;
+			tracksLimited 	= true;
+			fixedValue 	= 3;
+			unlimited 	= false;
+			isPredefined	= true;
+			description	= Catalog.GetString("Modified time Getup and Go test");
+			imageFileName = "mtgug.png";
+			longDescription = "The instructions given to perform the test were as follows: <<Sit down with your back resting on the back of the chair and with your two arms resting on your legs. When you hear the word <<go>>, stand up without using your arms, kick the ball in front of you as hard as you possibly can, using the instep of the foot you feel the safest. Then walk at your normal pace while counting backwards from 15 to 0 out loud. Turn around back the cone, without touching it, and go back to your seat, stepping into the circles, trying not to touch any of them. Finally, sit down again, trying not to use your arms>>.\n\n" +
+				"The stopwatches were activated on the word <<go>> and the button that saved the time intervals was pressed also after the following stages: when the subject stood up and kicked the ball; when the ball passed the 8 m line; and when the subject returned to the seated position in the same chair (42 cm height from the seat to the ground). The total time needed to perform the test provided a quantitative evaluation of performance. A qualitative evaluation was performed by the completion of an AQ. This AQ assesses 6 items with a Likert scale from 0 to 3, where 0 is the equivalent to needing help in order to perform the task, and 3 is equivalent to performing the task unaided with no mistakes. The maximum points that can be attained are 18. The items assessed were: (1) standing up from the chair, (2) kicking the ball, (3) walking whilst counting backwards from 15 to 0, (4) walking around the cone, (5) walking whilst stepping into the circles, and (6) sitting back down again (S
 ee assessment questionnaire).\n\n" + 
+				"<b>Assessment questionnaire</b>\n"+
+				"Sit to stand\n" +
+				"3 able to stand up without using hands in a steady and controlled action.\n2 able to stand up using hands in a steady and controlled action.\n1 able to stand up using hands after multiple attempts.\n 0 needs or asks for help.\n" +
+				"......\n\n" +
+				"BIBLIO: GinÃ-Garriga, M., Guerra, M., MarÃ-DellâOlmo, M., Martin, C., & Unnithan, V.B. (2008). Sensitivity of a modified version of the âTimed Get Up and Goâ Test to predict fall risk in the elderly: a pilot study. Archives of Gerontology and Geriatrics, doi:10.1016/j.archger.2008.08.014. \n" +
+				"Abstract: "
+				;
+
 		}
+
+
+
+
+
+
+
 	}
 	
 	

Modified: trunk/src/serverPing.cs
==============================================================================
--- trunk/src/serverPing.cs	(original)
+++ trunk/src/serverPing.cs	Tue Jan 27 17:19:44 2009
@@ -53,9 +53,9 @@
 	}	
 
 	public override string ToString() {
-		return "ID: " + uniqueID + "; EvaluatorID: " + evaluatorID + 
-			"; cjVersion: " + cjVersion + "; osVersion: " + osVersion +
-			"; IP: " + ip + "; Date: " + date;
+		return "ID: " + uniqueID + "\nEvaluatorID: " + evaluatorID + 
+			"\nChronojump Version: " + cjVersion + "\nOS Version: " + osVersion +
+			"\nIP: " + ip + "\nDate: " + date;
 	}
 	
 	public int UniqueID {

Modified: trunk/src/session.cs
==============================================================================
--- trunk/src/session.cs	(original)
+++ trunk/src/session.cs	Tue Jan 27 17:19:44 2009
@@ -210,7 +210,6 @@
 	
 	public ServerSession(Session mySession, int evaluatorID, string evaluatorCJVersion, 
 			string evaluatorOS, string uploadedDate, Constants.ServerSessionStates uploadingState)
-			//string evaluatorOS, string uploadedDate, int uploadingState)
 	{
 		uniqueID = mySession.UniqueID;
 		name = mySession.Name;

Modified: trunk/src/sport.cs
==============================================================================
--- trunk/src/sport.cs	(original)
+++ trunk/src/sport.cs	Tue Jan 27 17:19:44 2009
@@ -56,6 +56,14 @@
 		this.graphLink = graphLink;
 	}
 
+	//currently only used from server at uploadSport
+	//if used in other places, the "-1" maybe should be another value
+	public int InsertAtDB (bool dbconOpened) {
+		int myID = SqliteSport.Insert(dbconOpened, "-1", name,
+				userDefined, hasSpeciallities, graphLink);
+		return myID;
+	}
+	
 	public override string ToString() {
 		string myString = "";
 		if(this.userDefined)
@@ -65,22 +73,27 @@
 
 	public int UniqueID {
 		get { return uniqueID; } 
+		set { uniqueID = value; } 
 	}
 	
 	public string Name {
 		get { return name; } 
+		set { name = value; } 
 	}
 
 	public bool UserDefined {
 		get { return userDefined; } 
+		set { userDefined = value; } 
 	}
 	
 	public string GraphLink {
 		get { return graphLink; } 
+		set { graphLink = value; } 
 	}
 	
 	public bool HasSpeciallities {
 		get { return hasSpeciallities; } 
+		set { hasSpeciallities = value; } 
 	}
 
 }

Modified: trunk/src/sqlite/event.cs
==============================================================================
--- trunk/src/sqlite/event.cs	(original)
+++ trunk/src/sqlite/event.cs	Tue Jan 27 17:19:44 2009
@@ -95,7 +95,7 @@
 		
 	//useful for passing serverUniqueID as simulated int
 	//updating local test when it gets uploaded
-	public static void UpdateSimulate(bool dbconOpened, string tableName, int uniqueID, int simulated)
+	public static void UpdateSimulated(bool dbconOpened, string tableName, int uniqueID, int simulated)
 	{
 		if(!dbconOpened)
 			dbcon.Open();

Modified: trunk/src/sqlite/jump.cs
==============================================================================
--- trunk/src/sqlite/jump.cs	(original)
+++ trunk/src/sqlite/jump.cs	Tue Jan 27 17:19:44 2009
@@ -73,6 +73,9 @@
 		if(! dbconOpened)
 			dbcon.Open();
 
+		if(uniqueID == "-1")
+			uniqueID = "NULL";
+
 		dbcmd.CommandText = "INSERT INTO " + tableName +  
 				" (uniqueID, personID, sessionID, type, tv, tc, fall, weight, description, angle, simulated)" +
 				" VALUES (" + uniqueID + ", "

Modified: trunk/src/sqlite/jumpRj.cs
==============================================================================
--- trunk/src/sqlite/jumpRj.cs	(original)
+++ trunk/src/sqlite/jumpRj.cs	Tue Jan 27 17:19:44 2009
@@ -67,6 +67,10 @@
 	{
 		if(! dbconOpened)
 			dbcon.Open();
+		
+		if(uniqueID == "-1")
+			uniqueID = "NULL";
+
 		dbcmd.CommandText = "INSERT INTO " + tableName + 
 				" (uniqueID, personID, sessionID, type, tvMax, tcMax, fall, weight, description, " +
 				"tvAvg, tcAvg, tvString, tcString, jumps, time, limited, angleString, simulated )" +

Modified: trunk/src/sqlite/jumpType.cs
==============================================================================
--- trunk/src/sqlite/jumpType.cs	(original)
+++ trunk/src/sqlite/jumpType.cs	Tue Jan 27 17:19:44 2009
@@ -159,7 +159,7 @@
 			dbcon.Close();
 		}
 	}
-	
+
 	public static void JumpRjTypeInsert(string myJump, bool dbconOpened)
 	{
 		string [] myStr = myJump.Split(new char[] {':'});
@@ -300,6 +300,34 @@
 		return myTypes;
 	}
 	
+	public static JumpType SelectAndReturnJumpType(string typeName) 
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "SELECT * " +
+			" FROM " + Constants.JumpTypeTable + " " +
+			" WHERE name  = '" + typeName +
+			"' ORDER BY uniqueID";
+		
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+
+		JumpType myJumpType = new JumpType();
+		
+		while(reader.Read()) {
+			myJumpType.Name = reader[1].ToString();
+			myJumpType.StartIn = Util.IntToBool(Convert.ToInt32(reader[2].ToString()));
+			myJumpType.HasWeight = Util.IntToBool(Convert.ToInt32(reader[3].ToString()));
+			myJumpType.Description = reader[4].ToString();
+		}
+
+		reader.Close();
+		dbcon.Close();
+
+		return myJumpType;
+	}
+
 	public static JumpType SelectAndReturnJumpRjType(string typeName) 
 	{
 		dbcon.Open();

Modified: trunk/src/sqlite/main.cs
==============================================================================
--- trunk/src/sqlite/main.cs	(original)
+++ trunk/src/sqlite/main.cs	Tue Jan 27 17:19:44 2009
@@ -74,6 +74,7 @@
 	 * Important2: if database version get numbers higher than 1, check if the comparisons with currentVersion works ok
 	 */
 	static string lastChronojumpDatabaseVersion = "0.60";
+	//static string lastChronojumpDatabaseVersion = "0.61";
 
 	public Sqlite() {
 	}
@@ -637,12 +638,15 @@
 			if(currentVersion == "0.56") {
 				dbcon.Open();
 
-				ArrayList arraySimulated = new ArrayList(1);
-				arraySimulated.Add("-1");
-				
+				//jump and jumpRj
 				ArrayList arrayAngleAndSimulated = new ArrayList(1);
 				arrayAngleAndSimulated.Add("-1"); //angle
 				arrayAngleAndSimulated.Add("-1"); //simulated
+				
+				//others
+				ArrayList arraySimulated = new ArrayList(1);
+				arraySimulated.Add("-1"); //simulated
+
 
 				conversionRateTotal = 9;
 				conversionRate = 1;
@@ -658,6 +662,7 @@
 				conversionRate ++;
 				convertTables(new SqlitePulse(), Constants.PulseTable, 8, arraySimulated, false);
 
+
 				//reacreate temp tables for have also the simulated column
 				conversionRate ++;
 				Sqlite.dropTable(Constants.TempJumpRjTable);
@@ -753,6 +758,28 @@
 				currentVersion = "0.60";
 			}
 
+//			if(currentVersion == "0.60") {
+				/*
+				 * think carefully on the intervalDistancesString
+				 * should it go to runInterval or to runIntervalType 
+				dbcon.Open();
+				conversionRateTotal = 2;
+
+				ArrayList arrayIDS = new ArrayList(1);
+				arrayIDS.Add("-1"); //intervalDistancesString
+				convertTables(new SqliteRunType(), Constants.RunIntervalTypeTable, 7, arrayIDS, false);
+				
+				conversionRate = 1;
+
+				RUNINTERVAL or RUNINTERVALTYPE?
+				SqliteRunType.RunIntervalTypeInsert ("MTGUG:-1:true:3:false:Modified time Getup and Go test:7=3=2", true);
+				
+				conversionRate = 2;
+				dbcon.Close();
+				currentVersion = "0.61";
+				*/
+//			}
+
 
 		}
 

Modified: trunk/src/sqlite/person.cs
==============================================================================
--- trunk/src/sqlite/person.cs	(original)
+++ trunk/src/sqlite/person.cs	Tue Jan 27 17:19:44 2009
@@ -79,6 +79,7 @@
 			race + ", " + countryID + ", " + serverUniqueID + ")" ;
 		
 		dbcmd.CommandText = myString;
+		Log.WriteLine(dbcmd.CommandText.ToString());
 		dbcmd.ExecuteNonQuery();
 		int myReturn = dbcon.LastInsertRowId;
 

Modified: trunk/src/sqlite/personSession.cs
==============================================================================
--- trunk/src/sqlite/personSession.cs	(original)
+++ trunk/src/sqlite/personSession.cs	Tue Jan 27 17:19:44 2009
@@ -139,7 +139,7 @@
 		return exists;
 	}
 	
-	public static bool PersonSelectExistsInSession(string myPersonID, int mySessionID)
+	public static bool PersonSelectExistsInSession(int myPersonID, int mySessionID)
 	{
 		dbcon.Open();
 		dbcmd.CommandText = "SELECT * FROM " + Constants.PersonSessionWeightTable +
@@ -205,6 +205,46 @@
 		return myPerson;
 	}
 	
+	//the difference between this select and others, is that this returns and ArrayList of Persons
+	//this is better than return the strings that can produce bugs in the future
+	//use this in the future:
+	public static ArrayList SelectCurrentSessionPersons(int sessionID) 
+	{
+		dbcon.Open();
+		dbcmd.CommandText = "SELECT person.*, personSessionWeight.weight " +
+			" FROM person, personSessionWeight " +
+			" WHERE personSessionWeight.sessionID == " + sessionID + 
+			" AND person.uniqueID == personSessionWeight.personID " + 
+			" ORDER BY upper(person.name)";
+		Log.WriteLine(dbcmd.CommandText.ToString());
+		dbcmd.ExecuteNonQuery();
+		SqliteDataReader reader;
+		reader = dbcmd.ExecuteReader();
+
+		ArrayList myArray = new ArrayList(1);
+		while(reader.Read()) {
+			Person person = new Person(
+					Convert.ToInt32(reader[0].ToString()),	//uniqueID
+					reader[1].ToString(),			//name
+					reader[2].ToString(),			//sex
+					reader[3].ToString(),			//dateBorn
+					Convert.ToInt32(reader[4].ToString()),	//height
+					Convert.ToInt32(reader[13].ToString()),	//weight (personSessionWeight)
+					Convert.ToInt32(reader[6].ToString()),	//sportID
+					Convert.ToInt32(reader[7].ToString()),	//speciallityID
+					Convert.ToInt32(reader[8].ToString()),	//practice
+					reader[9].ToString(),			//description
+					Convert.ToInt32(reader[10].ToString()),	//race
+					Convert.ToInt32(reader[11].ToString()),	//countryID
+					Convert.ToInt32(reader[12].ToString())	//serverUniqueID
+					);
+			myArray.Add (person);
+		}
+		reader.Close();
+		dbcon.Close();
+		return myArray;
+	}
+	
 	public static string[] SelectCurrentSession(int sessionID, bool onlyIDAndName, bool reverse) 
 	{
 		dbcon.Open();

Modified: trunk/src/sqlite/pulse.cs
==============================================================================
--- trunk/src/sqlite/pulse.cs	(original)
+++ trunk/src/sqlite/pulse.cs	Tue Jan 27 17:19:44 2009
@@ -66,6 +66,9 @@
 		if(! dbconOpened)
 			dbcon.Open();
 	
+		if(uniqueID == "-1")
+			uniqueID = "NULL";
+
 		dbcmd.CommandText = "INSERT INTO " + tableName + 
 				" (uniqueID, personID, sessionID, type, fixedPulse, totalPulsesNum, timeString, description, simulated)" +
 				" VALUES (" + uniqueID + ", " + personID + ", " + sessionID + ", '" + type + "', "
@@ -82,14 +85,19 @@
 	}
 	
 
-
-	public static string[] SelectAllPulses(int sessionID) 
+	//if all persons, put -1 in personID
+	public static string[] SelectAllPulses(int sessionID, int personID) 
 	{
+		string filterPersonString = "";
+		if(personID != -1)
+			filterPersonString = " AND person.uniqueID == " + personID;
+
 		dbcon.Open();
 		dbcmd.CommandText = "SELECT person.name, pulse.* " +
 			" FROM person, pulse " +
 			" WHERE person.uniqueID == pulse.personID" + 
 			" AND pulse.sessionID == " + sessionID + 
+			filterPersonString +
 			" ORDER BY upper(person.name), pulse.uniqueID";
 		
 		Log.WriteLine(dbcmd.CommandText.ToString());

Modified: trunk/src/sqlite/reactionTime.cs
==============================================================================
--- trunk/src/sqlite/reactionTime.cs	(original)
+++ trunk/src/sqlite/reactionTime.cs	Tue Jan 27 17:19:44 2009
@@ -64,6 +64,9 @@
 		if(! dbconOpened)
 			dbcon.Open();
 
+		if(uniqueID == "-1")
+			uniqueID = "NULL";
+
 		dbcmd.CommandText = "INSERT INTO " + tableName +  
 				" (uniqueID, personID, sessionID, type, time, description, simulated)" +
 				" VALUES (" + uniqueID + ", "
@@ -79,13 +82,19 @@
 		return myLast;
 	}
 
-	public static string[] SelectAllReactionTimes(int sessionID) 
+	//if all persons, put -1 in personID
+	public static string[] SelectAllReactionTimes(int sessionID, int personID) 
 	{
+		string filterPersonString = "";
+		if(personID != -1)
+			filterPersonString = " AND person.uniqueID == " + personID;
+
 		dbcon.Open();
 		dbcmd.CommandText = "SELECT person.name, reactionTime.* " +
 			" FROM person, reactionTime " +
 			" WHERE person.uniqueID == reactionTime.personID" + 
 			" AND reactionTime.sessionID == " + sessionID + 
+			filterPersonString +
 			" ORDER BY upper(person.name), reactionTime.uniqueID";
 		
 		Log.WriteLine(dbcmd.CommandText.ToString());

Modified: trunk/src/sqlite/run.cs
==============================================================================
--- trunk/src/sqlite/run.cs	(original)
+++ trunk/src/sqlite/run.cs	Tue Jan 27 17:19:44 2009
@@ -64,6 +64,10 @@
 	{
 		if(! dbconOpened)
 			dbcon.Open();
+		
+		if(uniqueID == "-1")
+			uniqueID = "NULL";
+
 		dbcmd.CommandText = "INSERT INTO " + tableName + 
 				" (uniqueID, personID, sessionID, type, distance, time, description, simulated)" +
 				" VALUES (" + uniqueID + ", " +
@@ -80,13 +84,19 @@
 		return myLast;
 	}
 	
-	public static string[] SelectAllRuns(int sessionID) 
+	//if all persons, put -1 in personID
+	public static string[] SelectAllRuns(int sessionID, int personID) 
 	{
+		string filterPersonString = "";
+		if(personID != -1)
+			filterPersonString = " AND person.uniqueID == " + personID;
+
 		dbcon.Open();
 		dbcmd.CommandText = "SELECT person.name, run.* " +
 			" FROM person, run " +
 			" WHERE person.uniqueID == run.personID" + 
 			" AND run.sessionID == " + sessionID + 
+			filterPersonString +
 			" ORDER BY upper(person.name), run.uniqueID";
 		
 		Log.WriteLine(dbcmd.CommandText.ToString());

Modified: trunk/src/sqlite/runInterval.cs
==============================================================================
--- trunk/src/sqlite/runInterval.cs	(original)
+++ trunk/src/sqlite/runInterval.cs	Tue Jan 27 17:19:44 2009
@@ -62,6 +62,9 @@
 		if(! dbconOpened)
 			dbcon.Open();
 
+		if(uniqueID == "-1")
+			uniqueID = "NULL";
+
 		dbcmd.CommandText = "INSERT INTO "+ tableName + 
 				" (uniqueID, personID, sessionID, type, distanceTotal, timeTotal, distanceInterval, intervalTimesString, tracks, description, limited, simulated )" +
 				"VALUES (" + uniqueID + ", " +
@@ -82,13 +85,18 @@
 		return myLast;
 	}
 
-	public new static string[] SelectAllRuns(int sessionID) 
+	public new static string[] SelectAllRuns(int sessionID, int personID) 
 	{
+		string filterPersonString = "";
+		if(personID != -1)
+			filterPersonString = " AND person.uniqueID == " + personID;
+
 		dbcon.Open();
 		dbcmd.CommandText = "SELECT person.name, runInterval.* " +
 			" FROM person, runInterval " +
 			" WHERE person.uniqueID == runInterval.personID" + 
 			" AND runInterval.sessionID == " + sessionID + 
+			filterPersonString +
 			" ORDER BY upper(person.name), runInterval.uniqueID";
 		
 		Log.WriteLine(dbcmd.CommandText.ToString());

Modified: trunk/src/sqlite/runType.cs
==============================================================================
--- trunk/src/sqlite/runType.cs	(original)
+++ trunk/src/sqlite/runType.cs	Tue Jan 27 17:19:44 2009
@@ -31,6 +31,11 @@
 
 class SqliteRunType : Sqlite
 {
+	public SqliteRunType() {
+	}
+	
+	~SqliteRunType() {}
+
 	/*
 	 * create and initialize tables
 	 */

Modified: trunk/src/sqlite/sport.cs
==============================================================================
--- trunk/src/sqlite/sport.cs	(original)
+++ trunk/src/sqlite/sport.cs	Tue Jan 27 17:19:44 2009
@@ -60,18 +60,22 @@
 			//put in db only english name
 			string [] sportFull = sportString.Split(new char[] {':'});
 			//Sport sport = new Sport(sportFull[0]);
-			Insert(true, sportFull[0], false,  		//dbconOpened, not user defined 
+			Insert(true, "-1", sportFull[0], false,  		//dbconOpened, not user defined 
 					Util.StringToBool(sportFull[2]), sportFull[3]);	//hasSpeciallities, graphLink
 			conversionSubRate ++;
 		}
 	}
-	public static int Insert(bool dbconOpened, string name, bool userDefined, bool hasSpeciallities, string graphLink)
+
+	public static int Insert(bool dbconOpened, string uniqueID, string name, bool userDefined, bool hasSpeciallities, string graphLink)
 	{
 		if(! dbconOpened)
 			dbcon.Open();
 
+		if(uniqueID == "-1")
+			uniqueID = "NULL";
+
 		string myString = "INSERT INTO " + Constants.SportTable + 
-			" (uniqueID, name, userDefined, hasSpeciallities, graphLink) VALUES (NULL, '" + name + "', " + 
+			" (uniqueID, name, userDefined, hasSpeciallities, graphLink) VALUES (" + uniqueID + ", '" + name + "', " + 
 			Util.BoolToInt(userDefined) + ", " + Util.BoolToInt(hasSpeciallities) + ", '" + graphLink + "')";
 		
 		dbcmd.CommandText = myString;

Modified: trunk/src/util.cs
==============================================================================
--- trunk/src/util.cs	(original)
+++ trunk/src/util.cs	Tue Jan 27 17:19:44 2009
@@ -231,15 +231,15 @@
 	public static string RemoveTilde(string myString) 
 	{
 		StringBuilder myStringBuilder = new StringBuilder(myString);
-		myStringBuilder.Replace("'", "");
+		myStringBuilder.Replace("'", " ");
 		return myStringBuilder.ToString();
 	}
 	
 	public static string RemoveTildeAndColon(string myString) 
 	{
 		StringBuilder myStringBuilder = new StringBuilder(myString);
-		myStringBuilder.Replace("'", "");
-		myStringBuilder.Replace(":", "");
+		myStringBuilder.Replace("'", " ");
+		myStringBuilder.Replace(":", " ");
 		return myStringBuilder.ToString();
 	}
 	
@@ -247,9 +247,9 @@
 	public static string RemoveTildeAndColonAndDot(string myString) 
 	{
 		StringBuilder myStringBuilder = new StringBuilder(myString);
-		myStringBuilder.Replace("'", "");
-		myStringBuilder.Replace(":", "");
-		myStringBuilder.Replace(".", "");
+		myStringBuilder.Replace("'", " ");
+		myStringBuilder.Replace(":", " ");
+		myStringBuilder.Replace(".", " ");
 		return myStringBuilder.ToString();
 	}
 	

Modified: trunk/version.txt
==============================================================================
--- trunk/version.txt	(original)
+++ trunk/version.txt	Tue Jan 27 17:19:44 2009
@@ -1 +1 @@
-0.8.1.3
+0.8.1.4



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