[chronojump] selector for change runs simple/intervallic/encoder



commit 3d218307e5a14e845e6d52d764373c150f78f4e7
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Mar 31 16:17:59 2021 +0200

    selector for change runs simple/intervallic/encoder

 glade/app1.glade           | 154 ++++++++++++++++++++++++++++++++++++++-------
 src/gui/app1/chronojump.cs |  44 ++++++++++++-
 src/gui/app1/icons.cs      |   3 +
 3 files changed, 177 insertions(+), 24 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 59161fb5..06236916 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -5088,20 +5088,24 @@ EncoderInertialCapture</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkHBox" id="hbox_change_modes_jumps">
+                                                  <widget class="GtkHBox" id="hbox422">
+                                                    <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
-                                                    <property name="spacing">6</property>
                                                     <child>
-                                                      <widget class="GtkRadioButton" 
id="radio_change_modes_contacts_jumps_simple">
-                                                        <property name="width_request">40</property>
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="receives_default">False</property>
-                                                        <property name="active">True</property>
-                                                        <property name="draw_indicator">False</property>
-                                                        <signal name="toggled" 
handler="on_radio_change_modes_contacts_jumps_simple_toggled" swapped="no"/>
+                                                      <widget class="GtkHBox" id="hbox_change_modes_jumps">
+                                                        <property name="can_focus">False</property>
+                                                        <property name="spacing">6</property>
                                                         <child>
-                                                          <widget class="GtkEventBox" 
id="eventbox_change_modes_contacts_jumps_simple">
+                                                          <widget class="GtkRadioButton" 
id="radio_change_modes_contacts_jumps_simple">
+                                                            <property name="width_request">40</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <signal name="toggled" 
handler="on_radio_change_modes_contacts_jumps_simple_toggled" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkEventBox" 
id="eventbox_change_modes_contacts_jumps_simple">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
@@ -5111,7 +5115,44 @@ EncoderInertialCapture</property>
                                                             <property 
name="stock">gtk-missing-image</property>
                                                             </widget>
                                                             </child>
+                                                            </widget>
+                                                            </child>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkRadioButton" 
id="radio_change_modes_contacts_jumps_reactive">
+                                                            <property name="width_request">40</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <property 
name="group">radio_change_modes_contacts_jumps_simple</property>
+                                                            <signal name="toggled" 
handler="on_radio_change_modes_contacts_jumps_reactive_toggled" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkEventBox" 
id="eventbox_change_modes_contacts_jumps_reactive">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_change_modes_contacts_jumps_reactive">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
                                                           </widget>
+                                                          <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                          </packing>
                                                         </child>
                                                       </widget>
                                                       <packing>
@@ -5121,27 +5162,96 @@ EncoderInertialCapture</property>
                                                       </packing>
                                                     </child>
                                                     <child>
-                                                      <widget class="GtkRadioButton" 
id="radio_change_modes_contacts_jumps_reactive">
-                                                        <property name="width_request">40</property>
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="receives_default">False</property>
-                                                        <property name="active">True</property>
-                                                        <property name="draw_indicator">False</property>
-                                                        <property 
name="group">radio_change_modes_contacts_jumps_simple</property>
-                                                        <signal name="toggled" 
handler="on_radio_change_modes_contacts_jumps_reactive_toggled" swapped="no"/>
+                                                      <widget class="GtkHBox" id="hbox_change_modes_runs">
+                                                        <property name="can_focus">False</property>
+                                                        <property name="spacing">6</property>
                                                         <child>
