[chronojump] Add jump type different for simple & reactive



commit 38a68a22fdb57186bc3236ed7318030d008325fd
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Apr 3 21:48:29 2011 +0200

    Add jump type different for simple & reactive

 glade/chronojump.glade      |   10 ++++------
 src/execute/jump.cs         |    7 +++++--
 src/execute/pulse.cs        |    2 +-
 src/execute/reactionTime.cs |    2 ++
 src/execute/run.cs          |    4 ++++
 src/gui/chronojump.cs       |   13 ++++++++++---
 src/gui/jumpType.cs         |   31 +++++++++++++++++++++++++------
 7 files changed, 51 insertions(+), 18 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index aae4fe2..f825460 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -3198,7 +3198,7 @@ show elevation as:</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkLabel" id="label128">
+              <widget class="GtkLabel" id="label_main_options">
                 <property name="visible">True</property>
                 <property name="xalign">0</property>
                 <property name="label" translatable="yes">Main
@@ -3212,7 +3212,7 @@ options</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkTable" id="table16">
+              <widget class="GtkTable" id="table_main_options">
                 <property name="visible">True</property>
                 <property name="border_width">8</property>
                 <property name="n_rows">3</property>
@@ -3221,7 +3221,6 @@ options</property>
                 <property name="row_spacing">4</property>
                 <child>
                   <widget class="GtkLabel" id="label129">
-                    <property name="visible">True</property>
                     <property name="label" translatable="yes">Type</property>
                   </widget>
                   <packing>
@@ -14217,7 +14216,6 @@ Chronopic</property>
                                 <child>
                                   <widget class="GtkNotebook" id="notebook_execute">
                                     <property name="visible">True</property>
-                                    <property name="show_tabs">False</property>
                                     <property name="show_border">False</property>
                                     <child>
                                       <widget class="GtkFrame" id="frame2">
@@ -14515,7 +14513,7 @@ Chronopic</property>
                                                             <property name="receives_default">True</property>
                                                             <property name="has_tooltip">True</property>
                                                             <property name="tooltip" translatable="yes">Add jump type</property>
-                                                            <signal name="clicked" handler="on_jump_type_add_clicked"/>
+                                                            <signal name="clicked" handler="on_jump_simple_type_add_clicked"/>
                                                             <child>
                                                             <widget class="GtkImage" id="image3210">
                                                             <property name="visible">True</property>
@@ -14840,7 +14838,7 @@ Chronopic</property>
                                                             <property name="receives_default">True</property>
                                                             <property name="has_tooltip">True</property>
                                                             <property name="tooltip" translatable="yes">Add jump type</property>
-                                                            <signal name="clicked" handler="on_jump_type_add_clicked"/>
+                                                            <signal name="clicked" handler="on_jump_reactive_type_add_clicked"/>
                                                             <child>
                                                             <widget class="GtkImage" id="image1">
                                                             <property name="visible">True</property>
diff --git a/src/execute/jump.cs b/src/execute/jump.cs
index da13c17..d4801d6 100644
--- a/src/execute/jump.cs
+++ b/src/execute/jump.cs
@@ -375,14 +375,15 @@ public class JumpExecute : EventExecute
 		} else {
 			tc = 0;
 		}
-			
+		
+		/*	
 		string myStringPush =   
-			//Catalog.GetString("Last jump: ") + 
 			personName + " " + 
 			type + tcString + " " + Catalog.GetString("TF") + ": " + Util.TrimDecimals( tv.ToString(), pDN ) ;
 		if(weight > 0) {
 			myStringPush = myStringPush + "(" + weight.ToString() + "%)";
 		}
+		*/
 		if(simulated)
 			feedbackMessage = Catalog.GetString(Constants.SimulatedMessage);
 		else
@@ -983,12 +984,14 @@ public class JumpRjExecute : JumpExecute
 
 
 			//event will be raised, and managed in chronojump.cs
