[chronojump] Units on edit event window



commit f5aaa9a2cd1f08d6e26af63c7daa2a30791bbf02
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Feb 17 13:56:25 2011 +0100

    Units on edit event window

 glade/chronojump.glade |  146 +++++++++++++++++++++++++++++++++++++++++++++++-
 src/gui/event.cs       |   16 +++++
 src/gui/jump.cs        |    9 +--
 src/gui/run.cs         |   17 ++++++
 4 files changed, 182 insertions(+), 6 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 2f66393..102d3be 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -11526,7 +11526,7 @@ Test&lt;/b&gt;</property>
           <widget class="GtkTable" id="table42">
             <property name="visible">True</property>
             <property name="n_rows">16</property>
-            <property name="n_columns">2</property>
+            <property name="n_columns">3</property>
             <property name="column_spacing">4</property>
             <property name="row_spacing">2</property>
             <child>
@@ -12014,11 +12014,155 @@ comments</property>
               </packing>
             </child>
             <child>
+              <widget class="GtkLabel" id="label_tv_units">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">seconds</property>
+              </widget>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label_tc_units">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">seconds</property>
+              </widget>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label_time_units">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">seconds</property>
+              </widget>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">7</property>
+                <property name="bottom_attach">8</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label_angle_units">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">degrees</property>
+              </widget>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">11</property>
+                <property name="bottom_attach">12</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label_fall_units">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">cm</property>
+              </widget>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">5</property>
+                <property name="bottom_attach">6</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
               <placeholder/>
             </child>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label_distance_units">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">m</property>
+              </widget>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label_speed_units">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">m/s</property>
+              </widget>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">8</property>
+                <property name="bottom_attach">9</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label_weight_units">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Kg</property>
+              </widget>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">9</property>
+                <property name="bottom_attach">10</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
           </widget>
           <packing>
             <property name="position">1</property>
diff --git a/src/gui/event.cs b/src/gui/event.cs
index 1ed3e38..b1c4f7d 100644
--- a/src/gui/event.cs
+++ b/src/gui/event.cs
@@ -45,22 +45,30 @@ public class EditEventWindow
 	[Widget] protected Gtk.Label label_event_id_value;
 	[Widget] protected Gtk.Label label_tv_title;
 	[Widget] protected Gtk.Entry entry_tv_value;
+	[Widget] protected Gtk.Label label_tv_units;
 	[Widget] protected Gtk.Label label_tc_title;
 	[Widget] protected Gtk.Entry entry_tc_value;
+	[Widget] protected Gtk.Label label_tc_units;
 	[Widget] protected Gtk.Label label_fall_title;
 	[Widget] protected Gtk.Entry entry_fall_value;
+	[Widget] protected Gtk.Label label_fall_units;
 	[Widget] protected Gtk.Label label_distance_title;
 	[Widget] protected Gtk.Entry entry_distance_value;
+	[Widget] protected Gtk.Label label_distance_units;
 	[Widget] protected Gtk.Label label_time_title;
 	[Widget] protected Gtk.Entry entry_time_value;
+	[Widget] protected Gtk.Label label_time_units;
 	[Widget] protected Gtk.Label label_speed_title;
 	[Widget] protected Gtk.Label label_speed_value;
+	[Widget] protected Gtk.Label label_speed_units;
 	[Widget] protected Gtk.Label label_weight_title;
 	[Widget] protected Gtk.Entry entry_weight_value;
+	[Widget] protected Gtk.Label label_weight_units;
 	[Widget] protected Gtk.Label label_limited_title;
 	[Widget] protected Gtk.Label label_limited_value;
 	[Widget] protected Gtk.Label label_angle_title;
 	[Widget] protected Gtk.Entry entry_angle_value;
+	[Widget] protected Gtk.Label label_angle_units;
 	[Widget] protected Gtk.Label label_simulated;
 	
 	[Widget] protected Gtk.Box hbox_combo_eventType;
@@ -175,6 +183,7 @@ public class EditEventWindow
 		else { 
 			label_tv_title.Hide();
 			entry_tv_value.Hide();
+			label_tv_units.Hide();
 		}
 
 		if(showTc)
@@ -182,6 +191,7 @@ public class EditEventWindow
 		else { 
 			label_tc_title.Hide();
 			entry_tc_value.Hide();
+			label_tc_units.Hide();
 		}
 
 		if(showFall)
@@ -189,6 +199,7 @@ public class EditEventWindow
 		else { 
 			label_fall_title.Hide();
 			entry_fall_value.Hide();
+			label_fall_units.Hide();
 		}
 
 		if(showDistance)
@@ -196,6 +207,7 @@ public class EditEventWindow
 		else { 
 			label_distance_title.Hide();
 			entry_distance_value.Hide();
+			label_distance_units.Hide();
 		}
 
 		if(showTime)
