[chronojump] DB 1.24 runs options on SQL and preferences win



commit e2e66949f772d8b070cb8c214d374691ddfc7b71
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sun Jun 21 15:55:26 2015 +0200

    DB 1.24 runs options on SQL and preferences win

 glade/chronojump.glade    | 1189 +++++++++++++++++++++++----------------------
 src/constants.cs          |    2 +-
 src/execute/run.cs        |   25 +-
 src/gui/chronojump.cs     |   56 +--
 src/gui/preferences.cs    |  175 ++++++-
 src/gui/run.cs            |   43 --
 src/preferences.cs        |    9 +-
 src/sqlite/main.cs        |   40 ++-
 src/sqlite/preferences.cs |   25 +-
 9 files changed, 843 insertions(+), 721 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index ae62a7e..f901942 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -4563,269 +4563,6 @@ weight</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
-                                                            <child>
-                                                            <widget class="GtkHSeparator" id="hseparator6">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">2</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkVBox" 
id="vbox_run_speed_start">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">6</property>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label104">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" 
translatable="yes">"Speed start" means when athlete does not start with "contact" on the first platform or 
photocell.
-It starts before and arrives there with some speed.</property>
-                                                            <property name="xalign">0</property>
-                                                            <property name="label" translatable="yes">What 
to do on speed start?</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkVBox" id="vbox71">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkRadioButton" 
id="radio_runs_speed_start_arrival">
-                                                            <property name="label" translatable="yes">Time 
starts on arrival at first device</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">True</property>
-                                                            <signal name="toggled" 
handler="on_radio_runs_speed_start_toggled" swapped="no"/>
-                                                            </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_runs_speed_start_leaving">
-                                                            <property name="label" translatable="yes">Time 
starts on leaving first device</property>
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <property name="draw_indicator">True</property>
-                                                            <property 
name="group">radio_runs_speed_start_arrival</property>
-                                                            <signal name="toggled" 
handler="on_radio_runs_speed_start_toggled" swapped="no"/>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">3</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkHSeparator" id="hseparator4">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">4</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkVBox" id="vbox84">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">6</property>
-                                                            <child>
-                                                            <widget class="GtkCheckButton" 
id="checkbutton_runs_prevent_double_contact">
-                                                            <property name="label" 
translatable="yes">Prevent double contacts (recommended)</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">True</property>
-                                                            <signal name="toggled" 
handler="on_checkbutton_runs_prevent_double_contact_toggled" swapped="no"/>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkAlignment" id="alignment28">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="left_padding">12</property>
-                                                            <child>
-                                                            <widget class="GtkVBox" 
id="vbox_runs_prevent_double_contact">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label103">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="xalign">0</property>
-                                                            <property name="label" translatable="yes">Fix if 
found two or more contacts in</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="hbox101">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <child>
-                                                            <widget class="GtkSpinButton" 
id="spinbutton_runs_prevent_double_contact">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property name="invisible_char">●</property>
-                                                            <property 
name="invisible_char_set">True</property>
-                                                            <property 
name="primary_icon_activatable">False</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">1000 0 3000 100 1000 
0</property>
-                                                            <property name="snap_to_ticks">True</property>
-                                                            <property name="numeric">True</property>
-                                                            <property 
name="update_policy">if-valid</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="padding">12</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label105">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" 
translatable="yes">ms</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkAlignment" id="alignment29">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="left_padding">12</property>
-                                                            <child>
-                                                            <widget class="GtkVBox" id="vbox86">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkRadioButton" 
id="radio_runs_prevent_double_contact_first">
-                                                            <property name="label" translatable="yes">Take 
first contact</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">True</property>
-                                                            </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_runs_prevent_double_contact_average">
-                                                            <property name="label" translatable="yes">Take 
average</property>
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <property name="draw_indicator">True</property>
-                                                            <property 
name="group">radio_runs_prevent_double_contact_first</property>
-                                                            </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_runs_prevent_double_contact_last">
-                                                            <property name="label" translatable="yes">Take 
last contact (recommended)</property>
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <property name="draw_indicator">True</property>
-                                                            <property 
name="group">radio_runs_prevent_double_contact_first</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">2</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">2</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">5</property>
-                                                            </packing>
-                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -5030,277 +4767,14 @@ It starts before and arrives there with some speed.</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
-                                                            <child>
-                                                            <widget class="GtkHSeparator" id="hseparator7">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">2</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkVBox" 
id="vbox_run_i_speed_start">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">6</property>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label106">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" 
translatable="yes">"Speed start" means when athlete does not start with "contact" on the first platform or 
photocell.
-It starts before and arrives there with some speed.</property>
-                                                            <property name="xalign">0</property>
-                                                            <property name="label" translatable="yes">What 
to do on speed start?</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkVBox" id="vbox25">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkRadioButton" 
id="radio_runs_i_speed_start_arrival">
-                                                            <property name="label" translatable="yes">Time 
starts on arrival at first device</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">True</property>
-                                                            <signal name="toggled" 
handler="on_radio_runs_i_speed_start_toggled" swapped="no"/>
-                                                            </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_runs_i_speed_start_leaving">
-                                                            <property name="label" translatable="yes">Time 
starts on leaving first device      </property>
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <property name="draw_indicator">True</property>
-                                                            <property 
name="group">radio_runs_i_speed_start_arrival</property>
-                                                            <signal name="toggled" 
handler="on_radio_runs_i_speed_start_toggled" swapped="no"/>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </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>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkHSeparator" id="hseparator5">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">2</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkVBox" id="vbox22">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">6</property>
-                                                            <child>
-                                                            <widget class="GtkCheckButton" 
id="checkbutton_runs_i_prevent_double_contact">
-                                                            <property name="label" 
translatable="yes">Prevent double contacts (recommended)</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">True</property>
-                                                            <signal name="toggled" 
handler="on_checkbutton_runs_i_prevent_double_contact_toggled" swapped="no"/>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkAlignment" id="alignment14">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="left_padding">12</property>
-                                                            <child>
-                                                            <widget class="GtkVBox" 
id="vbox_runs_i_prevent_double_contact">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label35">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="xalign">0</property>
-                                                            <property name="label" translatable="yes">Fix if 
found two or more contacts in</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="hbox67">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <child>
-                                                            <widget class="GtkSpinButton" 
id="spinbutton_runs_i_prevent_double_contact">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property name="invisible_char">●</property>
-                                                            <property 
name="invisible_char_set">True</property>
-                                                            <property 
name="primary_icon_activatable">False</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">1000 0 3000 100 1000 
0</property>
-                                                            <property name="snap_to_ticks">True</property>
-                                                            <property name="numeric">True</property>
-                                                            <property 
name="update_policy">if-valid</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">True</property>
-                                                            <property name="padding">12</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label36">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" 
translatable="yes">ms</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
                                                             </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkAlignment" id="alignment15">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="left_padding">12</property>