-                                                          <widget class="GtkEventBox" 
id="eventbox_change_modes_contacts_jumps_reactive">
+                                                          <widget class="GtkRadioButton" 
id="radio_change_modes_contacts_runs_simple">
+                                                            <property name="width_request">40</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <signal name="toggled" 
handler="on_radio_change_modes_contacts_runs_simple_toggled" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkEventBox" 
id="eventbox_change_modes_contacts_runs_simple">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
-                                                            <widget class="GtkImage" 
id="image_change_modes_contacts_jumps_reactive">
+                                                            <widget class="GtkImage" 
id="image_change_modes_contacts_runs_simple">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkRadioButton" 
id="radio_change_modes_contacts_runs_intervallic">
+                                                            <property name="width_request">40</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <property 
name="group">radio_change_modes_contacts_runs_simple</property>
+                                                            <signal name="toggled" 
handler="on_radio_change_modes_contacts_runs_intervallic_toggled" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkEventBox" 
id="eventbox_change_modes_contacts_runs_intervallic">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_change_modes_contacts_runs_intervallic">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property 
name="stock">gtk-missing-image</property>
                                                             </widget>
                                                             </child>
+                                                            </widget>
+                                                            </child>
                                                           </widget>
+                                                          <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkRadioButton" 
id="radio_change_modes_contacts_runs_encoder">
+                                                            <property name="width_request">40</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">False</property>
+                                                            <property 
name="group">radio_change_modes_contacts_runs_simple</property>
+                                                            <signal name="toggled" 
handler="on_radio_change_modes_contacts_runs_encoder_toggled" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkEventBox" 
id="eventbox_change_modes_contacts_runs_encoder">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_change_modes_contacts_runs_encoder">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">2</property>
+                                                          </packing>
                                                         </child>
                                                       </widget>
                                                       <packing>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index e16fe63b..f07cae4f 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -72,14 +72,25 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Button button_show_modes_contacts;
        [Widget] Gtk.Button button_show_modes_encoder;
        [Widget] Gtk.HBox hbox_change_modes_jumps;
+       [Widget] Gtk.HBox hbox_change_modes_runs;
        [Widget] Gtk.RadioButton radio_change_modes_contacts_jumps_simple;
        [Widget] Gtk.RadioButton radio_change_modes_contacts_jumps_reactive;
+       [Widget] Gtk.RadioButton radio_change_modes_contacts_runs_simple;
+       [Widget] Gtk.RadioButton radio_change_modes_contacts_runs_intervallic;
+       [Widget] Gtk.RadioButton radio_change_modes_contacts_runs_encoder;
        [Widget] Gtk.Image image_change_modes_contacts_jumps_simple;
        [Widget] Gtk.Image image_change_modes_contacts_jumps_reactive;
+       [Widget] Gtk.Image image_change_modes_contacts_runs_simple;
+       [Widget] Gtk.Image image_change_modes_contacts_runs_reactive;
+       [Widget] Gtk.Image image_change_modes_contacts_runs_intervallic;
+       [Widget] Gtk.Image image_change_modes_contacts_runs_encoder;
 
        [Widget] Gtk.EventBox eventbox_button_show_modes_contacts;
        [Widget] Gtk.EventBox eventbox_change_modes_contacts_jumps_simple;
        [Widget] Gtk.EventBox eventbox_change_modes_contacts_jumps_reactive;
+       [Widget] Gtk.EventBox eventbox_change_modes_contacts_runs_simple;
+       [Widget] Gtk.EventBox eventbox_change_modes_contacts_runs_intervallic;
+       [Widget] Gtk.EventBox eventbox_change_modes_contacts_runs_encoder;
        [Widget] Gtk.EventBox eventbox_button_show_modes_encoder;
        [Widget] Gtk.EventBox eventbox_radio_mode_contacts_capture;
        [Widget] Gtk.EventBox eventbox_radio_mode_contacts_analyze;
@@ -603,6 +614,9 @@ public partial class ChronoJumpWindow
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_show_modes_contacts, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_jumps_simple, 
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_jumps_reactive, 
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
+               UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_runs_simple, 
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
+               UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_runs_intervallic, 
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
+               UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_runs_encoder, 
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_button_show_modes_encoder, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_radio_mode_contacts_capture, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
                UtilGtk.EventBoxColorBackgroundActive (eventbox_radio_mode_contacts_analyze, UtilGtk.YELLOW, 
UtilGtk.YELLOW_LIGHT);
@@ -2993,6 +3007,7 @@ public partial class ChronoJumpWindow
                }
 
                hbox_change_modes_jumps.Visible = false;