@@ -203,6 +215,7 @@ public class EditEventWindow
 		else { 
 			label_time_title.Hide();
 			entry_time_value.Hide();
+			label_time_units.Hide();
 		}
 
 		if(showSpeed)
@@ -210,6 +223,7 @@ public class EditEventWindow
 		else { 
 			label_speed_title.Hide();
 			label_speed_value.Hide();
+			label_speed_units.Hide();
 		}
 
 		if(showWeight)
@@ -217,6 +231,7 @@ public class EditEventWindow
 		else { 
 			label_weight_title.Hide();
 			entry_weight_value.Hide();
+			label_weight_units.Hide();
 		}
 
 		if(showLimited)
@@ -231,6 +246,7 @@ public class EditEventWindow
 		else { 
 			label_angle_title.Hide();
 			entry_angle_value.Hide();
+			label_angle_units.Hide();
 		}
 		
 		if(! showMistakes) {
diff --git a/src/gui/jump.cs b/src/gui/jump.cs
index 6f8f796..eea84e5 100644
--- a/src/gui/jump.cs
+++ b/src/gui/jump.cs
@@ -35,7 +35,6 @@ using Mono.Unix;
 public class EditJumpWindow : EditEventWindow
 {
 	static EditJumpWindow EditJumpWindowBox;
-//	protected bool weightPercentPreferred;
 	protected double personWeight;
 	protected int sessionID; //for know weight specific to this session
 
@@ -95,9 +94,9 @@ public class EditJumpWindow : EditEventWindow
 		showMistakes = false;
 		
 		if(weightPercentPreferred)
-			label_weight_title.Text = label_weight_title.Text.ToString() + " %";
+			label_weight_units.Text = "%";
 		else
-			label_weight_title.Text = label_weight_title.Text.ToString() + " Kg";
+			label_weight_units.Text = "Kg";
 
 		Log.WriteLine(string.Format("-------------{0}", personWeight));
 	}
@@ -320,9 +319,9 @@ public class EditJumpRjWindow : EditJumpWindow
 		showMistakes = false;
 		
 		if(weightPercentPreferred)
-			label_weight_title.Text = label_weight_title.Text.ToString() + " %";
+			label_weight_units.Text = "%";
 		else
-			label_weight_title.Text = label_weight_title.Text.ToString() + " Kg";
+			label_weight_units.Text = "Kg";
 	}
 
 	protected override string [] findTypes(Event myEvent) {
diff --git a/src/gui/run.cs b/src/gui/run.cs
index 8c0864a..0cc4259 100644
--- a/src/gui/run.cs
+++ b/src/gui/run.cs
@@ -58,6 +58,7 @@ public class EditRunWindow : EditEventWindow
 			EditRunWindowBox = new EditRunWindow (parent);
 		}
 
+		EditRunWindowBox.metersSecondsPreferred = metersSecondsPreferred;
 		EditRunWindowBox.pDN = pDN;
 		
 		EditRunWindowBox.initializeValues();
@@ -92,6 +93,11 @@ public class EditRunWindow : EditEventWindow
 		showWeight = false;
 		showLimited = false;
 		showMistakes = false;
+		
+		if(metersSecondsPreferred)
+			label_speed_units.Text = "m/s";
+		else
+			label_speed_units.Text = "Km/h";
 	}
 
 	protected override string [] findTypes(Event myEvent) {
@@ -125,6 +131,11 @@ public class EditRunWindow : EditEventWindow
 	protected override void fillSpeed(Event myEvent) {
 		Run myRun = (Run) myEvent;
 		label_speed_value.Text = Util.TrimDecimals(myRun.Speed.ToString(), pDN);
+		
+		if(metersSecondsPreferred)
+			label_speed_units.Text = "m/s";
+		else
+			label_speed_units.Text = "Km/h";
 	}
 
 	protected override void createSignal() {
@@ -248,6 +259,7 @@ public class EditRunIntervalWindow : EditRunWindow
 			EditRunIntervalWindowBox = new EditRunIntervalWindow (parent);
 		}
 
+		EditRunIntervalWindowBox.metersSecondsPreferred = metersSecondsPreferred;
 		EditRunIntervalWindowBox.pDN = pDN;
 		
 		EditRunIntervalWindowBox.initializeValues();
@@ -281,6 +293,11 @@ public class EditRunIntervalWindow : EditRunWindow
 		showWeight = false;
 		showLimited = true;
 		showMistakes = false;
+		
+		if(metersSecondsPreferred)
+			label_speed_units.Text = "m/s";
+		else
+			label_speed_units.Text = "Km/h";
 	}
 
 	//this disallows loops on radio actions	



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