-                                                            <child>
-                                                            <widget class="GtkVBox" id="vbox24">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkRadioButton" 
id="radio_runs_i_prevent_double_contact_first">
-                                                            <property name="label" translatable="yes">Take 
first contact</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">True</property>
-                                                            </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_runs_i_prevent_double_contact_average">
-                                                            <property name="label" translatable="yes">Take 
average (recommended)</property>
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <property name="draw_indicator">True</property>
-                                                            <property 
name="group">radio_runs_i_prevent_double_contact_first</property>
-                                                            </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_runs_i_prevent_double_contact_last">
-                                                            <property name="label" translatable="yes">Take 
last contact</property>
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <property name="draw_indicator">True</property>
-                                                            <property 
name="group">radio_runs_i_prevent_double_contact_first</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">2</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">2</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">3</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
                                                             </child>
                                                             </widget>
                                                             </child>
@@ -8000,6 +7474,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                           </widget>
                                                           <packing>
                                                             <property name="expand">True</property>
@@ -9021,6 +8498,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             <child>
@@ -10294,6 +9774,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -11208,6 +10691,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">4</property>
@@ -22504,6 +21990,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -23323,6 +22812,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -24634,6 +24126,9 @@ by you</property>
               <placeholder/>
             </child>
             <child>
+              <placeholder/>
+            </child>
+            <child>
               <widget class="GtkButton" id="button_video_url">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -25002,6 +24497,9 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -35762,6 +35260,24 @@ options</property>
                             <child>
                               <placeholder/>
                             </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <placeholder/>
+                            </child>
                           </widget>
                         </child>
                       </widget>
@@ -37000,6 +36516,18 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -38134,6 +37662,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                 <child>
                                   <placeholder/>
                                 </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
                               </widget>
                             </child>
                           </widget>
@@ -38991,6 +38522,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -39499,7 +39033,7 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                               <widget class="GtkTable" id="table1">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">False</property>
-                                                <property name="n_rows">3</property>
+                                                <property name="n_rows">2</property>
                                                 <property name="n_columns">3</property>
                                                 <property name="column_spacing">6</property>
                                                 <property name="row_spacing">6</property>
@@ -39516,19 +39050,6 @@ show elevation as:</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkLabel" id="label5">
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">False</property>
-                                                    <property name="xalign">0</property>
-                                                    <property name="label" translatable="yes">Speed 
units:</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="top_attach">1</property>
-                                                    <property name="bottom_attach">2</property>
-                                                    <property name="x_options">GTK_FILL</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
                                                   <widget class="GtkLabel" id="label21">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
@@ -39536,8 +39057,8 @@ show elevation as:</property>
                                                     <property name="label" translatable="yes">Weight 
units:</property>
                                                   </widget>
                                                   <packing>
-                                                    <property name="top_attach">2</property>
-                                                    <property name="bottom_attach">3</property>
+                                                    <property name="top_attach">1</property>
+                                                    <property name="bottom_attach">2</property>
                                                     <property name="x_options">GTK_FILL</property>
                                                   </packing>
                                                 </child>
@@ -39574,42 +39095,6 @@ show elevation as:</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkRadioButton" id="radio_speed_ms">
-                                                    <property name="label">m/s</property>
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">True</property>
-                                                    <property name="receives_default">False</property>
-                                                    <property name="xalign">0</property>
-                                                    <property name="active">True</property>
-                                                    <property name="draw_indicator">True</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="left_attach">1</property>
-                                                    <property name="right_attach">2</property>
-                                                    <property name="top_attach">1</property>
-                                                    <property name="bottom_attach">2</property>
-                                                    <property name="x_options">GTK_FILL</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkRadioButton" id="radio_speed_km">
-                                                    <property name="label">Km/h</property>
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">True</property>
-                                                    <property name="receives_default">False</property>
-                                                    <property name="xalign">0</property>
-                                                    <property name="draw_indicator">True</property>
-                                                    <property name="group">radio_speed_ms</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="left_attach">2</property>
-                                                    <property name="right_attach">3</property>
-                                                    <property name="top_attach">1</property>
-                                                    <property name="bottom_attach">2</property>
-                                                    <property name="x_options">GTK_FILL</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
                                                   <widget class="GtkRadioButton" id="radio_weight_percent">
                                                     <property name="label">%</property>
                                                     <property name="visible">True</property>
@@ -39622,8 +39107,8 @@ show elevation as:</property>
                                                   <packing>
                                                     <property name="left_attach">1</property>
                                                     <property name="right_attach">2</property>
-                                                    <property name="top_attach">2</property>
-                                                    <property name="bottom_attach">3</property>
+                                                    <property name="top_attach">1</property>
+                                                    <property name="bottom_attach">2</property>
                                                     <property name="x_options">GTK_FILL</property>
                                                   </packing>
                                                 </child>
@@ -39640,8 +39125,8 @@ show elevation as:</property>
                                                   <packing>
                                                     <property name="left_attach">2</property>
                                                     <property name="right_attach">3</property>
-                                                    <property name="top_attach">2</property>
-                                                    <property name="bottom_attach">3</property>
+                                                    <property name="top_attach">1</property>
+                                                    <property name="bottom_attach">2</property>
                                                     <property name="x_options">GTK_FILL</property>
                                                   </packing>
                                                 </child>
@@ -39954,7 +39439,7 @@ show elevation as:</property>
               <widget class="GtkLabel" id="label4">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Contacts</property>
+                <property name="label" translatable="yes">Jumps</property>
               </widget>
               <packing>
                 <property name="position">1</property>
@@ -39963,6 +39448,523 @@ show elevation as:</property>
               </packing>
             </child>
             <child>
