chronojump r471 - in trunk: . build/data chronojump_server chronojump_server/bin glade sqlite_diagrams src src/gui



Author: xaviblas
Date: Tue Mar 10 16:38:18 2009
New Revision: 471
URL: http://svn.gnome.org/viewvc/chronojump?rev=471&view=rev

Log:
0.8.2.7
sessionUpload calls always evaluator data (to create or to check). Pending do tests.
evaluator data is uploaded only if changed. Pending do tests

Now server is called with screen and don't gets hanged


Modified:
   trunk/build/data/chronojump.prg
   trunk/build/data/chronojump_mini.prg
   trunk/build/data/version.txt
   trunk/changelog.txt
   trunk/chronojump_server/bin/chronojumpServer.dll
   trunk/chronojump_server/chronojumpServerCSharp.cs
   trunk/chronojump_server/howto_server_2009.txt
   trunk/glade/chronojump.glade
   trunk/sqlite_diagrams/chronojump_sqlite.dia
   trunk/src/gui/chronojump.cs
   trunk/src/gui/evaluator.cs
   trunk/src/serverEvaluator.cs
   trunk/version.txt

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 Mar 10 16:38:18 2009
@@ -1 +1 @@
-0.8.2.6
+0.8.2.7

Modified: trunk/changelog.txt
==============================================================================
--- trunk/changelog.txt	(original)
+++ trunk/changelog.txt	Tue Mar 10 16:38:18 2009
@@ -4,11 +4,23 @@
 
 add a link to the server page. Develop web stats and survey on web site. Maybe done by R script and calling
 to database
+http://cran.r-project.org/web/packages/RSQLite/index.html
+http://cran.r-project.org/web/packages/RSQLite/INSTALL
+http://cran.r-project.org/web/packages/DBI/index.html
 
 all this will be release 0.9
 
 do the ping gets real IP
 
+
+10 mar 2009
+	0.8.2.7
+	sessionUpload calls always evaluator data (to create or to check).
+	Pending do tests.
+	evaluator data is uploaded only if changed. Pending do tests
+
+	Now server is called with screen and don't gets hanged
+
 5 mar 2009 (2)
 	Fixed versionAvailable insertion on preferences
 

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

Modified: trunk/chronojump_server/chronojumpServerCSharp.cs
==============================================================================
--- trunk/chronojump_server/chronojumpServerCSharp.cs	(original)
+++ trunk/chronojump_server/chronojumpServerCSharp.cs	Tue Mar 10 16:38:18 2009
@@ -6,6 +6,7 @@
 //using System.Web;
 using System.Web;
 
+using System.Net; //getIP stuff
 
 //[WebService(Namespace="http://localhost:8080/";, //work to connect to corall development from client (from browser works only when online)
 //[WebService(Namespace="http://80.32.81.197:8080/";, //works to connect with pinux xen from client (from browser don't works) WORKS FROM CLIENT
@@ -244,12 +245,61 @@
 		//Console.WriteLine(System.Web.HttpRequest.UserHostAdress);
 
 		Console.WriteLine("ping string: " + myPing.ToString());
+	
+
+		string strHostName = "";
+		strHostName = System.Net.Dns.GetHostName();
+		IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName);
+		IPAddress[] addr = ipEntry.AddressList;
+		string ip = addr[addr.Length-1].ToString();
+		
+		Console.WriteLine("ip: " + ip);
+
+
+
 
 		//!doInsertion is a way to know if server is connected
 		//but without inserting nothing
 		//is ok before uploading a session
 
 		//Console.WriteLine("IP: " + System.Web.HttpRequest.UserHostAddress.ToString());
