[chronojump] jumps/jumpsRj power/stiffness help buttons moved to preferences



commit bf1529b7be21e26e7b8100f2998e6540599e4498
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Aug 4 10:53:57 2021 +0200

    jumps/jumpsRj power/stiffness help buttons moved to preferences

 glade/app1.glade            | 232 ++++----------------------------------------
 glade/preferences_win.glade | 114 +++++++++++++++++-----
 src/gui/app1/chronojump.cs  |  27 ------
 src/gui/preferences.cs      |  18 ++++
 4 files changed, 126 insertions(+), 265 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 688fd8872..88705abc7 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -9997,107 +9997,6 @@ EncoderInertialCapture</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
-                                                            <child>
-                                                            <widget class="GtkHBox" id="hbox139">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkButton" 
id="button_jumps_result_help_power">
-                                                            <property name="can_focus">True</property>
-                                                            <property name="receives_default">True</property>
-                                                            <signal name="clicked" 
handler="on_button_jumps_jumpsRj_result_help_power_clicked" swapped="no"/>
-                                                            <child>
-                                                            <widget class="GtkHBox" id="hbox140">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">2</property>
-                                                            <child>
-                                                            <widget class="GtkImage" id="image42">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="stock">gtk-info</property>
-                                                            <property name="icon-size">2</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label119">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" 
translatable="yes">Power</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkButton" 
id="button_jumps_result_help_stiffness">
-                                                            <property name="can_focus">True</property>
-                                                            <property name="receives_default">True</property>
-                                                            <signal name="clicked" 
handler="on_button_jumps_jumpsRj_result_help_stiffness_clicked" swapped="no"/>
-                                                            <child>
-                                                            <widget class="GtkHBox" id="hbox141">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">2</property>
-                                                            <child>
-                                                            <widget class="GtkImage" id="image43">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="stock">gtk-info</property>
-                                                            <property name="icon-size">2</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label120">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" 
translatable="yes">Stiffness</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
-                                                            </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="pack_type">end</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -10331,107 +10230,6 @@ EncoderInertialCapture</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
-                                                            <child>
-                                                            <widget class="GtkHBox" id="hbox142">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkButton" 
id="button_jumps_rj_result_help_power">
-                                                            <property name="can_focus">True</property>
-                                                            <property name="receives_default">True</property>
-                                                            <signal name="clicked" 
handler="on_button_jumps_jumpsRj_result_help_power_clicked" swapped="no"/>
-                                                            <child>
-                                                            <widget class="GtkHBox" id="hbox143">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">2</property>
-                                                            <child>
-                                                            <widget class="GtkImage" id="image53">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="stock">gtk-info</property>
-                                                            <property name="icon-size">2</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label121">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" 
translatable="yes">Power</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkButton" 
id="button_jumps_rj_result_help_stiffness">
-                                                            <property name="can_focus">True</property>
-                                                            <property name="receives_default">True</property>
-                                                            <signal name="clicked" 
handler="on_button_jumps_jumpsRj_result_help_stiffness_clicked" swapped="no"/>
-                                                            <child>
-                                                            <widget class="GtkHBox" id="hbox145">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">2</property>
-                                                            <child>
-                                                            <widget class="GtkImage" id="image54">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="stock">gtk-info</property>
-                                                            <property name="icon-size">2</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label122">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" 
translatable="yes">Stiffness</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                            </widget>
-                                                            </child>
-                                                            </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="pack_type">end</property>
-                                                            <property name="position">2</property>
-                                                            </packing>
-                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -25988,6 +25786,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -32299,18 +32100,6 @@ Concentric</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
-                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="pack_type">end</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_capturing">
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
@@ -32347,6 +32136,18 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
+                                                            <widget class="GtkLabel" 
id="label_video_encoder_tests_will_be_filmed">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">Tests 
will be filmed</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkHBox" 
id="hbox_video_encoder_no_capturing">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -41609,6 +41410,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index 0c32a36b0..0c4775213 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -807,30 +807,6 @@
                                                     <property name="n_columns">3</property>
                                                     <property name="column_spacing">12</property>
                                                     <property name="row_spacing">8</property>
