[chronojump] Contacts exercise gui shows options on jumps rj
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Contacts exercise gui shows options on jumps rj
- Date: Tue, 10 Dec 2019 17:02:55 +0000 (UTC)
commit a13412c2348aae9474cf1df1c7b15e22f25518fe
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Dec 10 18:02:36 2019 +0100
Contacts exercise gui shows options on jumps rj
glade/app1.glade | 185 +++++++++++++++++++++------------------
src/gui/app1/contactsExercise.cs | 52 +++++++++--
src/gui/jump.cs | 7 +-
3 files changed, 155 insertions(+), 89 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index f365396a..9c107345 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -11426,7 +11426,7 @@ EncoderInertialCapture</property>
<widget class="GtkHBox" id="hbox_jumps_test">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">8</property>
+ <property name="spacing">30</property>
<child>
<widget class="GtkHBox"
id="hbox_combo_select_jumps">
<property name="visible">True</property>
@@ -13083,7 +13083,12 @@ EncoderInertialCapture</property>
<child>
<widget class="GtkHBox"
id="extra_window_jumps_hbox_fall">
<property name="can_focus">False</property>
- <property name="spacing">6</property>
+ <property name="spacing">30</property>
+ <child>
+ <widget class="GtkHBox" id="hbox23">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
<child>
<widget class="GtkCheckButton"
id="extra_window_jumps_check_dj_fall_calculate">
<property name="visible">True</property>
@@ -13094,7 +13099,7 @@ EncoderInertialCapture</property>
<property name="draw_indicator">False</property>
<signal name="toggled"
handler="on_extra_window_jumps_check_dj_fall_calculate_toggled" swapped="no"/>
<child>
- <widget class="GtkHBox" id="hbox23">
+ <widget class="GtkHBox" id="hbox216">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -13128,8 +13133,8 @@ EncoderInertialCapture</property>
</child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
@@ -13193,11 +13198,13 @@ EncoderInertialCapture</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <widget class="GtkAlignment" id="alignment13">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="left_padding">20</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
<widget class="GtkHBox"
id="hbox_extra_window_jumps_fall_height">
<property name="can_focus">False</property>
@@ -13250,12 +13257,10 @@ EncoderInertialCapture</property>
</packing>
</child>
</widget>
- </child>
- </widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">1</property>
</packing>
</child>
</widget>
@@ -13288,7 +13293,7 @@ EncoderInertialCapture</property>
<property name="height_request">32</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">20</property>
+ <property name="spacing">30</property>
<child>
<widget class="GtkHBox" id="hbox101">
<property name="visible">True</property>
@@ -13326,6 +13331,7 @@ EncoderInertialCapture</property>
<property name="numeric">True</property>
<property name="wrap">True</property>
<property
name="update_policy">if-valid</property>
+ <signal name="value_changed"
handler="on_contacts_exercise_value_changed" swapped="no"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -13360,15 +13366,16 @@ EncoderInertialCapture</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox158">
+ <widget class="GtkHBox" id="hbox161">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel"
id="extra_window_jumps_rj_label_fall">
+ <widget class="GtkLabel"
id="extra_window_jumps_rj_label_weight">
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label"
translatable="yes">Falling height</property>
+ <property name="label"
translatable="yes">Additional weight</property>
+ <property name="wrap">True</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -13377,12 +13384,12 @@ EncoderInertialCapture</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox26">
+ <widget class="GtkHBox" id="hbox69">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkSpinButton"
id="extra_window_jumps_rj_spinbutton_fall">
+ <widget class="GtkSpinButton"
id="extra_window_jumps_rj_spinbutton_weight">
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property
name="invisible_char_set">True</property>
@@ -13390,10 +13397,11 @@ EncoderInertialCapture</property>
<property
name="secondary_icon_activatable">False</property>
<property
name="primary_icon_sensitive">True</property>
<property
name="secondary_icon_sensitive">True</property>
- <property name="adjustment">20 0 200 1 10
0</property>
+ <property name="adjustment">1 0 200 1 10
0</property>
<property name="climb_rate">1</property>
- <property name="digits">2</property>
+ <property name="digits">1</property>
<property name="numeric">True</property>
+ <signal name="value_changed"
handler="on_extra_window_jumps_rj_spinbutton_weight_value_changed" swapped="no"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -13402,10 +13410,14 @@ EncoderInertialCapture</property>
</packing>
</child>
<child>
- <widget class="GtkLabel"
id="extra_window_jumps_rj_label_cm">
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label">cm</property>
+ <widget class="GtkRadioButton"
id="extra_window_jumps_rj_radiobutton_weight">
+ <property name="label" translatable="yes">% body
weight</property>
+ <property name="can_focus">True</property>
+ <property
name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <property
name="group">extra_window_jumps_rj_radiobutton_kg</property>
+ <signal name="toggled"
handler="on_extra_window_jumps_rj_radiobutton_weight_toggled" swapped="no"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -13413,6 +13425,40 @@ EncoderInertialCapture</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <widget class="GtkRadioButton"
id="extra_window_jumps_rj_radiobutton_kg">
+ <property name="label">Kg</property>
+ <property name="can_focus">True</property>
+ <property
name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled"
handler="on_extra_window_jumps_rj_radiobutton_kg_toggled" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment31">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">20</property>
+ <child>
+ <widget class="GtkLabel"
id="label_extra_window_jumps_rj_radiobutton_weight_percent_as_kg">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -13427,17 +13473,28 @@ EncoderInertialCapture</property>
<property name="position">1</property>
</packing>
</child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
<child>
- <widget class="GtkHBox" id="hbox161">
+ <widget class="GtkHBox" id="hbox183">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">30</property>
+ <child>
+ <widget class="GtkHBox" id="hbox158">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel"
id="extra_window_jumps_rj_label_weight">
+ <widget class="GtkLabel"
id="extra_window_jumps_rj_label_fall">
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label"
translatable="yes">Additional weight</property>
- <property name="wrap">True</property>
+ <property name="label"
translatable="yes">Falling height</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -13446,12 +13503,12 @@ EncoderInertialCapture</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox69">
+ <widget class="GtkHBox" id="hbox26">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkSpinButton"
id="extra_window_jumps_rj_spinbutton_weight">
+ <widget class="GtkSpinButton"
id="extra_window_jumps_rj_spinbutton_fall">
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property
name="invisible_char_set">True</property>
@@ -13459,11 +13516,11 @@ EncoderInertialCapture</property>
<property
name="secondary_icon_activatable">False</property>
<property
name="primary_icon_sensitive">True</property>
<property
name="secondary_icon_sensitive">True</property>
- <property name="adjustment">0 0 200 1 10
0</property>
+ <property name="adjustment">20 0 200 1 10
0</property>
<property name="climb_rate">1</property>
- <property name="digits">1</property>
+ <property name="digits">2</property>
<property name="numeric">True</property>
- <signal name="value_changed"
handler="on_extra_window_jumps_rj_spinbutton_weight_value_changed" swapped="no"/>
+ <signal name="value_changed"
handler="on_contacts_exercise_value_changed" swapped="no"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -13472,14 +13529,10 @@ EncoderInertialCapture</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton"
id="extra_window_jumps_rj_radiobutton_weight">
- <property name="label" translatable="yes">% body
weight</property>
- <property name="can_focus">True</property>
- <property
name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property
name="group">extra_window_jumps_rj_radiobutton_kg</property>
- <signal name="toggled"
handler="on_extra_window_jumps_rj_radiobutton_weight_toggled" swapped="no"/>
+ <widget class="GtkLabel"
id="extra_window_jumps_rj_label_cm">
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label">cm</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -13487,40 +13540,6 @@ EncoderInertialCapture</property>
<property name="position">1</property>
</packing>
</child>
- <child>
- <widget class="GtkRadioButton"
id="extra_window_jumps_rj_radiobutton_kg">
- <property name="label">Kg</property>
- <property name="can_focus">True</property>
- <property
name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled"
handler="on_extra_window_jumps_rj_radiobutton_kg_toggled" swapped="no"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment31">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="left_padding">20</property>
- <child>
- <widget class="GtkLabel"
id="label_extra_window_jumps_rj_radiobutton_weight_percent_as_kg">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -13532,13 +13551,6 @@ EncoderInertialCapture</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
@@ -13561,6 +13573,13 @@ EncoderInertialCapture</property>
</child>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
<property name="position">1</property>
</packing>
</child>
diff --git a/src/gui/app1/contactsExercise.cs b/src/gui/app1/contactsExercise.cs
index 3f6c3a66..5af4d419 100644
--- a/src/gui/app1/contactsExercise.cs
+++ b/src/gui/app1/contactsExercise.cs
@@ -122,8 +122,11 @@ public partial class ChronoJumpWindow
{
LogB.Information("TT0");
LogB.Information(current_menuitem_mode.ToString());
+
if(current_menuitem_mode == Constants.Menuitem_modes.JUMPSSIMPLE)
setLabelContactsExerciseSelectedOptionsJumpsSimple();
+ if(current_menuitem_mode == Constants.Menuitem_modes.JUMPSREACTIVE)
+ setLabelContactsExerciseSelectedOptionsJumpsReactive();
}
private void setLabelContactsExerciseSelectedOptionsJumpsSimple()
@@ -136,19 +139,58 @@ public partial class ChronoJumpWindow
string name = "";
string sep = "";
+ if(((JumpType) currentEventType).HasWeight)
+ {
+ if(extra_window_jumps_radiobutton_weight.Active)
+ name += sep + label_extra_window_jumps_radiobutton_weight_percent_as_kg.Text;
+ else
+ name += sep + extra_window_jumps_spinbutton_weight.Value.ToString() + " kg";
+ sep = "; ";
+ }
if(((JumpType) currentEventType).HasFall)
{
if(! extra_window_jumps_check_dj_fall_calculate.Active)
{
- name += extra_window_jumps_spinbutton_fall.Value.ToString() + " cm";
+ name += sep + extra_window_jumps_spinbutton_fall.Value.ToString() + " cm";
sep = "; ";
}
- } if(((JumpType) currentEventType).HasWeight)
+ }
+
+ label_contacts_exercise_selected_options.Text = name;
+ }
+
+ private void setLabelContactsExerciseSelectedOptionsJumpsReactive()
+ {
+ LogB.Information("TT1");
+ if(currentEventType == null)
+ return;
+
+ LogB.Information("TT2");
+ string name = "";
+ string sep = "";
+
+ if(((JumpType) currentEventType).FixedValue >= 0)
{
- if(extra_window_jumps_radiobutton_weight.Active)
- name += sep + label_extra_window_jumps_radiobutton_weight_percent_as_kg.Text;
+ name += extra_window_jumps_rj_spinbutton_limit.Value.ToString();
+ if(((JumpType) currentEventType).JumpsLimited)
+ name += sep + " " + Catalog.GetString("jumps");
else
- name += sep + extra_window_jumps_spinbutton_weight.Value.ToString() + " kg";
+ name += sep + " " + Catalog.GetString("seconds");
+
+ sep = "; ";
+ }
+ if(((JumpType) currentEventType).HasWeight)
+ {
+ if(extra_window_jumps_rj_radiobutton_weight.Active)
+ name += sep +
label_extra_window_jumps_rj_radiobutton_weight_percent_as_kg.Text;
+ else
+ name += sep + extra_window_jumps_rj_spinbutton_weight.Value.ToString() + "
kg";
+ sep = "; ";
+ }
+ if(((JumpType) currentEventType).HasFall)
+ {
+ name += sep + extra_window_jumps_rj_spinbutton_fall.Value.ToString() + " cm";
+ sep = "; ";
}
label_contacts_exercise_selected_options.Text = name;
diff --git a/src/gui/jump.cs b/src/gui/jump.cs
index 92bb8352..956b6cfe 100644
--- a/src/gui/jump.cs
+++ b/src/gui/jump.cs
@@ -1264,6 +1264,8 @@ public partial class ChronoJumpWindow
} else {
extra_window_jumps_rj_radiobutton_weight.Active = true;
}
+
+ setLabelContactsExerciseSelectedOptionsJumpsReactive();
}
private void on_extra_window_jumps_check_dj_arms_clicked(object o, EventArgs args)
@@ -1383,6 +1385,7 @@ public partial class ChronoJumpWindow
{
extra_window_jumps_option = "Kg";
label_extra_window_jumps_radiobutton_weight_percent_as_kg.Visible = false;
+ setLabelContactsExerciseSelectedOptionsJumpsSimple();
}
private void on_extra_window_jumps_radiobutton_weight_toggled (object o, EventArgs args)
@@ -1394,11 +1397,12 @@ public partial class ChronoJumpWindow
setLabelContactsExerciseSelectedOptionsJumpsSimple();
}
-
+
private void on_extra_window_jumps_rj_radiobutton_kg_toggled (object o, EventArgs args)
{
extra_window_jumps_rj_option = "Kg";
label_extra_window_jumps_rj_radiobutton_weight_percent_as_kg.Visible = false;
+ setLabelContactsExerciseSelectedOptionsJumpsReactive();
}
private void on_extra_window_jumps_rj_radiobutton_weight_toggled (object o, EventArgs args)
@@ -1431,6 +1435,7 @@ public partial class ChronoJumpWindow
private void on_extra_window_jumps_rj_spinbutton_weight_value_changed (object o, EventArgs args)
{
update_label_extra_window_jumps_rj_radiobutton_weight_percent_as_kg(true);
+ setLabelContactsExerciseSelectedOptionsJumpsReactive();
}
private void update_label_extra_window_jumps_rj_radiobutton_weight_percent_as_kg(bool show)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]