+              <widget class="GtkVBox" id="vbox14">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="border_width">8</property>
+                <property name="spacing">20</property>
+                <child>
+                  <widget class="GtkHBox" id="hbox13">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <widget class="GtkLabel" id="label5">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Speed units:</property>
+                      </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_speed_ms">
+                        <property name="label">m/s</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                      </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_speed_km">
+                        <property name="label">Km/h</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                        <property name="group">radio_speed_ms</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox_run_speed_start">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <widget class="GtkLabel" id="label104">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip" translatable="yes">"Speed start" means when athlete does 
not start with "contact" on the first platform or photocell.
+It starts before and arrives there with some speed.</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">What to do on speed start?</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkVBox" id="vbox71">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">4</property>
+                        <child>
+                          <widget class="GtkRadioButton" id="radio_runs_speed_start_arrival">
+                            <property name="label" translatable="yes">Time starts on arrival at first 
device</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">True</property>
+                          </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_runs_speed_start_leaving">
+                            <property name="label" translatable="yes">Time starts on leaving first 
device</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">radio_runs_speed_start_arrival</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkNotebook" id="notebook1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <child>
+                      <widget class="GtkVBox" id="vbox84">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="border_width">8</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <widget class="GtkCheckButton" id="checkbutton_runs_prevent_double_contact">
+                            <property name="label" translatable="yes">Prevent double contacts 
(recommended)</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">True</property>
+                            <signal name="toggled" 
handler="on_checkbutton_runs_prevent_double_contact_toggled" swapped="no"/>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkAlignment" id="alignment28">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="left_padding">12</property>
+                            <child>
+                              <widget class="GtkVBox" id="vbox_runs_prevent_double_contact">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">4</property>
+                                <child>
+                                  <widget class="GtkLabel" id="label103">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Fix if found two or more 
contacts in</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="hbox101">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <child>
+                                      <widget class="GtkSpinButton" 
id="spinbutton_runs_prevent_double_contact">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">●</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="primary_icon_activatable">False</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">1000 0 3000 100 1000 0</property>
+                                        <property name="snap_to_ticks">True</property>
+                                        <property name="numeric">True</property>
+                                        <property name="update_policy">if-valid</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="padding">12</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkLabel" id="label105">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label" translatable="yes">ms</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkAlignment" id="alignment29">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="left_padding">12</property>
+                                    <child>
+                                      <widget class="GtkVBox" id="vbox86">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">4</property>
+                                        <child>
+                                          <widget class="GtkRadioButton" 
id="radio_runs_prevent_double_contact_first">
+                                            <property name="label" translatable="yes">Take first 
contact</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">True</property>
+                                          </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_runs_prevent_double_contact_average">
+                                            <property name="label" translatable="yes">Take average</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="draw_indicator">True</property>
+                                            <property 
name="group">radio_runs_prevent_double_contact_first</property>
+                                          </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_runs_prevent_double_contact_last">
+                                            <property name="label" translatable="yes">Take last contact 
(recommended)</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="draw_indicator">True</property>
+                                            <property 
name="group">radio_runs_prevent_double_contact_first</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">2</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                            </child>
+                          </widget>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label44">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Double contacts on simple runs</property>
+                      </widget>
+                      <packing>
+                        <property name="tab_fill">False</property>
+                        <property name="type">tab</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkVBox" id="vbox22">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="border_width">8</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <widget class="GtkCheckButton" id="checkbutton_runs_i_prevent_double_contact">
+                            <property name="label" translatable="yes">Prevent double contacts 
(recommended)</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">True</property>
+                            <signal name="toggled" 
handler="on_checkbutton_runs_i_prevent_double_contact_toggled" swapped="no"/>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkAlignment" id="alignment14">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="left_padding">12</property>
+                            <child>
+                              <widget class="GtkVBox" id="vbox_runs_i_prevent_double_contact">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">4</property>
+                                <child>
+                                  <widget class="GtkLabel" id="label43">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Fix if found two or more 
contacts in</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="hbox67">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <child>
+                                      <widget class="GtkSpinButton" 
id="spinbutton_runs_i_prevent_double_contact">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">●</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="primary_icon_activatable">False</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">1000 0 3000 100 1000 0</property>
+                                        <property name="snap_to_ticks">True</property>
+                                        <property name="numeric">True</property>
+                                        <property name="update_policy">if-valid</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">True</property>
+                                        <property name="padding">12</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkLabel" id="label46">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label" translatable="yes">ms</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkAlignment" id="alignment15">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="left_padding">12</property>
+                                    <child>
+                                      <widget class="GtkVBox" id="vbox24">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="spacing">4</property>
+                                        <child>
+                                          <widget class="GtkRadioButton" 
id="radio_runs_i_prevent_double_contact_first">
+                                            <property name="label" translatable="yes">Take first 
contact</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">True</property>
+                                          </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_runs_i_prevent_double_contact_average">
+                                            <property name="label" translatable="yes">Take average 
(recommended)</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="draw_indicator">True</property>
+                                            <property 
name="group">radio_runs_i_prevent_double_contact_first</property>
+                                          </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_runs_i_prevent_double_contact_last">
+                                            <property name="label" translatable="yes">Take last 
contact</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="draw_indicator">True</property>
+                                            <property 
name="group">radio_runs_i_prevent_double_contact_first</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">2</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                            </child>
+                          </widget>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label45">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">on intervallic runs</property>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                        <property name="tab_fill">False</property>
+                        <property name="type">tab</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label42">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Runs</property>
+              </widget>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+                <property name="type">tab</property>
+              </packing>
+            </child>
+            <child>
               <widget class="GtkScrolledWindow" id="scrolledwindow2">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -40450,7 +40452,7 @@ show elevation as:</property>
                 </child>
               </widget>
               <packing>
-                <property name="position">2</property>
+                <property name="position">3</property>
               </packing>
             </child>
             <child>
@@ -40460,7 +40462,7 @@ show elevation as:</property>
                 <property name="label" translatable="yes">Encoder</property>
               </widget>
               <packing>
-                <property name="position">2</property>
+                <property name="position">3</property>
                 <property name="tab_fill">False</property>
                 <property name="type">tab</property>
               </packing>
@@ -40499,7 +40501,7 @@ show elevation as:</property>
                 </child>
               </widget>
               <packing>
-                <property name="position">3</property>
+                <property name="position">4</property>
               </packing>
             </child>
             <child>
@@ -40509,7 +40511,7 @@ show elevation as:</property>
                 <property name="label" translatable="yes">Camera</property>
               </widget>
               <packing>
-                <property name="position">3</property>
+                <property name="position">4</property>
                 <property name="tab_fill">False</property>
                 <property name="type">tab</property>
               </packing>
@@ -40762,7 +40764,7 @@ show elevation as:</property>
                 </child>
               </widget>
               <packing>
-                <property name="position">4</property>
+                <property name="position">5</property>
               </packing>
             </child>
             <child>
@@ -40772,7 +40774,7 @@ show elevation as:</property>
                 <property name="label" translatable="yes">Other</property>
               </widget>
               <packing>
-                <property name="position">4</property>
+                <property name="position">5</property>
                 <property name="tab_fill">False</property>
                 <property name="type">tab</property>
               </packing>
@@ -41838,6 +41840,9 @@ show elevation as:</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                       <packing>
                         <property name="left_attach">2</property>
@@ -42321,6 +42326,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -42819,6 +42827,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
diff --git a/src/constants.cs b/src/constants.cs
index 7bd9e22..2a8bd6a 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -825,7 +825,7 @@ public class Constants
        public enum EncoderAutoSaveCurve { ALL, NONE, BESTMEANPOWER }
 
        public enum DoubleContact {
-               FIRST, AVERAGE, LAST
+               NONE, FIRST, AVERAGE, LAST
        }
        
        //DISPLACED means: total