-                                                    <child>
-                                                      <widget class="GtkCheckButton" id="checkbutton_power">
-                                                        <property name="label" 
translatable="yes">Power</property>
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="receives_default">False</property>
-                                                        <property name="use_underline">True</property>
-                                                        <property name="draw_indicator">True</property>
-                                                      </widget>
-                                                    </child>
-                                                    <child>
-                                                      <widget class="GtkCheckButton" 
id="checkbutton_stiffness">
-                                                        <property name="label" 
translatable="yes">Stiffness</property>
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="receives_default">False</property>
-                                                        <property name="use_underline">True</property>
-                                                        <property name="draw_indicator">True</property>
-                                                      </widget>
-                                                      <packing>
-                                                        <property name="left_attach">1</property>
-                                                        <property name="right_attach">2</property>
-                                                      </packing>
-                                                    </child>
                                                     <child>
                                                       <widget class="GtkCheckButton" 
id="checkbutton_show_tv_tc_index">
                                                         <property name="label" translatable="yes">Indexes 
between TF and TC</property>
@@ -907,6 +883,49 @@
                                                         <property name="bottom_attach">2</property>
                                                       </packing>
                                                     </child>
+                                                    <child>
+                                                      <widget class="GtkHBox" id="hbox57">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="spacing">6</property>
+                                                        <child>
+                                                          <widget class="GtkCheckButton" 
id="checkbutton_power">
+                                                            <property name="label" 
translatable="yes">Power</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="use_underline">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkButton" 
id="button_jumps_power_help">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_jumps_power_help_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_jumps_power_help">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-info</property>
+                                                            <property name="icon-size">2</property>
+                                                            </widget>
+                                                            </child>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                          </packing>
+                                                        </child>
+                                                      </widget>
+                                                    </child>
                                                     <child>
                                                       <widget class="GtkCheckButton" 
id="checkbutton_initial_speed">
                                                         <property name="label" translatable="yes">Initial 
speed</property>
@@ -916,6 +935,53 @@
                                                         <property name="use_underline">True</property>
                                                         <property name="draw_indicator">True</property>
                                                       </widget>
+                                                      <packing>
+                                                        <property name="left_attach">1</property>
+                                                        <property name="right_attach">2</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkHBox" id="hbox62">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="spacing">6</property>
+                                                        <child>
+                                                          <widget class="GtkCheckButton" 
id="checkbutton_stiffness">
+                                                            <property name="label" 
translatable="yes">Stiffness</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="use_underline">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkButton" 
id="button_jumps_stiffness_help">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_jumps_stiffness_help_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_jumps_stiffness_help">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-info</property>
+                                                            <property name="icon-size">2</property>
+                                                            </widget>
+                                                            </child>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                          </packing>
+                                                        </child>
+                                                      </widget>
                                                       <packing>
                                                         <property name="top_attach">1</property>
                                                         <property name="bottom_attach">2</property>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 58cc6f2ce..7014722ab 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -261,11 +261,6 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image extra_windows_jumps_image_dj_fall_predefined;
        [Widget] Gtk.HBox hbox_extra_window_jumps_fall_height;
 
-       [Widget] Gtk.Button button_jumps_result_help_power;
-       [Widget] Gtk.Button button_jumps_result_help_stiffness;
-       [Widget] Gtk.Button button_jumps_rj_result_help_power;
-       [Widget] Gtk.Button button_jumps_rj_result_help_stiffness;
-       
        //runs
        [Widget] Gtk.Button button_edit_selected_run;
        [Widget] Gtk.Button button_video_play_selected_run;
@@ -1495,10 +1490,6 @@ public partial class ChronoJumpWindow
 
                //the glade cursor_changed does not work on mono 1.2.5 windows
                tv.CursorChanged += on_treeview_jumps_cursor_changed; 