+			/*
 			string myStringPush =   
 				//Catalog.GetString("Last jump: ") + 
 				personName + " " + 
 				type + " (" + limitString + ") " +
 				" " + Catalog.GetString("AVG TF") + ": " + Util.TrimDecimals( Util.GetAverage (tvString).ToString(), pDN ) +
 				" " + Catalog.GetString("AVG TC") + ": " + Util.TrimDecimals( Util.GetAverage (tcString).ToString(), pDN ) ;
+			*/
 			if(simulated)
 				feedbackMessage = Catalog.GetString(Constants.SimulatedMessage);
 			else
diff --git a/src/execute/pulse.cs b/src/execute/pulse.cs
index 4d940b5..46f697d 100644
--- a/src/execute/pulse.cs
+++ b/src/execute/pulse.cs
@@ -348,7 +348,7 @@ public class PulseExecute : EventExecute
 		//define the created object
 		eventDone = new Pulse(uniqueID, personID, sessionID, type, fixedPulse, totalPulsesNum, timesString, "", Util.BoolToNegativeInt(simulated)); 
 		
-		string myStringPush =   Catalog.GetString("Last pulse") + ": " + personName + " " + type ;
+		//string myStringPush =   Catalog.GetString("Last pulse") + ": " + personName + " " + type ;
 		if(simulated)
 			feedbackMessage = Catalog.GetString(Constants.SimulatedMessage);
 		else
