[chronojump] Removed encoder min height widgets from preferences window



commit 630accc4e9b11cca1f86358638ffa27de146f5f7
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Mar 3 12:43:57 2022 +0100

    Removed encoder min height widgets from preferences window

 glade/preferences_win.glade | 364 ++++++++------------------------------------
 src/gui/preferences.cs      |  26 +---
 2 files changed, 67 insertions(+), 323 deletions(-)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index 9ca4c3fa5..af5f03575 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -1968,7 +1968,7 @@ It starts before and arrives there with some speed.</property>
                                   <widget class="GtkTable" id="table7">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="n_rows">2</property>
+                                    <property name="n_rows">3</property>
                                     <property name="n_columns">2</property>
                                     <property name="column_spacing">16</property>
                                     <property name="row_spacing">10</property>
@@ -2118,98 +2118,24 @@ It starts before and arrives there with some speed.</property>
                                       <packing>
                                         <property name="top_attach">1</property>
                                         <property name="bottom_attach">2</property>
-                                        <property name="x_options"/>
+                                        <property name="x_options">GTK_FILL</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="GtkNotebook" id="notebook_encoder_capture_gi">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
                                     <child>
-                                      <widget class="GtkAlignment" id="alignment1">
+                                      <widget class="GtkVBox" id="vbox34">
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
-                                        <property name="border_width">8</property>
-                                        <property name="left_padding">12</property>
+                                        <property name="spacing">4</property>
                                         <child>
-                                          <widget class="GtkVBox" id="vbox34">
+                                          <widget class="GtkHBox" id="hbox38">
                                             <property name="visible">True</property>
                                             <property name="can_focus">False</property>
+                                            <property name="spacing">4</property>
                                             <child>
-                                              <widget class="GtkHBox" id="hbox24">
+                                              <widget class="GtkImage" id="image_encoder_inertial">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">False</property>
-                                                <property name="spacing">20</property>
-                                                <child>
-                                                  <widget class="GtkLabel" id="label67">
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">False</property>
-                                                    <property name="xalign">0</property>
-                                                    <property name="label" translatable="yes">Minimal range 
of movement</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="expand">False</property>
-                                                    <property name="fill">False</property>
-                                                    <property name="position">0</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkHBox" id="hbox_height_gravitatory">
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">False</property>
-                                                    <property name="spacing">4</property>
-                                                    <child>
-                                                      <widget class="GtkSpinButton" 
id="spin_encoder_capture_min_height_gravitatory">
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="has_tooltip">True</property>
-                                                        <property name="tooltip" translatable="yes">Minimal 
height</property>
-                                                        <property name="invisible_char">●</property>
-                                                        <property name="width_chars">3</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">20 1 300 1 10 
0</property>
-                                                        <property name="climb_rate">1</property>
-                                                        <property name="snap_to_ticks">True</property>
-                                                        <property name="numeric">True</property>
-                                                      </widget>
-                                                      <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">False</property>
-                                                        <property name="position">0</property>
-                                                      </packing>
-                                                    </child>
-                                                    <child>
-                                                      <widget class="GtkLabel" id="label81">
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">False</property>
-                                                        <property name="xalign">1</property>
-                                                        <property name="label" 
translatable="yes">cm</property>
-                                                        <property name="use_markup">True</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>
+                                                <property name="stock">gtk-missing-image</property>
                                               </widget>
                                               <packing>
                                                 <property name="expand">False</property>
@@ -2217,235 +2143,76 @@ It starts before and arrives there with some speed.</property>
                                                 <property name="position">0</property>
                                               </packing>
                                             </child>
-                                          </widget>
-                                        </child>
-                                      </widget>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkHBox" id="hbox37">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="spacing">10</property>
-                                        <child>
-                                          <widget class="GtkImage" id="image_encoder_gravitatory">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="stock">gtk-missing-image</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">False</property>
-                                            <property name="fill">False</property>
-                                            <property name="position">0</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkLabel" id="label109">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="label" translatable="yes">Gravitatory</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">1</property>
-                                          </packing>
-                                        </child>
-                                      </widget>
-                                      <packing>
-                                        <property name="tab_fill">False</property>
-                                        <property name="type">tab</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkAlignment" 
id="alignment_encoder_gravitatory_inertial">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="border_width">8</property>
-                                        <property name="left_padding">12</property>
-                                        <child>
-                                          <widget class="GtkHBox" id="hbox10">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="spacing">16</property>
                                             <child>