diff --git a/src/execute/run.cs b/src/execute/run.cs
index 46515a8..a063ee5 100644
--- a/src/execute/run.cs
+++ b/src/execute/run.cs
@@ -43,9 +43,8 @@ public class RunExecute : EventExecute
        }
        protected static runPhases runPhase;
                
-       protected bool checkDoubleContact;
-       protected int checkDoubleContactTime;
        protected Constants.DoubleContact checkDoubleContactMode;
+       protected int checkDoubleContactTime;
        
        protected bool speedStartArrival;       
        
@@ -57,8 +56,7 @@ public class RunExecute : EventExecute
                        Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, 
                        int pDN, bool metersSecondsPreferred, bool volumeOn,
                        double progressbarLimit, ExecutingGraphData egd,
-                       bool checkDoubleContact, int checkDoubleContactTime, 
-                       Constants.DoubleContact checkDoubleContactMode,
+                       Constants.DoubleContact checkDoubleContactMode, int checkDoubleContactTime, 
                        bool speedStartArrival
                        )
        {
@@ -76,9 +74,8 @@ public class RunExecute : EventExecute
                this.volumeOn = volumeOn;
                this.progressbarLimit = progressbarLimit;
                this.egd = egd;
-               this.checkDoubleContact = checkDoubleContact;
-               this.checkDoubleContactTime = checkDoubleContactTime;
                this.checkDoubleContactMode = checkDoubleContactMode;
+               this.checkDoubleContactTime = checkDoubleContactTime;
                this.speedStartArrival = speedStartArrival;     
                
                fakeButtonUpdateGraph = new Gtk.Button();
@@ -231,7 +228,7 @@ public class RunExecute : EventExecute
                                                        timestamp = simulatedTimeLast * 1000; //conversion to 
milliseconds
 
                                                //prevent double contact stuff
-                                               if(checkDoubleContact) {
+                                               if(checkDoubleContactMode != Constants.DoubleContact.NONE) {
                                                        if(timestamp <= checkDoubleContactTime) {
                                                                /*
                                                                   when checking double contact
@@ -268,7 +265,7 @@ public class RunExecute : EventExecute
                                                        }
                                                }
                                                
-                                               if(! checkDoubleContact)
+                                               if(checkDoubleContactMode == Constants.DoubleContact.NONE)
                                                        success = true;
 
                                                if(success) {
@@ -300,7 +297,7 @@ public class RunExecute : EventExecute
                                        //change the automata state
                                        loggedState = States.OFF;
 
-                                       if(checkDoubleContact && timestampDCn > 0)
+                                       if(checkDoubleContactMode != Constants.DoubleContact.NONE && 
timestampDCn > 0)
                                                timestampDCContactTimes += timestamp;
                                        else {
                                                if(runPhase == runPhases.PLATFORM_INI_YES_TIME)
@@ -473,8 +470,7 @@ public class RunIntervalExecute : RunExecute
                        Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool 
metersSecondsPreferred, 
                        bool volumeOn, RepetitiveConditionsWindow repetitiveConditionsWin,
                        double progressbarLimit, ExecutingGraphData egd ,
-                       bool checkDoubleContact, int checkDoubleContactTime, 
-                       Constants.DoubleContact checkDoubleContactMode,
+                       Constants.DoubleContact checkDoubleContactMode, int checkDoubleContactTime, 
                        bool speedStartArrival
                        )
        {
@@ -511,9 +507,8 @@ public class RunIntervalExecute : RunExecute
                this.repetitiveConditionsWin = repetitiveConditionsWin;
                this.progressbarLimit = progressbarLimit;
                this.egd = egd;
-               this.checkDoubleContact = checkDoubleContact;
-               this.checkDoubleContactTime = checkDoubleContactTime;
                this.checkDoubleContactMode = checkDoubleContactMode;
+               this.checkDoubleContactTime = checkDoubleContactTime;
                this.speedStartArrival = speedStartArrival;     
        
                fakeButtonUpdateGraph = new Gtk.Button();
@@ -594,7 +589,7 @@ public class RunIntervalExecute : RunExecute
                                                if(simulated)
                                                        timestamp = simulatedTimeLast * 1000; //conversion to 
milliseconds
 
-                                               if(checkDoubleContact) {
+                                               if(checkDoubleContactMode != Constants.DoubleContact.NONE) {
                                                        if(timestamp <= checkDoubleContactTime) {
                                                                /*
                                                                   when checking double contact
@@ -715,7 +710,7 @@ public class RunIntervalExecute : RunExecute
                                                feedbackMessage = "";
                                                needShowFeedbackMessage = true; 
                                        } else {
-                                               if(checkDoubleContact && timestampDCn > 0)
+                                               if(checkDoubleContactMode != Constants.DoubleContact.NONE && 
timestampDCn > 0)
                                                        timestampDCContactTimes += timestamp;
                                                else 
                                                          lastTc = timestamp/1000.0;
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 45edee7..6a7f06c 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -572,14 +572,6 @@ public partial class ChronoJumpWindow
                on_extra_window_jumps_test_changed(new object(), new EventArgs());
                //changeTestImage("", "", "LOGO");
 
-               //don't know why Glade is not doing this
-               spinbutton_runs_prevent_double_contact.Value=1000;
-               spinbutton_runs_i_prevent_double_contact.Value=1000;
-                       
-               radio_runs_prevent_double_contact_last.Active = true;
-               radio_runs_i_prevent_double_contact_average.Active = true;
-
-
                //We have no session, mark some widgets as ".Sensitive = false"
                sensitiveGuiNoSession();
                definedSession = false;
@@ -873,22 +865,6 @@ public partial class ChronoJumpWindow
                
                changeVideoButtons(preferences.videoOn);
 
-               //load preferences, update radios, but not update database
-               update_sqlite_at_runs_speed_radios = false;
-
-               if (preferences.runSpeedStartArrival) 
-                       radio_runs_speed_start_arrival.Active = true;
-               else
-                       radio_runs_speed_start_leaving.Active = true;
-
-               if (preferences.runISpeedStartArrival) 
-                       radio_runs_i_speed_start_arrival.Active = true;
-               else
-                       radio_runs_i_speed_start_leaving.Active = true;
-               
-               update_sqlite_at_runs_speed_radios = true;
-
-
                //change language works on windows. On Linux let's change the locale
                //if(UtilAll.IsWindows())
                //      languageChange();
@@ -4139,24 +4115,6 @@ public partial class ChronoJumpWindow
         *  --------------------------------------------------------
         */
 
-       private Constants.DoubleContact getDoubleContactModes(bool runSimple) {
-               if(runSimple) {
-                       if(radio_runs_prevent_double_contact_first.Active)
-                               return Constants.DoubleContact.FIRST;
-                       else if(radio_runs_prevent_double_contact_average.Active)
-                               return Constants.DoubleContact.AVERAGE;
-                       else
-                               return Constants.DoubleContact.LAST;
-               } else {        //runInterval
-                       if(radio_runs_i_prevent_double_contact_first.Active)
-                               return Constants.DoubleContact.FIRST;
-                       else if(radio_runs_i_prevent_double_contact_average.Active)
-                               return Constants.DoubleContact.AVERAGE;
-                       else
-                               return Constants.DoubleContact.LAST;
-               }
-       }
-       
        //suitable for all runs not repetitive
        private void on_normal_run_activate (object o, EventArgs args) 
        {
@@ -4209,10 +4167,9 @@ public partial class ChronoJumpWindow
                                chronopicWin.CP, event_execute_label_message, app1,
                                preferences.digitsNumber, preferences.metersSecondsPreferred, 
preferences.volumeOn, 
                                progressbarLimit, egd,
-                               checkbutton_runs_prevent_double_contact.Active, 
-                               (int) spinbutton_runs_prevent_double_contact.Value,
-                               getDoubleContactModes(true),    //true: runSimple
-                               radio_runs_speed_start_arrival.Active
+                               preferences.runDoubleContactsMode,
+                               preferences.runDoubleContactsMS,
+                               preferences.runSpeedStartArrival
                                );
                
                if (!chronopicWin.Connected) 
@@ -4333,10 +4290,9 @@ public partial class ChronoJumpWindow
                                chronopicWin.CP, event_execute_label_message, app1,
                                preferences.digitsNumber, preferences.metersSecondsPreferred, 
preferences.volumeOn, repetitiveConditionsWin, 
                                progressbarLimit, egd,
-                               checkbutton_runs_i_prevent_double_contact.Active, 
-                               (int) spinbutton_runs_i_prevent_double_contact.Value,
-                               getDoubleContactModes(false),   //false: not runSimple
-                               radio_runs_i_speed_start_arrival.Active
+                               preferences.runIDoubleContactsMode,
+                               preferences.runIDoubleContactsMS,
+                               preferences.runSpeedStartArrival
                                );
                
                
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index c2bbd41..cf36d9b 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -34,6 +34,8 @@ public class PreferencesWindow {
        
        [Widget] Gtk.Window preferences_win;
 
+
+       //database tab
        [Widget] Gtk.Label label_database;
        [Widget] Gtk.Label label_database_temp;
        
@@ -50,55 +52,72 @@ public class PreferencesWindow {
        [Widget] Gtk.Box hbox_backup_doing;
        [Widget] Gtk.ProgressBar pulsebar;
 
-       [Widget] Gtk.ComboBox combo_decimals;
+       
+       //jumps tab     
        [Widget] Gtk.CheckButton checkbutton_power;
        [Widget] Gtk.CheckButton checkbutton_stiffness;
        [Widget] Gtk.CheckButton checkbutton_initial_speed;
        [Widget] Gtk.CheckButton checkbutton_angle;
-       
        [Widget] Gtk.CheckButton checkbutton_show_tv_tc_index;
        [Widget] Gtk.Box hbox_indexes;
        [Widget] Gtk.RadioButton radiobutton_show_q_index;
        [Widget] Gtk.RadioButton radiobutton_show_dj_index;
-       
-       [Widget] Gtk.CheckButton checkbutton_ask_deletion;
-
        [Widget] Gtk.RadioButton radio_elevation_height;
        [Widget] Gtk.RadioButton radio_elevation_tf;
-       [Widget] Gtk.RadioButton radio_speed_ms;
-       [Widget] Gtk.RadioButton radio_speed_km;
        [Widget] Gtk.RadioButton radio_weight_percent;
        [Widget] Gtk.RadioButton radio_weight_kg;
+       [Widget] Gtk.RadioButton radio_use_heights_on_jump_indexes;
+       [Widget] Gtk.RadioButton radio_do_not_use_heights_on_jump_indexes;
+                       
+       //runs tab      
+       [Widget] Gtk.RadioButton radio_speed_ms;
+       [Widget] Gtk.RadioButton radio_speed_km;
+       [Widget] Gtk.RadioButton radio_runs_speed_start_arrival; 
+       [Widget] Gtk.RadioButton radio_runs_speed_start_leaving; 
+       [Widget] Gtk.Box vbox_runs_prevent_double_contact;
+       [Widget] Gtk.CheckButton checkbutton_runs_prevent_double_contact;
+       [Widget] Gtk.SpinButton spinbutton_runs_prevent_double_contact;
+       [Widget] Gtk.RadioButton radio_runs_prevent_double_contact_first;
+       [Widget] Gtk.RadioButton radio_runs_prevent_double_contact_average;
+       [Widget] Gtk.RadioButton radio_runs_prevent_double_contact_last;
+       [Widget] Gtk.Box vbox_runs_i_prevent_double_contact;
+       [Widget] Gtk.CheckButton checkbutton_runs_i_prevent_double_contact;
+       [Widget] Gtk.SpinButton spinbutton_runs_i_prevent_double_contact;
+       [Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_first;
+       [Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_average;
+       [Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_last;
        
+       //encoder tab   
        [Widget] Gtk.CheckButton checkbutton_encoder_propulsive;
        [Widget] Gtk.SpinButton spin_encoder_smooth_con;
        [Widget] Gtk.Label label_encoder_con;
-                       
        [Widget] Gtk.RadioButton radio_encoder_1RM_nonweighted;
        [Widget] Gtk.RadioButton radio_encoder_1RM_weighted;
        [Widget] Gtk.RadioButton radio_encoder_1RM_weighted2;
        [Widget] Gtk.RadioButton radio_encoder_1RM_weighted3;
-                       
+       [Widget] Gtk.RadioButton radio_encoder_auto_save_curve_bestmeanpower;
+       [Widget] Gtk.RadioButton radio_encoder_auto_save_curve_all;
+       [Widget] Gtk.RadioButton radio_encoder_auto_save_curve_none;
+
+       //camera tab
+       [Widget] Gtk.Box hbox_combo_camera;
+       [Widget] Gtk.ComboBox combo_camera;
+       
+       //other tab
+       [Widget] Gtk.ComboBox combo_decimals;
+       [Widget] Gtk.CheckButton checkbutton_ask_deletion;
        [Widget] Gtk.RadioButton radio_export_latin;
        [Widget] Gtk.RadioButton radio_export_non_latin;
-       
        [Widget] Gtk.RadioButton radio_graphs_translate;
        [Widget] Gtk.RadioButton radio_graphs_no_translate;
 
-       [Widget] Gtk.RadioButton radio_use_heights_on_jump_indexes;
-       [Widget] Gtk.RadioButton radio_do_not_use_heights_on_jump_indexes;
        
-       [Widget] Gtk.RadioButton radio_encoder_auto_save_curve_bestmeanpower;
-       [Widget] Gtk.RadioButton radio_encoder_auto_save_curve_all;
-       [Widget] Gtk.RadioButton radio_encoder_auto_save_curve_none;
 
 
 //     [Widget] Gtk.Box hbox_language_row;
 //     [Widget] Gtk.Box hbox_combo_language;
 //     [Widget] Gtk.ComboBox combo_language;
 
-       [Widget] Gtk.Box hbox_combo_camera;
-       [Widget] Gtk.ComboBox combo_camera;
 
        [Widget] Gtk.Button button_accept;
        [Widget] Gtk.Button button_cancel;
@@ -209,6 +228,42 @@ public class PreferencesWindow {
                        PreferencesWindowBox.radio_speed_km.Active = true; 
 
 
+               if(preferences.runSpeedStartArrival)  
+                       PreferencesWindowBox.radio_runs_speed_start_arrival.Active = true; 
+               else 
+                       PreferencesWindowBox.radio_runs_speed_start_leaving.Active = true; 
+
+
+               //start of double contacts stuff ----
+               PreferencesWindowBox.checkbutton_runs_prevent_double_contact.Active = 
+                       (preferences.runDoubleContactsMode != Constants.DoubleContact.NONE);
+               PreferencesWindowBox.checkbutton_runs_i_prevent_double_contact.Active = 
+                       (preferences.runIDoubleContactsMode != Constants.DoubleContact.NONE);
+
+               PreferencesWindowBox.spinbutton_runs_prevent_double_contact.Value = 
+                       preferences.runDoubleContactsMS;
+               PreferencesWindowBox.spinbutton_runs_i_prevent_double_contact.Value = 
+                       preferences.runIDoubleContactsMS;
+                       
+               if(preferences.runDoubleContactsMode != Constants.DoubleContact.NONE) {
+                       if(preferences.runDoubleContactsMode == Constants.DoubleContact.FIRST)
+                               PreferencesWindowBox.radio_runs_prevent_double_contact_first.Active = true;
+                       else if(preferences.runDoubleContactsMode == Constants.DoubleContact.AVERAGE)
+                               PreferencesWindowBox.radio_runs_prevent_double_contact_average.Active = true;
+                       else // Constants.DoubleContact.LAST  DEFAULT
+                               PreferencesWindowBox.radio_runs_prevent_double_contact_last.Active = true;
+               }
+               if(preferences.runIDoubleContactsMode != Constants.DoubleContact.NONE) {
+                       if(preferences.runIDoubleContactsMode == Constants.DoubleContact.FIRST)
+                               PreferencesWindowBox.radio_runs_i_prevent_double_contact_first.Active = true;
+                       else if(preferences.runIDoubleContactsMode == Constants.DoubleContact.LAST)
+                               PreferencesWindowBox.radio_runs_i_prevent_double_contact_last.Active = true;
+                       else //Constants.DoubleContact.AVERAGE  DEFAULT
+                               PreferencesWindowBox.radio_runs_i_prevent_double_contact_average.Active = 
true;
+               }
+               //---- end of double contacts stuff             
+
+
                if(preferences.CSVExportDecimalSeparator == "COMMA")
                        PreferencesWindowBox.radio_export_latin.Active = true; 
                else
@@ -306,6 +361,14 @@ public class PreferencesWindow {
                else
                        hbox_indexes.Hide();
        }
+       
+       private void on_checkbutton_runs_prevent_double_contact_toggled (object o, EventArgs args) {
+               vbox_runs_prevent_double_contact.Visible = checkbutton_runs_prevent_double_contact.Active;
+       }
+       private void on_checkbutton_runs_i_prevent_double_contact_toggled (object o, EventArgs args) {
+               vbox_runs_i_prevent_double_contact.Visible = checkbutton_runs_i_prevent_double_contact.Active;
+       }
+
                
        void on_button_cancel_clicked (object o, EventArgs args)
        {
@@ -594,7 +657,85 @@ public class PreferencesWindow {
                        SqlitePreferences.Update("metersSecondsPreferred", 
PreferencesWindowBox.radio_speed_ms.Active.ToString(), true);
                        preferences.metersSecondsPreferred = PreferencesWindowBox.radio_speed_ms.Active;
                }
+               
+               if( preferences.runSpeedStartArrival != 
PreferencesWindowBox.radio_runs_speed_start_arrival.Active ) {
+                       SqlitePreferences.Update("runSpeedStartArrival", 
PreferencesWindowBox.radio_runs_speed_start_arrival.Active.ToString(), true);
+                       preferences.runSpeedStartArrival = 
PreferencesWindowBox.radio_runs_speed_start_arrival.Active;
+               }
+               
+               //start of double contacts stuff ----
+
+               //1 simple runs ----
+               
+               //1.1 was FIRST or AVERAGE or LAST and now will be NONE
+               if( (preferences.runDoubleContactsMode != Constants.DoubleContact.NONE) && 
+                               ! PreferencesWindowBox.checkbutton_runs_prevent_double_contact.Active) 
+               {
+                               SqlitePreferences.Update("runDoubleContactsMode", 
Constants.DoubleContact.NONE.ToString(), true);
+                               preferences.runDoubleContactsMode = Constants.DoubleContact.NONE;
+               }
+               else if(PreferencesWindowBox.checkbutton_runs_prevent_double_contact.Active) 
+               {
+                       //1.2 mode has changed between FIRST, AVERAGE or LAST
+                       if( PreferencesWindowBox.radio_runs_prevent_double_contact_first.Active &&
+                                       (preferences.runDoubleContactsMode != Constants.DoubleContact.FIRST) 
) {
+                               SqlitePreferences.Update("runDoubleContactsMode", 
Constants.DoubleContact.FIRST.ToString(), true);
+                               preferences.runDoubleContactsMode = Constants.DoubleContact.FIRST;
+                       }
+                       else if( PreferencesWindowBox.radio_runs_prevent_double_contact_average.Active &&
+                                       (preferences.runDoubleContactsMode != 
Constants.DoubleContact.AVERAGE) ) {
+                               SqlitePreferences.Update("runDoubleContactsMode", 
Constants.DoubleContact.AVERAGE.ToString(), true);
+                               preferences.runDoubleContactsMode = Constants.DoubleContact.AVERAGE;
+                       }
+                       else if( PreferencesWindowBox.radio_runs_prevent_double_contact_last.Active &&
+                                       (preferences.runDoubleContactsMode != Constants.DoubleContact.LAST) ) 
{
+                               SqlitePreferences.Update("runDoubleContactsMode", 
Constants.DoubleContact.LAST.ToString(), true);
+                               preferences.runDoubleContactsMode = Constants.DoubleContact.LAST;
+                       }
+
+                       if(preferences.runDoubleContactsMS != (int) 
PreferencesWindowBox.spinbutton_runs_prevent_double_contact.Value) {
+                               SqlitePreferences.Update("runDoubleContactsMS", 
+                                               
PreferencesWindowBox.spinbutton_runs_prevent_double_contact.Value.ToString(), true); //saved as string
+                               preferences.runDoubleContactsMS = (int) 
spinbutton_runs_prevent_double_contact.Value;
+                       }
+               }
+
+               //2 intervallic runs ----
+               
+               //2.1 was FIRST or AVERAGE or LAST and now will be NONE
+               if( (preferences.runIDoubleContactsMode != Constants.DoubleContact.NONE) && 
+                               ! PreferencesWindowBox.checkbutton_runs_i_prevent_double_contact.Active) 
+               {
+                               SqlitePreferences.Update("runIDoubleContactsMode", 
Constants.DoubleContact.NONE.ToString(), true);
+                               preferences.runIDoubleContactsMode = Constants.DoubleContact.NONE;
+               }
+               else if(PreferencesWindowBox.checkbutton_runs_i_prevent_double_contact.Active) 
+               {
+                       //2.2 mode has changed between FIRST, AVERAGE or LAST
+                       if( PreferencesWindowBox.radio_runs_i_prevent_double_contact_first.Active &&
+                                       (preferences.runIDoubleContactsMode != Constants.DoubleContact.FIRST) 
) {
+                               SqlitePreferences.Update("runIDoubleContactsMode", 
Constants.DoubleContact.FIRST.ToString(), true);
+                               preferences.runIDoubleContactsMode = Constants.DoubleContact.FIRST;
+                       }
+                       else if( PreferencesWindowBox.radio_runs_i_prevent_double_contact_average.Active &&
+                                       (preferences.runIDoubleContactsMode != 
Constants.DoubleContact.AVERAGE) ) {
+                               SqlitePreferences.Update("runIDoubleContactsMode", 
Constants.DoubleContact.AVERAGE.ToString(), true);
+                               preferences.runIDoubleContactsMode = Constants.DoubleContact.AVERAGE;
+                       }
+                       else if( PreferencesWindowBox.radio_runs_i_prevent_double_contact_last.Active &&
+                                       (preferences.runIDoubleContactsMode != Constants.DoubleContact.LAST) 
) {
+                               SqlitePreferences.Update("runIDoubleContactsMode", 
Constants.DoubleContact.LAST.ToString(), true);
+                               preferences.runIDoubleContactsMode = Constants.DoubleContact.LAST;
+                       }
+                       
+                       if(preferences.runIDoubleContactsMS != (int) 
PreferencesWindowBox.spinbutton_runs_i_prevent_double_contact.Value) {
+                               SqlitePreferences.Update("runIDoubleContactsMS", 
+                                               
PreferencesWindowBox.spinbutton_runs_i_prevent_double_contact.Value.ToString(), true); //saved as string
+                               preferences.runIDoubleContactsMS = (int) 
spinbutton_runs_i_prevent_double_contact.Value;
+                       }
+               }
 
+               //---- end of double contacts stuff
                
                
                if( preferences.encoderPropulsive != 
PreferencesWindowBox.checkbutton_encoder_propulsive.Active ) {
diff --git a/src/gui/run.cs b/src/gui/run.cs
index 46ed974..4bf9f37 100644
--- a/src/gui/run.cs
+++ b/src/gui/run.cs
@@ -894,15 +894,6 @@ partial class ChronoJumpWindow
        [Widget] Gtk.Label extra_window_runs_label_distance_units;
        [Widget] Gtk.Label extra_window_label_runs_no_options;
        
-       [Widget] Gtk.Box vbox_runs_prevent_double_contact;
-       [Widget] Gtk.CheckButton checkbutton_runs_prevent_double_contact;
-       [Widget] Gtk.SpinButton spinbutton_runs_prevent_double_contact;
-       [Widget] Gtk.RadioButton radio_runs_prevent_double_contact_first;
-       [Widget] Gtk.RadioButton radio_runs_prevent_double_contact_average;
-       [Widget] Gtk.RadioButton radio_runs_prevent_double_contact_last;
-       [Widget] Gtk.RadioButton radio_runs_speed_start_arrival;
-       [Widget] Gtk.RadioButton radio_runs_speed_start_leaving;
-       
        //options runs interval
        [Widget] Gtk.Label extra_window_runs_interval_label_distance;
        [Widget] Gtk.SpinButton extra_window_runs_interval_spinbutton_distance;
@@ -912,15 +903,6 @@ partial class ChronoJumpWindow
        [Widget] Gtk.Label extra_window_runs_interval_label_limit_units;
        [Widget] Gtk.Label extra_window_label_runs_interval_no_options;
        
-       [Widget] Gtk.Box vbox_runs_i_prevent_double_contact;
-       [Widget] Gtk.CheckButton checkbutton_runs_i_prevent_double_contact;
-       [Widget] Gtk.SpinButton spinbutton_runs_i_prevent_double_contact;
-       [Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_first;
-       [Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_average;
-       [Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_last;
-       [Widget] Gtk.RadioButton radio_runs_i_speed_start_arrival;
-       [Widget] Gtk.RadioButton radio_runs_i_speed_start_leaving;
-       
 
        double extra_window_runs_distance = 100;
        double extra_window_runs_interval_distance = 100;
@@ -1143,31 +1125,6 @@ partial class ChronoJumpWindow
                        extra_window_label_runs_no_options.Visible = ! hasOptions;
        }
 
-       protected void on_checkbutton_runs_prevent_double_contact_toggled (object o, EventArgs args) {
-               vbox_runs_prevent_double_contact.Visible = checkbutton_runs_prevent_double_contact.Active;
-       }
-       protected void on_checkbutton_runs_i_prevent_double_contact_toggled (object o, EventArgs args) {
-               vbox_runs_i_prevent_double_contact.Visible = checkbutton_runs_i_prevent_double_contact.Active;
-       }
-
-
-       bool update_sqlite_at_runs_speed_radios = false;
-       private void on_radio_runs_speed_start_toggled (object o, EventArgs args) {
-               if(update_sqlite_at_runs_speed_radios) {
-                       if(radio_runs_speed_start_arrival.Active)
-                               SqlitePreferences.Update("runSpeedStartArrival", "True", false);
-                       else
-                               SqlitePreferences.Update("runSpeedStartArrival", "False", false);
-               }
-       }
-       private void on_radio_runs_i_speed_start_toggled (object o, EventArgs args) {
-               if(update_sqlite_at_runs_speed_radios) {
-                       if(radio_runs_i_speed_start_arrival.Active)
-                               SqlitePreferences.Update("runISpeedStartArrival", "True", false);
-                       else
-                               SqlitePreferences.Update("runISpeedStartArrival", "False", false);
-               }
-       }
 }
 
 
diff --git a/src/preferences.cs b/src/preferences.cs
index c8ce9b9..fc24c7e 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -38,6 +38,13 @@ public class Preferences
        public bool weightStatsPercent;         //AKA weightPercentPreferred
        public bool heightPreferred;
        public bool metersSecondsPreferred;
+       public bool runSpeedStartArrival;
+
+       public Constants.DoubleContact runDoubleContactsMode; //default LAST
+       public int runDoubleContactsMS; //milliseconds
+       public Constants.DoubleContact runIDoubleContactsMode; //default AVERAGE
+       public int runIDoubleContactsMS; //milliseconds
+       
        public bool encoderPropulsive;
        public double encoderSmoothCon;
        public int videoDeviceNum;              //AKA videoDevice
@@ -56,8 +63,6 @@ public class Preferences
        public bool videoOn;
        public int evaluatorServerID;
        public string versionAvailable;
-       public bool runSpeedStartArrival;
-       public bool runISpeedStartArrival;
        public string machineID;
        public Constants.MultimediaStorage multimediaStorage;
        public string databaseVersion;
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 7a70ff9..85a87a3 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -65,6 +65,7 @@ class Sqlite
 
        //for db conversion
        static string currentVersion = "0";
+       
        static int conversionRate;
        static int conversionRateTotal;
        protected static int conversionSubRate;
@@ -73,7 +74,7 @@ class Sqlite
        /*
         * Important, change this if there's any update to database
         */
-       static string lastChronojumpDatabaseVersion = "1.23";
+       static string lastChronojumpDatabaseVersion = "1.24";
 
        public Sqlite() {
        }
@@ -1793,7 +1794,43 @@ class Sqlite
 
                                currentVersion = "1.23";
                        }
+
+                       // ----------------------------------------------
+                       // IMPORTANT HERE IS DEFINED sqliteOpened == true
+                       // this is useful to not do more than 50 SQL open close
+                       // that crashes mac (Linux 100)
+                       // ----------------------------------------------
+                       LogB.SQL("Leaving Sqlite opened before DB updates");
+                       bool sqliteOpened = true;
+                       string newVersion = "";
        
+                       Sqlite.Open(); //------------------------------------------------
+
+
+                       if(currentVersion == "1.23") {
+                               LogB.SQL("Delete runISpeedStartArrival and add 4 double contacts configs");
+
+                               DeleteFromName(true, Constants.PreferencesTable, "runISpeedStartArrival");
+                               SqlitePreferences.Insert ("runDoubleContactsMode", 
Constants.DoubleContact.LAST.ToString()); 
+                               SqlitePreferences.Insert ("runDoubleContactsMS", "1000");
+                               SqlitePreferences.Insert ("runIDoubleContactsMode", 
Constants.DoubleContact.AVERAGE.ToString()); 
+                               SqlitePreferences.Insert ("runIDoubleContactsMS", "1000");
+
+                               newVersion = "1.24";
+                               SqlitePreferences.Update ("databaseVersion", newVersion, true); 
+                               currentVersion = newVersion;
+                       }
+
+                       // --- add more updates here
+               
+
+                       
+                       // --- end of update, close DB
+
+                       LogB.SQL("Closing Sqlite after DB updates");
+                       sqliteOpened = false;
+
+                       Sqlite.Close(); //------------------------------------------------
                }
 
                //if changes are made here, remember to change also in CreateTables()
@@ -1937,6 +1974,7 @@ class Sqlite
                SqliteExecuteAuto.addChronojumpProfileAndBilateral();
                
                //changes [from - to - desc]
+               //1.23 - 1.24 Converted DB to 1.24 Delete runISpeedStartArrival and add 4 double contacts 
configs
                //1.22 - 1.23 Converted DB to 1.23 Added encoder configuration
                //1.21 - 1.22 Converted DB to 1.22 Encoder laterality in english again
                //1.20 - 1.21 Converted DB to 1.21 Fixing loosing of encoder videoURL after recalculate
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index f29285d..95a9b4b 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -69,7 +69,13 @@ class SqlitePreferences : Sqlite
                                Insert ("evaluatorServerID", "-1", dbcmdTr);
                                Insert ("versionAvailable", "", dbcmdTr);
                                Insert ("runSpeedStartArrival", "True", dbcmdTr);
-                               Insert ("runISpeedStartArrival", "True", dbcmdTr);
+
+                               Insert ("runDoubleContactsMode", 
+                                               Constants.DoubleContact.LAST.ToString(), dbcmdTr); 
+                               Insert ("runDoubleContactsMS", "1000", dbcmdTr);
+                               Insert ("runIDoubleContactsMode", 
+                                               Constants.DoubleContact.AVERAGE.ToString(), dbcmdTr); 
+                               Insert ("runIDoubleContactsMS", "1000", dbcmdTr);
 
                                Random rnd = new Random();
                                string machineID = rnd.Next().ToString();
@@ -175,6 +181,9 @@ class SqlitePreferences : Sqlite
                Preferences preferences = new Preferences();
 
                while(reader.Read()) {
+                       //LogB.Debug("Reading preferences");
+                       //LogB.Information(reader[0].ToString() + ":" + reader[1].ToString());
+
                        //these are sent to preferences window
                        if(reader[0].ToString() == "digitsNumber")
                                preferences.digitsNumber = Convert.ToInt32(reader[1].ToString());
@@ -230,8 +239,18 @@ class SqlitePreferences : Sqlite
                                preferences.versionAvailable = reader[1].ToString();
                        else if(reader[0].ToString() == "runSpeedStartArrival")
                                preferences.runSpeedStartArrival = reader[1].ToString() == "True";
-                       else if(reader[0].ToString() == "runISpeedStartArrival")
-                               preferences.runISpeedStartArrival = reader[1].ToString() == "True";
+                       
+                       else if(reader[0].ToString() == "runDoubleContactsMode")
+                               preferences.runDoubleContactsMode = (Constants.DoubleContact) 
+                                       Enum.Parse(typeof(Constants.DoubleContact), reader[1].ToString()); 
+                       else if(reader[0].ToString() == "runDoubleContactsMS")
+                               preferences.runDoubleContactsMS = Convert.ToInt32(reader[1].ToString());
+                       else if(reader[0].ToString() == "runIDoubleContactsMode")
+                               preferences.runIDoubleContactsMode = (Constants.DoubleContact) 
+                                       Enum.Parse(typeof(Constants.DoubleContact), reader[1].ToString()); 
+                       else if(reader[0].ToString() == "runIDoubleContactsMS")
+                               preferences.runIDoubleContactsMS = Convert.ToInt32(reader[1].ToString());
+
                        else if(reader[0].ToString() == "machineID")
                                preferences.machineID = reader[1].ToString();
                        else if(reader[0].ToString() == "multimediaStorage")


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