+		//Console.WriteLine("IP: " + System.Net.HttpRequest.UserHostAddress.ToString());
+		//Console.WriteLine("IP: " + System.Net.Request.UserHostAddress.ToString());
+		//Console.WriteLine("IP: " + HttpContext.Current.Request.UserHostAddress);
+		//Console.WriteLine("IP context : " + this.Context.Request.UserHostAddress);
+		//Console.WriteLine("IP : " + this.Request.UserHostAddress);
+		
+		//Console.WriteLine("IP : " + System.Net.HttpListenerRequest.UserHostAddress.ToString());
+		//System.Net.HttpListenerRequest req = new System.Net.HttpListenerRequest();
+		//Console.WriteLine("IP : " + req.UserHostAddress.ToString());
+
+//		System.Net.HttpListenerRequest req;
+		//string a = System.Net.HttpListenerRequest.UserHostAddress;
+//		string a = req.UserHostAddress;
+			
+		//string a = this.System.Net.HttpListenerRequest.UserHostAddress;
+
+//		System.Net.HttpListenerRequest request = new HttpListenerRequest (String.Empty, "http://localhost/";, String.Empty);
+//		string a = request.UserHostAddress;
+
+		//http://lists.ximian.com/pipermail/mono-list/2007-January/033998.html
+
+		/*
+		HttpListener listener = new HttpListener();
+
+		listener.AuthenticationSchemeSelectorDelegate += delegate{
+			Console.WriteLine("Asking for authentication scheme");
+			return AuthenticationSchemes.Basic;
+		};
+
+
+
+		listener.Start();
+		HttpListenerContext context = listener.GetContext();
+		HttpListenerRequest request = context.Request;
+		Console.WriteLine("IP req: " + request.UserHostAddress);
+		*/
+
 
 
 		if(doInsertion)

Modified: trunk/chronojump_server/howto_server_2009.txt
==============================================================================
--- trunk/chronojump_server/howto_server_2009.txt	(original)
+++ trunk/chronojump_server/howto_server_2009.txt	Tue Mar 10 16:38:18 2009
@@ -9,6 +9,19 @@
 
 xsp2 --root /var/www/mono/ --verbose
 
+seems to be better to execute without the non-stop:
+http://lists.ximian.com/pipermail/mono-list/2007-June/035501.html
+
+new: 10 mar 2009:
+use screen to call server:
+
+screen
+xsp2 --verbose --root /var/www/mono/
+ctrl + a + d
+exit
+
+
+then we can exit without problems with the enter, and without process getting hanged, and without using the non-stop
 if(chronojumpServerCSharp.cs methods or callings don't changed) {
 	go to (6.- compile client)
 }
@@ -41,5 +54,3 @@
 but if doesn't work, do:
 server.chronojump.org:8080/ (work too!, in both cases needed the end '/')
 ------
-seems to be better to execute without the non-stop:
-http://lists.ximian.com/pipermail/mono-list/2007-June/035501.html

Modified: trunk/glade/chronojump.glade
==============================================================================
--- trunk/glade/chronojump.glade	(original)
+++ trunk/glade/chronojump.glade	Tue Mar 10 16:38:18 2009
@@ -8487,7 +8487,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="image3996">
+			<widget class="GtkImage" id="image4031">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8508,7 +8508,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="image3997">
+			<widget class="GtkImage" id="image4032">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8529,7 +8529,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="image3998">
+			<widget class="GtkImage" id="image4033">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8551,7 +8551,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="image3999">
+			<widget class="GtkImage" id="image4034">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8579,7 +8579,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="image4000">
+			<widget class="GtkImage" id="image4035">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-convert</property>
 			  <property name="icon_size">1</property>
@@ -8614,7 +8614,7 @@
 		      <property name="use_underline">True</property>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image4001">
+			<widget class="GtkImage" id="image4036">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-connect</property>
 			  <property name="icon_size">1</property>
@@ -8642,7 +8642,7 @@
 			      <property name="visible">True</property>
 			      <property name="label" translatable="yes">Evaluator data</property>
 			      <property name="use_underline">True</property>
-			      <signal name="activate" handler="on_menuitem_server_evaluator_data" last_modification_time="Thu, 19 Feb 2009 13:31:29 GMT"/>
+			      <signal name="activate" handler="on_menuitem_server_evaluator_data_only" last_modification_time="Tue, 10 Mar 2009 16:28:27 GMT"/>
 			    </widget>
 			  </child>
 