-                                              <widget class="GtkHBox" id="hbox23">
+                                              <widget class="GtkLabel" id="label110">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">False</property>
-                                                <property name="spacing">16</property>
-                                                <child>
-                                                  <widget class="GtkLabel" id="label64">
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">False</property>
-                                                    <property name="xalign">0</property>
-                                                    <property name="label" translatable="yes">Minimal 
length</property>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="expand">False</property>
-                                                    <property name="fill">False</property>
-                                                    <property name="position">0</property>
-                                                  </packing>
-                                                </child>
-                                                <child>
-                                                  <widget class="GtkHBox" id="hbox_height_inertial">
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">False</property>
-                                                    <property name="spacing">4</property>
-                                                    <child>
-                                                      <widget class="GtkSpinButton" 
id="spin_encoder_capture_min_height_inertial">
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="has_tooltip">True</property>
-                                                        <property name="tooltip" translatable="yes">Minimal 
height</property>
-                                                        <property name="invisible_char">●</property>
-                                                        <property name="width_chars">3</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">5 1 300 1 10 0</property>
-                                                        <property name="climb_rate">1</property>
-                                                        <property name="snap_to_ticks">True</property>
-                                                        <property name="numeric">True</property>
-                                                      </widget>
-                                                      <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">False</property>
-                                                        <property name="position">0</property>
-                                                      </packing>
-                                                    </child>
-                                                    <child>
-                                                      <widget class="GtkLabel" id="label65">
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">False</property>
-                                                        <property name="xalign">1</property>
-                                                        <property name="label" 
translatable="yes">cm</property>
-                                                        <property name="use_markup">True</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>
+                                                <property name="label" translatable="yes">Inertial</property>
                                               </widget>
                                               <packing>
                                                 <property name="expand">False</property>
                                                 <property name="fill">False</property>
-                                                <property name="position">0</property>
-                                              </packing>
-                                            </child>
-                                            <child>
-                                              <widget class="GtkVSeparator" id="vseparator1">
-                                                <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">1</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="GtkAlignment" 
id="alignment_encoder_gravitatory_inertial">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="left_padding">20</property>
                                             <child>
-                                              <widget class="GtkHBox" id="hbox11">
+                                              <widget class="GtkCheckButton" 
id="checkbutton_encoder_capture_inertial_discard_first_n">
+                                                <property name="label" translatable="yes">Discard first 
repetitions</property>
                                                 <property name="visible">True</property>
-                                                <property name="can_focus">False</property>
-                                                <property name="spacing">12</property>
-                                                <child>
-                                                  <widget class="GtkCheckButton" 
id="checkbutton_encoder_capture_inertial_discard_first_n">
-                                                    <property name="label" translatable="yes">Discard first 
repetitions</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_encoder_capture_inertial_discard_first_n_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="GtkHBox" 
id="hbox_encoder_capture_inertial_discard_first_n">
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">False</property>
-                                                    <property name="spacing">8</property>
-                                                    <child>
-                                                      <widget class="GtkSpinButton" 
id="spin_encoder_capture_inertial_discard_first_n">
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="has_tooltip">True</property>
-                                                        <property name="tooltip" translatable="yes">Minimal 
height</property>
-                                                        <property name="invisible_char">●</property>
-                                                        <property name="width_chars">1</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">3 1 9 1 10 0</property>
-                                                        <property name="climb_rate">1</property>
-                                                        <property name="snap_to_ticks">True</property>
-                                                        <property name="numeric">True</property>
-                                                      </widget>
-                                                      <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">False</property>
-                                                        <property name="position">0</property>
-                                                      </packing>
-                                                    </child>
-                                                    <child>
-                                                      <widget class="GtkLabel" id="label79">
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">False</property>
-                                                        <property name="label" 
translatable="yes">Recommended: 3</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>
+                                                <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_encoder_capture_inertial_discard_first_n_toggled" swapped="no"/>
                                               </widget>
-                                              <packing>
-                                                <property name="expand">False</property>
-                                                <property name="fill">False</property>
-                                                <property name="position">2</property>
-                                              </packing>
                                             </child>
                                           </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
                                         </child>
                                       </widget>
                                       <packing>
-                                        <property name="position">1</property>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
                                       </packing>
                                     </child>
                                     <child>
-                                      <widget class="GtkHBox" id="hbox38">
+                                      <widget class="GtkHBox" 
id="hbox_encoder_capture_inertial_discard_first_n">
                                         <property name="visible">True</property>
                                         <property name="can_focus">False</property>
-                                        <property name="spacing">10</property>
+                                        <property name="spacing">8</property>
                                         <child>
-                                          <widget class="GtkImage" id="image_encoder_inertial">
+                                          <widget class="GtkSpinButton" 
id="spin_encoder_capture_inertial_discard_first_n">
                                             <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="stock">gtk-missing-image</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="has_tooltip">True</property>
+                                            <property name="tooltip" translatable="yes">Minimal 
height</property>
+                                            <property name="invisible_char">●</property>
+                                            <property name="width_chars">1</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">3 1 9 1 10 0</property>
+                                            <property name="climb_rate">1</property>
+                                            <property name="snap_to_ticks">True</property>
+                                            <property name="numeric">True</property>
                                           </widget>
                                           <packing>
                                             <property name="expand">False</property>
@@ -2454,29 +2221,30 @@ It starts before and arrives there with some speed.</property>
                                           </packing>
                                         </child>
                                         <child>
-                                          <widget class="GtkLabel" id="label110">
+                                          <widget class="GtkLabel" id="label79">
                                             <property name="visible">True</property>
                                             <property name="can_focus">False</property>
