[chronojump] run simple preferences only show BIGGEST_TC



commit a3b6a246666b5f1a30d321886b500f2c0aeb6806
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Apr 10 13:38:30 2018 +0200

    run simple preferences only show BIGGEST_TC

 glade/preferences_win.glade |  126 ++----------------------------------------
 src/gui/preferences.cs      |   32 ++---------
 2 files changed, 11 insertions(+), 147 deletions(-)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index aae3887..39e8bc4 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -1281,66 +1281,15 @@ It starts before and arrives there with some speed.</property>
                                               </packing>
                                             </child>
                                             <child>
-                                              <widget class="GtkAlignment" id="alignment29">
+                                              <widget class="GtkLabel" id="label58">
                                                 <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>
+                                                <property name="xalign">0</property>
+                                                <property name="label" translatable="yes">Each track ends 
before biggest contact time.</property>
                                               </widget>
                                               <packing>
-                                                <property name="expand">True</property>
-                                                <property name="fill">True</property>
+                                                <property name="expand">False</property>
+                                                <property name="fill">False</property>
                                                 <property name="position">2</property>
                                               </packing>
                                             </child>
@@ -1481,69 +1430,6 @@ It starts before and arrives there with some speed.</property>
                                               </packing>
                                             </child>
                                             <child>
-                                              <widget class="GtkAlignment" id="alignment15">
-                                                <property name="can_focus">False</property>
-                                                <property name="left_padding">12</property>
-                                                <child>
-                                                  <widget class="GtkVBox" id="vbox31">
-                                                    <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>
-                                            <child>
                                               <widget class="GtkLabel" id="label57">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">False</property>
@@ -1553,7 +1439,7 @@ It starts before and arrives there with some speed.</property>
                                               <packing>
                                                 <property name="expand">False</property>
                                                 <property name="fill">False</property>
-                                                <property name="position">3</property>
+                                                <property name="position">2</property>
                                               </packing>
                                             </child>
                                           </widget>
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 11f588f..1ea92a3 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -93,9 +93,6 @@ public class PreferencesWindow
        [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;
@@ -354,6 +351,7 @@ public class PreferencesWindow
 
 
                //start of double contacts stuff ----
+
                Pixbuf pixbuf;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_run_simple.png");
                PreferencesWindowBox.image_races_simple.Pixbuf = pixbuf;
@@ -379,15 +377,7 @@ public class PreferencesWindow
                        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;
-               }
+
                //---- end of double contacts stuff             
 
 
@@ -1228,21 +1218,9 @@ public class PreferencesWindow
                }
                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.runDoubleContactsMode != Constants.DoubleContact.BIGGEST_TC ) {
+                               SqlitePreferences.Update("runDoubleContactsMode", 
Constants.DoubleContact.BIGGEST_TC.ToString(), true);
+                               preferences.runDoubleContactsMode = Constants.DoubleContact.BIGGEST_TC;
                        }
 
                        if(preferences.runDoubleContactsMS != (int) 
PreferencesWindowBox.spinbutton_runs_prevent_double_contact.Value) {


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