-       
-               //show or hide help_power and help_stiffness depending on preferences
-               button_jumps_result_help_power.Visible = preferences.showPower;
-               button_jumps_result_help_stiffness.Visible = preferences.showStiffness;
        }
 
        private void fillTreeView_jumps (string filter) {
@@ -1599,10 +1590,6 @@ public partial class ChronoJumpWindow
 
                //the glade cursor_changed does not work on mono 1.2.5 windows
                tv.CursorChanged += on_treeview_jumps_rj_cursor_changed; 
-       
-               //show or hide help_power and help_stiffness depending on preferences
-               button_jumps_rj_result_help_power.Visible = preferences.showPower;
-               button_jumps_rj_result_help_stiffness.Visible = preferences.showStiffness;
        }
 
        private void fillTreeView_jumps_rj (string filter) {
@@ -7153,20 +7140,6 @@ LogB.Debug("mc finished 5");
                LogB.Information("Repair selected multichronopic");
        }
 
-       /* ---------------------------------------------------------
-        * ----------------  Info on power and stiffness -----------
-        *  --------------------------------------------------------
-        */
-
-
-       private void on_button_jumps_jumpsRj_result_help_power_clicked (object o, EventArgs args) {
-               new DialogMessage(Constants.MessageTypes.INFO, Constants.HelpPowerStr());
-       }
-       private void on_button_jumps_jumpsRj_result_help_stiffness_clicked (object o, EventArgs args) {
-               new DialogMessage(Constants.MessageTypes.INFO, Constants.HelpStiffnessStr(), 
"hbox_stiffness_formula");
-       }
-
-       
        /* ---------------------------------------------------------
         * ----------------  AUTO MODE -----------------------------
         *  --------------------------------------------------------
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 858379dc6..49e54c3d2 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -93,6 +93,8 @@ public class PreferencesWindow
 //     [Widget] Gtk.Label label_jumps;
        [Widget] Gtk.CheckButton checkbutton_power;
        [Widget] Gtk.CheckButton checkbutton_stiffness;
+       [Widget] Gtk.Image image_jumps_power_help;
+       [Widget] Gtk.Image image_jumps_stiffness_help;
        [Widget] Gtk.CheckButton checkbutton_initial_speed;
        [Widget] Gtk.CheckButton checkbutton_angle;
        [Widget] Gtk.CheckButton checkbutton_show_tv_tc_index;
@@ -564,6 +566,8 @@ public class PreferencesWindow
                PreferencesWindowBox.image_races_intervallic.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_info.png");
+               PreferencesWindowBox.image_jumps_power_help.Pixbuf = pixbuf;
+               PreferencesWindowBox.image_jumps_stiffness_help.Pixbuf = pixbuf;
                PreferencesWindowBox.image_run_speed_start_help.Pixbuf = pixbuf;
                PreferencesWindowBox.image_encoder_inactivity_help.Pixbuf = pixbuf;
                PreferencesWindowBox.image_encoder_capture_cut_by_triggers_help.Pixbuf = pixbuf;
@@ -914,6 +918,20 @@ public class PreferencesWindow
                hbox_encoder_capture_inactivity_time.Sensitive = 
check_encoder_capture_inactivity_end_time.Active;
        }
 
+       /* ---------------------------------------------------------
+        * ----------------  Jumps. Info on power and stiffness -----------
+        *  --------------------------------------------------------
+        */
+
+       //both valid for jumps and jumps_rj
+       private void on_button_jumps_power_help_clicked (object o, EventArgs args) {
+               new DialogMessage(Constants.MessageTypes.INFO, Constants.HelpPowerStr());
+       }
+       private void on_button_jumps_stiffness_help_clicked (object o, EventArgs args) {
+               new DialogMessage(Constants.MessageTypes.INFO, Constants.HelpStiffnessStr(), 
"hbox_stiffness_formula");
+       }
+
+
        /*
         * triggers stuff
         */


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