@@ -8651,7 +8651,7 @@
 			      <property name="visible">True</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_upload_session" last_modification_time="Mon, 26 Jan 2009 09:16:30 GMT"/>
+			      <signal name="activate" handler="on_menuitem_server_upload_session_pre" last_modification_time="Tue, 10 Mar 2009 16:28:27 GMT"/>
 			    </widget>
 			  </child>
 
@@ -8682,7 +8682,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="image4002">
+			<widget class="GtkImage" id="image4037">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -8709,7 +8709,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="image4003">
+			<widget class="GtkImage" id="image4038">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-quit</property>
 			  <property name="icon_size">1</property>
@@ -8743,7 +8743,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="image4004">
+			<widget class="GtkImage" id="image4039">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8764,7 +8764,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="image4005">
+			<widget class="GtkImage" id="image4040">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -8791,7 +8791,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="image4006">
+			<widget class="GtkImage" id="image4041">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8812,7 +8812,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="image4007">
+			<widget class="GtkImage" id="image4042">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-open</property>
 			  <property name="icon_size">1</property>
@@ -8839,7 +8839,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="image4008">
+			<widget class="GtkImage" id="image4043">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -8860,7 +8860,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="image4009">
+			<widget class="GtkImage" id="image4044">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-index</property>
 			  <property name="icon_size">1</property>
@@ -8887,7 +8887,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="image4010">
+			<widget class="GtkImage" id="image4045">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -8999,7 +8999,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="image4011">
+				<widget class="GtkImage" id="image4046">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -9024,7 +9024,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="image4012">
+			<widget class="GtkImage" id="image4047">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -9045,7 +9045,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="image4013">
+			<widget class="GtkImage" id="image4048">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -9111,7 +9111,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="image4014">
+				<widget class="GtkImage" id="image4049">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -9136,7 +9136,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="image4015">
+			<widget class="GtkImage" id="image4050">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -9157,7 +9157,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="image4016">
+			<widget class="GtkImage" id="image4051">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -9178,7 +9178,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="image4017">
+			<widget class="GtkImage" id="image4052">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -9205,7 +9205,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="image4018">
+			<widget class="GtkImage" id="image4053">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -9359,7 +9359,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="image4019">
+				<widget class="GtkImage" id="image4054">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -9384,7 +9384,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="image4020">
+			<widget class="GtkImage" id="image4055">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -9405,7 +9405,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="image4021">
+			<widget class="GtkImage" id="image4056">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -9480,7 +9480,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="image4022">
+				<widget class="GtkImage" id="image4057">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-add</property>
 				  <property name="icon_size">1</property>
@@ -9505,7 +9505,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="image4023">
+			<widget class="GtkImage" id="image4058">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-edit</property>
 			  <property name="icon_size">1</property>
@@ -9526,7 +9526,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="image4024">
+			<widget class="GtkImage" id="image4059">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-preferences</property>
 			  <property name="icon_size">1</property>
@@ -9547,7 +9547,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="image4025">
+			<widget class="GtkImage" id="image4060">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-remove</property>
 			  <property name="icon_size">1</property>
@@ -9574,7 +9574,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="image4026">
+			<widget class="GtkImage" id="image4061">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -9654,7 +9654,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="image4027">
+			<widget class="GtkImage" id="image4062">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-refresh</property>
 			  <property name="icon_size">1</property>
@@ -9675,7 +9675,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="image4028">
+			<widget class="GtkImage" id="image4063">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-refresh</property>
 			  <property name="icon_size">1</property>
@@ -9743,7 +9743,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="image4029">
+			<widget class="GtkImage" id="image4064">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-info</property>
 			  <property name="icon_size">1</property>
@@ -9779,7 +9779,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="image4030">
+			<widget class="GtkImage" id="image4065">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-about</property>
 			  <property name="icon_size">1</property>