+               hbox_change_modes_runs.Visible = false;
                button_contacts_bells.Sensitive = false;
                radio_mode_contacts_capture.Active = true;
                radio_mode_contacts_jumps_profile.Active = true;
@@ -3099,6 +3114,8 @@ public partial class ChronoJumpWindow
                        label_contacts_exercise_selected_options.Visible = true;
                        image_top_laterality_contacts.Visible = false;
 
+                       hbox_change_modes_runs.Visible = true;
+
                        if(m == Constants.Menuitem_modes.RUNSSIMPLE) 
                        {
                                notebooks_change(m);
@@ -3303,6 +3320,8 @@ public partial class ChronoJumpWindow
                        alignment_button_threshold.Visible = false;
                        //notebook_capture_analyze.GetNthPage(2).Hide(); //hide jumpsProfile on other tests
 
+                       hbox_change_modes_runs.Visible = true;
+
                        hbox_contacts_graph_last_limit.Visible = false;
                        hbox_contacts_graph_person.Visible = false;
                        check_vbox_contacts_graph_legend.Visible = false;
@@ -3645,13 +3664,34 @@ public partial class ChronoJumpWindow
        }
        private void on_button_selector_start_runs_simple_clicked(object o, EventArgs args)
        {
-               changeMode (Constants.Menuitem_modes.RUNSSIMPLE);
+               if(radio_change_modes_contacts_runs_simple.Active)
+                       changeMode (Constants.Menuitem_modes.RUNSSIMPLE);
+               else
+                       radio_change_modes_contacts_runs_simple.Active = true;
        }
        private void on_button_selector_start_runs_intervallic_clicked(object o, EventArgs args) 
        {
-               changeMode (Constants.Menuitem_modes.RUNSINTERVALLIC);
+               if(radio_change_modes_contacts_runs_intervallic.Active)
+                       changeMode (Constants.Menuitem_modes.RUNSINTERVALLIC);
+               else
+                       radio_change_modes_contacts_runs_intervallic.Active = true;
        }
        private void on_button_selector_start_race_encoder_clicked(object o, EventArgs args)
+       {
+               if(radio_change_modes_contacts_runs_encoder.Active)
+                       changeMode (Constants.Menuitem_modes.RUNSENCODER);
+               else
+                       radio_change_modes_contacts_runs_encoder.Active = true;
+       }
+       private void on_radio_change_modes_contacts_runs_simple_toggled (object o, EventArgs args)
+       {
+               changeMode (Constants.Menuitem_modes.RUNSSIMPLE);
+       }
+       private void on_radio_change_modes_contacts_runs_intervallic_toggled (object o, EventArgs args)
+       {
+               changeMode (Constants.Menuitem_modes.RUNSINTERVALLIC);
+       }
+       private void on_radio_change_modes_contacts_runs_encoder_toggled (object o, EventArgs args)
        {
                changeMode (Constants.Menuitem_modes.RUNSENCODER);
        }
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index e1b66bcf..5619bba9 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -608,11 +608,14 @@ public partial class ChronoJumpWindow
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_run_simple.png");
                image_mode_runs_small.Pixbuf = pixbuf;
                image_mode_runs_small1.Pixbuf = pixbuf;
+               image_change_modes_contacts_runs_simple.Pixbuf = pixbuf;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_run_multiple.png");
                image_mode_runs_intervallic_small.Pixbuf = pixbuf;
                image_mode_runs_intervallic_small1.Pixbuf = pixbuf;
+               image_change_modes_contacts_runs_intervallic.Pixbuf = pixbuf;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "race_encoder_icon.png");
                image_mode_race_encoder_small.Pixbuf = pixbuf;
+               image_change_modes_contacts_runs_encoder.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "run_2x.png");
                image_run_execute_running.Pixbuf = pixbuf;


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