[chronojump] Implemented button close_and_analyze with correct sensitivity on encoder analyze



commit af9a99033abc960652d865d93528151417649994
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Jan 28 18:17:55 2022 +0100

    Implemented button close_and_analyze with correct sensitivity on encoder analyze

 glade/app1.glade           | 81 ++++++++++++++++++++++++++++++++++++++++++----
 src/gui/app1/chronojump.cs |  1 +
 src/gui/app1/encoder.cs    | 14 ++++++++
 src/gui/app1/icons.cs      |  3 +-
 4 files changed, 92 insertions(+), 7 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index a18c47625..e20f232ce 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -24842,6 +24842,12 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -36993,14 +36999,19 @@ then click this button.</property>
                                                       </widget>
                                                     </child>
                                                     <child>
-                                                      <widget class="GtkButton" 
id="button_encoder_analyze_mode_options_close">
+                                                      <widget class="GtkHBox" id="hbox31">
                                                         <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="receives_default">True</property>
-                                                        <signal name="clicked" 
handler="on_button_encoder_analyze_mode_options_close_clicked" swapped="no"/>
-                                                        <accelerator key="Escape" signal="clicked"/>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="spacing">25</property>
                                                         <child>
-                                                          <widget class="GtkHBox" id="hbox258">
+                                                          <widget class="GtkButton" 
id="button_encoder_analyze_mode_options_close">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_encoder_analyze_mode_options_close_clicked" swapped="no"/>
+                                                            <accelerator key="Escape" signal="clicked"/>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox258">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
@@ -37028,7 +37039,59 @@ then click this button.</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
+                                                            </widget>
+                                                            </child>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkButton" 
id="button_encoder_analyze_mode_options_close_and_analyze">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_encoder_analyze_mode_options_close_and_analyze_clicked" swapped="no"/>
+                                                            <accelerator key="Escape" signal="clicked"/>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox61">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_encoder_analyze_mode_options_close_and_analyze">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property 
name="stock">gtk-missing-image</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="label288">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" translatable="yes">Close 
and analyze</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">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                          </packing>
                                                         </child>
                                                       </widget>
                                                       <packing>
@@ -40622,6 +40685,12 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index fcb04bc07..b2db7aca8 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -378,6 +378,7 @@ public partial class ChronoJumpWindow
        //encoder
        //[Widget] Gtk.Image image_encoder_analyze_zoom;
        [Widget] Gtk.Image image_encoder_analyze_stats;
+       [Widget] Gtk.Image image_encoder_analyze_mode_options_close_and_analyze;
        [Widget] Gtk.Image image_encoder_analyze_image_save;
        [Widget] Gtk.Image image_encoder_analyze_1RM_save;
        [Widget] Gtk.Image image_encoder_analyze_table_save;
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index b6e98f0a0..6c4305d4d 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -205,6 +205,7 @@ public partial class ChronoJumpWindow
        
        [Widget] Gtk.CheckButton checkbutton_crossvalidate;
        [Widget] Gtk.Button button_encoder_analyze;
+       [Widget] Gtk.Button button_encoder_analyze_mode_options_close_and_analyze;
        [Widget] Gtk.Box hbox_encoder_analyze_progress;
        [Widget] Gtk.Button button_encoder_analyze_cancel;
        [Widget] Gtk.Button button_encoder_analyze_data_select_curves;
@@ -4189,6 +4190,18 @@ public partial class ChronoJumpWindow
        {
                encoderAnalyzeOptionsSensitivity(true);
        }
+       private void on_button_encoder_analyze_mode_options_close_and_analyze_clicked (object o, EventArgs 
args)
+       {
+               encoderAnalyzeOptionsSensitivity(true);
+
+               //timeout to let the software resize the window and graph in the correct size
+               GLib.Timeout.Add(500, new GLib.TimeoutHandler(call_button_encoder_analyze));
+       }
+       private bool call_button_encoder_analyze()
+       {
+               on_button_encoder_analyze_clicked (new object (), new EventArgs ());
+               return false;
+       }
 
        private void encoderAnalyzeOptionsSensitivity(bool s) //s for sensitive. When show options frame is ! 
s
        {
@@ -5755,6 +5768,7 @@ public partial class ChronoJumpWindow
                                analyze_sensitive = false;
                }
                button_encoder_analyze.Sensitive = analyze_sensitive;
+               button_encoder_analyze_mode_options_close_and_analyze.Sensitive = analyze_sensitive;
        }
 
        /*
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index 7f2d37d4b..33e4b3dff 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.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) 2017-2021   Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2017-2022   Xavier de Blas <xaviblas gmail com>
  */
 
 
@@ -834,6 +834,7 @@ public partial class ChronoJumpWindow
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_analyze.png");
                image_button_contacts_capture_save_image_chart.Pixbuf = pixbuf;
                image_encoder_analyze_stats.Pixbuf = pixbuf;
+               image_encoder_analyze_mode_options_close_and_analyze.Pixbuf = pixbuf;
                image_encoder_capture_image_save.Pixbuf = pixbuf;
                image_encoder_analyze_image_save.Pixbuf = pixbuf;
                image_forcesensor_analyze_save_signal.Pixbuf = pixbuf;


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