-                                            <property name="label" translatable="yes">Inertial</property>
+                                            <property name="label" translatable="yes">Recommended: 
3</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">1</property>
                                           </packing>
                                         </child>
                                       </widget>
                                       <packing>
-                                        <property name="position">1</property>
-                                        <property name="tab_fill">False</property>
-                                        <property name="type">tab</property>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
                                       </packing>
                                     </child>
                                   </widget>
                                   <packing>
                                     <property name="expand">False</property>
                                     <property name="fill">False</property>
-                                    <property name="position">1</property>
+                                    <property name="position">0</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -2688,7 +2456,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">2</property>
+                                    <property name="position">1</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -2702,7 +2470,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>
                                 <child>
@@ -2949,7 +2717,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">4</property>
+                                    <property name="position">3</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -3034,7 +2802,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">5</property>
+                                    <property name="position">4</property>
                                   </packing>
                                 </child>
                               </widget>
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index e33d629ee..5ca5e1287 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -15,7 +15,7 @@
  *  along with this program; if not, write to the Free Software
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * Copyright (C) 2004-2021   Xavier de Blas <xaviblas gmail com> 
+ * Copyright (C) 2004-2022   Xavier de Blas <xaviblas gmail com>
  */
 
 using System;
@@ -135,12 +135,8 @@ public class PreferencesWindow
        [Widget] Gtk.CheckButton check_encoder_capture_inactivity_end_time;
        [Widget] Gtk.HBox hbox_encoder_capture_inactivity_time;
        [Widget] Gtk.SpinButton spin_encoder_capture_inactivity_end_time;
-       [Widget] Gtk.Image image_encoder_gravitatory;
        [Widget] Gtk.Image image_encoder_inertial;
        [Widget] Gtk.Image image_encoder_triggers;
-       [Widget] Gtk.Notebook notebook_encoder_capture_gi;
-       [Widget] Gtk.SpinButton spin_encoder_capture_min_height_gravitatory;
-       [Widget] Gtk.SpinButton spin_encoder_capture_min_height_inertial;
        [Widget] Gtk.CheckButton checkbutton_encoder_capture_inertial_discard_first_n;
        [Widget] Gtk.HBox hbox_encoder_capture_inertial_discard_first_n;
        [Widget] Gtk.SpinButton spin_encoder_capture_inertial_discard_first_n;
@@ -627,21 +623,11 @@ public class PreferencesWindow
                }
 
 
-               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_weight.png");
-               PreferencesWindowBox.image_encoder_gravitatory.Pixbuf = pixbuf;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_inertia.png");
                PreferencesWindowBox.image_encoder_inertial.Pixbuf = pixbuf;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_encoder_triggers_no.png");
                PreferencesWindowBox.image_encoder_triggers.Pixbuf = pixbuf;
 
-               if(menu_mode == Constants.Modes.POWERGRAVITATORY)
-                       PreferencesWindowBox.notebook_encoder_capture_gi.CurrentPage = 0;
-               else if(menu_mode == Constants.Modes.POWERINERTIAL)
-                       PreferencesWindowBox.notebook_encoder_capture_gi.CurrentPage = 1;
-
-               PreferencesWindowBox.spin_encoder_capture_min_height_gravitatory.Value = 
preferences.encoderCaptureMinHeightGravitatory;
-               PreferencesWindowBox.spin_encoder_capture_min_height_inertial.Value = 
preferences.encoderCaptureMinHeightInertial;
-
                if(preferences.encoderCaptureInertialDiscardFirstN > 0) {
                        PreferencesWindowBox.checkbutton_encoder_capture_inertial_discard_first_n.Active = 
true;
                        PreferencesWindowBox.spin_encoder_capture_inertial_discard_first_n.Value = 
preferences.encoderCaptureInertialDiscardFirstN;
@@ -2032,16 +2018,6 @@ public class PreferencesWindow
                                        (int) 
PreferencesWindowBox.spin_encoder_capture_inactivity_end_time.Value);
                }
 
-               preferences.encoderCaptureMinHeightGravitatory = Preferences.PreferencesChange(
-                               "encoderCaptureMinHeightGravitatory",
-                               preferences.encoderCaptureMinHeightGravitatory,
-                               (int) PreferencesWindowBox.spin_encoder_capture_min_height_gravitatory.Value);
-       
-               preferences.encoderCaptureMinHeightInertial = Preferences.PreferencesChange(
-                               "encoderCaptureMinHeightInertial",
-                               preferences.encoderCaptureMinHeightInertial,
-                               (int) PreferencesWindowBox.spin_encoder_capture_min_height_inertial.Value);
-
                int spinEncoderCaptureDiscardFirstN = 
Convert.ToInt32(PreferencesWindowBox.spin_encoder_capture_inertial_discard_first_n.Value);
                if(! checkbutton_encoder_capture_inertial_discard_first_n.Active)
                        spinEncoderCaptureDiscardFirstN = 0;


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