[chronojump] button_encoder_capture_curves_save changes on saved and combo/spin use



commit 17ad978b15b82866ebfedb7f4997356aa0b2a229
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Oct 29 15:57:21 2019 +0100

    button_encoder_capture_curves_save changes on saved and combo/spin use

 glade/app1.glade   | 35 +++++++++++++++++++++--------------
 src/gui/encoder.cs | 26 ++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 14 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 62cc4f14..a94d8583 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -22153,6 +22153,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -24101,6 +24104,18 @@ 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>
@@ -24137,18 +24152,6 @@ 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>
@@ -24386,6 +24389,7 @@ Concentric</property>
                                                             <property name="adjustment">3 2 10 1 10 
0</property>
                                                             <property name="climb_rate">1</property>
                                                             <property name="numeric">True</property>
+                                                            <signal name="value_changed" 
handler="on_spin_encoder_capture_curves_best_n_value_changed" swapped="no"/>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -24417,7 +24421,7 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkLabel" id="label254">
+                                                            <widget class="GtkLabel" 
id="label_encoder_capture_curves_save">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="label" translatable="yes">Save 
repetitions</property>
@@ -25422,7 +25426,7 @@ Concentric</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">0 0 50 1 1 
0</property>
+                                                            <property name="adjustment">2 0 50 1 1 
0</property>
                                                             <property name="climb_rate">1</property>
                                                             <property name="snap_to_ticks">True</property>
                                                             <property name="numeric">True</property>
@@ -31140,6 +31144,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 1bcef822..67e3bf2b 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -136,7 +136,9 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Button button_encoder_capture_curves_4top;
        */
        [Widget] Gtk.HBox hbox_encoder_capture_curves_save;
+       [Widget] Gtk.Label label_encoder_capture_curves_save;
        [Widget] Gtk.ComboBox combo_encoder_capture_curves_save;
+       [Widget] Gtk.Button button_encoder_capture_curves_save;
 
        [Widget] Gtk.Notebook notebook_analyze_results;
        [Widget] Gtk.Box hbox_combo_encoder_exercise_analyze;
@@ -4207,6 +4209,23 @@ public partial class ChronoJumpWindow
        void on_combo_encoder_capture_curves_save_changed (object o, EventArgs args)
        {
                manageVisibilityOf_spin_encoder_capture_curves_best_n ();
+               manageButton_button_encoder_capture_curves_save (false);
+       }
+
+       void on_spin_encoder_capture_curves_best_n_value_changed (object o, EventArgs args)
+       {
+               manageButton_button_encoder_capture_curves_save (false);
+       }
+
+       void manageButton_button_encoder_capture_curves_save (bool saved)
+       {
+               if(saved) {
+                       label_encoder_capture_curves_save.Text = Catalog.GetString("Done");
+                       button_encoder_capture_curves_save.Sensitive = false;
+               } else {
+                       label_encoder_capture_curves_save.Text = Catalog.GetString("Save repetitions");
+                       button_encoder_capture_curves_save.Sensitive = true;
+               }
        }
 
        void manageVisibilityOf_spin_encoder_capture_curves_best_n ()
@@ -4236,6 +4255,9 @@ public partial class ChronoJumpWindow
 
                //4) save or unsave curves
                encoderCaptureSaveCurvesAllNoneBest(easc, 
Constants.GetEncoderVariablesCapture(preferences.encoderCaptureMainVariable));
+
+               //5) change save buttons
+               manageButton_button_encoder_capture_curves_save (true);
        }
 
        // ---- end of combo_encoder_capture_curves_save stuff ----
@@ -6529,9 +6551,13 @@ public partial class ChronoJumpWindow
                                        encoder_pulsebar_capture.Text = encoderSaveSignalOrCurve(false, 
"signal", 0); //this updates encoderSignalUniqueID
 
                                        if(needToAutoSaveCurve)
+                                       {
                                                
encoderCaptureSaveCurvesAllNoneBest(preferences.encoderAutoSaveCurve,
                                                                
Constants.GetEncoderVariablesCapture(preferences.encoderCaptureMainVariable));
 
+                                               manageButton_button_encoder_capture_curves_save (true);
+                                       }
+
                                        if(action == encoderActions.CURVES_AC)
                                        {
                                                //1) unMute logs if preferences.muteLogs == false


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