@@ -9806,7 +9806,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="image4031">
+			<widget class="GtkImage" id="image4066">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-dialog-error</property>
 			  <property name="icon_size">1</property>

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

Modified: trunk/src/gui/chronojump.cs
==============================================================================
--- trunk/src/gui/chronojump.cs	(original)
+++ trunk/src/gui/chronojump.cs	Tue Mar 10 16:38:18 2009
@@ -896,29 +896,21 @@
 	 * SERVER CALLBACKS
 	 */
 
+	bool serverEvaluatorDoing;
 	// upload session and it's persons (callback)
-	private void on_menuitem_server_upload_session (object o, EventArgs args) 
-	{
+	private void on_menuitem_server_upload_session_pre (object o, EventArgs args) {
+		//evaluator stuff
+		//Server.ServerUploadEvaluator();
+		string evalMessage = "";
 		int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
 		if(evalSID == Constants.ServerUndefinedID) 
-			Server.ServerUploadEvaluator();
-
-		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);
-		}
+			evalMessage = Catalog.GetString("Please, first fill evaluator data.");
+		else 
+			evalMessage = Catalog.GetString("Please, first check evaluator data is ok.");
+		
+		appbar2.Push ( 1, evalMessage );
+		
+		server_evaluator_data_and_after_upload_session();
 	}
 
 	private void on_menuitem_server_stats (object o, EventArgs args) {
@@ -950,22 +942,45 @@
 				Server.Ping(true, progName, progVersion)); //do insertion (will show versionAvailable)
 	}
 	