diff --git a/src/execute/reactionTime.cs b/src/execute/reactionTime.cs
index 241e425..d78cff3 100644
--- a/src/execute/reactionTime.cs
+++ b/src/execute/reactionTime.cs
@@ -236,9 +236,11 @@ public class ReactionTimeExecute : EventExecute
 
 	protected override void write()
 	{
+		/*
 		string myStringPush =   
 			personName + " " + 
 			type + " " + Catalog.GetString("Time") + ": " + Util.TrimDecimals( time.ToString(), pDN ) ;
+		*/
 		
 		if(simulated)
 			feedbackMessage = Catalog.GetString(Constants.SimulatedMessage);
diff --git a/src/execute/run.cs b/src/execute/run.cs
index efe5bfe..da588ed 100644
--- a/src/execute/run.cs
+++ b/src/execute/run.cs
@@ -302,9 +302,11 @@ Log.WriteLine("MANAGE(3)!!!!");
 	{
 		Log.WriteLine(string.Format("TIME: {0}", time.ToString()));
 		
+		/*
 		string myStringPush =   Catalog.GetString("Last run") + ": " + RunnerName + " " + 
 			type + " " + Catalog.GetString("time") + ": " + Util.TrimDecimals( time.ToString(), pDN ) + 
 			" " + Catalog.GetString("speed") + ": " + Util.TrimDecimals ( (distance/time).ToString(), pDN );
+		*/
 		if(simulated)
 			feedbackMessage = Catalog.GetString(Constants.SimulatedMessage);
 		else
@@ -824,12 +826,14 @@ public class RunIntervalExecute : RunExecute
 			else
 				tempValuesString = " (" + distanceIntervalFixed + "x" + Util.TrimDecimals( timeTotal.ToString(), pDN) + "T), " + Catalog.GetString("Tracks") + ": " + tracks;
 
+			/*
 			string myStringPush =   Catalog.GetString("Last run") + ": " + RunnerName + ", " + 
 				type + tempValuesString + ", " +
 				Catalog.GetString("AVG Speed") + ": " + Util.TrimDecimals( 
 						Util.GetSpeed(distanceTotal.ToString(),
 							timeTotal.ToString(), metersSecondsPreferred )
 						, pDN ) ;
+			*/
 			if(simulated)
 				feedbackMessage = Catalog.GetString(Constants.SimulatedMessage);
 			else
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 2e78892..15a669d 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -4938,10 +4938,17 @@ Console.WriteLine("X");
 	 */
 
 	
-	private void on_jump_type_add_clicked (object o, EventArgs args) {
-		Log.WriteLine("Add new jump type");
+	private void on_jump_simple_type_add_clicked (object o, EventArgs args) {
+		Log.WriteLine("Add simple new jump type");
 			
-		jumpTypeAddWin = JumpTypeAddWindow.Show(app1);
+		jumpTypeAddWin = JumpTypeAddWindow.Show(app1, true); //is simple
+		jumpTypeAddWin.FakeButtonAccept.Clicked += new EventHandler(on_jump_type_add_accepted);
+	}
+	
+	private void on_jump_reactive_type_add_clicked (object o, EventArgs args) {
+		Log.WriteLine("Add reactive new jump type");
+			
+		jumpTypeAddWin = JumpTypeAddWindow.Show(app1, false); //is reactive
 		jumpTypeAddWin.FakeButtonAccept.Clicked += new EventHandler(on_jump_type_add_accepted);
 	}
 	
diff --git a/src/gui/jumpType.cs b/src/gui/jumpType.cs
index 9fee13b..89bdb15 100644
--- a/src/gui/jumpType.cs
+++ b/src/gui/jumpType.cs
@@ -37,6 +37,11 @@ public class JumpTypeAddWindow
 	[Widget] Gtk.Button button_accept;
 	public Gtk.Button fakeButtonAccept;
 	[Widget] Gtk.Entry entry_name;
+
+
+	[Widget] Gtk.Label label_main_options;
+	[Widget] Gtk.Table table_main_options;
+
 	[Widget] Gtk.RadioButton radiobutton_simple;
 	[Widget] Gtk.RadioButton radiobutton_repetitive;
 	[Widget] Gtk.RadioButton radiobutton_unlimited;
@@ -57,7 +62,7 @@ public class JumpTypeAddWindow
 
 	public bool InsertedSimple;
 
-	JumpTypeAddWindow (Gtk.Window parent) {
+	JumpTypeAddWindow (Gtk.Window parent, bool simple) {
 		Glade.XML gladeXML;
 		gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "chronojump.glade", "jump_type_add", null);
 		gladeXML.Autoconnect(this);
@@ -69,27 +74,41 @@ public class JumpTypeAddWindow
 		UtilGtk.IconWindow(jump_type_add);
 	}
 	
-	static public JumpTypeAddWindow Show (Gtk.Window parent)
+	static public JumpTypeAddWindow Show (Gtk.Window parent, bool simple)
 	{
 		if (JumpTypeAddWindowBox == null) {
-			JumpTypeAddWindowBox = new JumpTypeAddWindow (parent);
+			JumpTypeAddWindowBox = new JumpTypeAddWindow (parent, simple);
 		}
 		
 		JumpTypeAddWindowBox.jump_type_add.Show ();
-		JumpTypeAddWindowBox.fillDialog ();
+		JumpTypeAddWindowBox.fillDialog (simple);
 
 		return JumpTypeAddWindowBox;
 	}
 	
-	private void fillDialog ()
+	private void fillDialog (bool simple)
 	{
 		vbox_limited.Sensitive = false;	
 		hbox_fixed.Sensitive = false;	
 		button_accept.Sensitive = false;
 		spin_fixed_num.Sensitive = false;
 		radiobutton_extra_weight_no.Active = true;
+
+		//active the desired radio
+		if(simple)
+			radiobutton_simple.Active = true;
+		else
+			radiobutton_repetitive.Active = true;
+
+		//don't show the radios
+		radiobutton_simple.Visible = false;
+		radiobutton_repetitive.Visible = false;
+
+		//if simple don't show nothing
+		label_main_options.Visible = ! simple;
+		table_main_options.Visible = ! simple;
 	}
-		
+
 	void on_button_cancel_clicked (object o, EventArgs args)
 	{
 		JumpTypeAddWindowBox.jump_type_add.Hide();



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