-	private void on_menuitem_server_evaluator_data (object o, EventArgs args) {
-		ServerEvaluator myEval = SqliteServer.SelectEvaluator(1);
+	bool uploadSessionAfter;
+
+	//called when after that has to continue with upload session
+	private void server_evaluator_data_and_after_upload_session() {
+		uploadSessionAfter = true;
+		server_evaluator_data (); 
+	}
+	
+	//called when only has to be created/updated the evaluator (not update session)
+	private void on_menuitem_server_evaluator_data_only (object o, EventArgs args) {
+		uploadSessionAfter = false;
+		server_evaluator_data (); 
+	}
+	
+	private void server_evaluator_data () {
+		ServerEvaluator myEval = SqliteServer.SelectEvaluator(1); 
 		evalWin = EvaluatorWindow.Show(myEval);
 		evalWin.FakeButtonAccept.Clicked += new EventHandler(on_evaluator_done);
 	}
 
 	private void on_evaluator_done (object o, EventArgs args) {
-		string versionAvailable = Server.Ping(false, "", ""); //false: don't do insertion
-		if(versionAvailable != Constants.ServerOffline) { //false: don't do insertion
-			ConfirmWindow confirmWin = ConfirmWindow.Show(Catalog.GetString("Do you want to upload evaluator data now?"), "");
-			confirmWin.Button_accept.Clicked += new EventHandler(on_evaluator_upload_accepted);
+		if(evalWin.Changed) {
+			string versionAvailable = Server.Ping(false, "", ""); //false: don't do insertion
+			if(versionAvailable != Constants.ServerOffline) { //false: don't do insertion
+				ConfirmWindow confirmWin = ConfirmWindow.Show(Catalog.GetString("Do you want to upload evaluator data now?"), "");
+				confirmWin.Button_accept.Clicked += new EventHandler(on_evaluator_upload_accepted);
+			} else 
+				new DialogMessage(Constants.MessageTypes.WARNING, Catalog.GetString("Currently cannot upload.") + "\n\n" + Constants.ServerOffline);
 		}
+		else
+			if(uploadSessionAfter)
+				server_upload_session ();
+
 	}
 
 	private void on_evaluator_upload_accepted (object o, EventArgs args) {
 		Server.ServerUploadEvaluator();
+		if(uploadSessionAfter)
+			server_upload_session ();
 	}
 
 	/* 
@@ -1030,6 +1045,29 @@
 
 	}
 
+	private void server_upload_session () 
+	{
+		int evalSID = Convert.ToInt32(SqlitePreferences.Select("evaluatorServerID"));
+		if(evalSID != Constants.ServerUndefinedID) {
+			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);
+			}
+		}
+	}
+
 
 	private void on_server_upload_session_accepted (object o, EventArgs args) 
 	{

Modified: trunk/src/gui/evaluator.cs
==============================================================================
--- trunk/src/gui/evaluator.cs	(original)
+++ trunk/src/gui/evaluator.cs	Tue Mar 10 16:38:18 2009
@@ -89,7 +89,8 @@
 	DateTime dateTime;
 
 	ServerEvaluator eval;
-
+	ServerEvaluator evalBefore;
+	bool changed;
 	bool creating; //true if no record found before. False if updating
 	
 	//allows to upload data (from gui/chronojump.cs) after has been inserted in sql
@@ -110,9 +111,14 @@
 		fakeButtonAccept = new Gtk.Button();
 
 		this.eval = eval;
+
 		if(eval.UniqueID == -1)
 			creating = true;
 		
+		//copy to see if there are changes
+		//evalBefore = eval;
+		evalBefore = new ServerEvaluator(eval);
+		
 		createComboContinents();
 		createComboCountries();
 		
@@ -473,10 +479,22 @@
 			eval.Device = entry_device_other.Text.ToString();
 
 
-		if(creating) 
+		changed = false;
+		if(creating) {
 			eval.InsertAtDB(false);
-		else
-			eval.Update(false);
+			changed = true;
+		} else {
+			//1st see if there are changes
+			if(eval.Equals(evalBefore)) {
+				//nothing changed
+				//
+				//new DialogMessage(Constants.MessageTypes.INFO, "nothing changed.\n"); 
+			} else {
+				//changed
+				eval.Update(false);
+				changed = true;
+			}
+		}
 
 		fakeButtonAccept.Click();
 
@@ -490,6 +508,12 @@
 		get { return fakeButtonAccept; }
 	}
 
+	public bool Changed 
+	{
+		set { changed = value; }
+		get { return changed; }
+	}
+
 
 	~EvaluatorWindow() {}
 	

Modified: trunk/src/serverEvaluator.cs
==============================================================================
--- trunk/src/serverEvaluator.cs	(original)
+++ trunk/src/serverEvaluator.cs	Tue Mar 10 16:38:18 2009
@@ -54,6 +54,36 @@
 		this.confiable = confiable;
 	}
 
+	//allows to do a copy on gui/evaluator.cs	
+	public ServerEvaluator(ServerEvaluator oldEval) {
+		this.code = oldEval.Code;
+		this.name = oldEval.Name;
+		this.email = oldEval.Email;
+		this.dateBorn = oldEval.DateBorn;
+		this.countryID = oldEval.CountryID;
+		this.chronometer = oldEval.Chronometer;
+		this.device = oldEval.Device;
+		this.comments = oldEval.Comments;
+		this.confiable = oldEval.Confiable;
+	}
+
+	public bool Equals(ServerEvaluator oldEval) {
+		if(
+				this.code == oldEval.Code &&
+				this.name == oldEval.Name &&
+				this.email == oldEval.Email &&
+				this.dateBorn == oldEval.DateBorn &&
+				this.countryID == oldEval.CountryID &&
+				this.chronometer == oldEval.Chronometer &&
+				this.device == oldEval.Device &&
+				this.comments == oldEval.Comments &&
+				this.confiable == oldEval.Confiable
+		  )
+			return true;
+		else
+			return false;
+	}
+
 	public int InsertAtDB(bool dbconOpened){
 		int myID = SqliteServer.InsertEvaluator(dbconOpened, code, name, email, dateBorn, countryID, chronometer, device, comments, confiable);
 		return myID;

Modified: trunk/version.txt
==============================================================================
--- trunk/version.txt	(original)
+++ trunk/version.txt	Tue Mar 10 16:38:18 2009
@@ -1 +1 @@
-0.8.2.6
+0.8.2.7



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