[chronojump] Implemented JumpsRjFatigue save image button



commit b21346ac7079080b666d27be748253d4fff1e121
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Aug 18 12:33:03 2020 +0100

    Implemented JumpsRjFatigue save image button

 glade/app1.glade               | 31 +++++++++++++++++++------------
 po/POTFILES.in                 |  1 +
 src/constants.cs               |  1 +
 src/gui/app1/encoder.cs        |  7 +++++++
 src/gui/app1/jumpsRjFatigue.cs | 29 ++++++++++++++++++++++++++++-
 5 files changed, 56 insertions(+), 13 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 797b8634..8e5e6fd1 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -20544,6 +20544,7 @@ Concentric</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
                                                             <property name="tooltip" translatable="yes">Save 
image</property>
+                                                            <signal name="clicked" 
handler="on_button_jumps_rj_fatigue_save_image_clicked" swapped="no"/>
                                                             <child>
                                                             <widget class="GtkVBox" id="vbox236">
                                                             <property name="visible">True</property>
@@ -24868,6 +24869,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -27733,18 +27737,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>
@@ -27781,6 +27773,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>
@@ -35794,6 +35798,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 2b5d30a4..d8325ef1 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -66,6 +66,7 @@ src/gui/app1/jump.cs
 src/gui/app1/jumpsDjOptimalFall.cs
 src/gui/app1/jumpsEvolution.cs
 src/gui/app1/jumpsProfile.cs
+src/gui/app1/jumpsRjFatigue.cs
 src/gui/app1/jumpsWeightFVProfile.cs
 src/gui/app1/pulse.cs
 src/gui/app1/reactionTime.cs
diff --git a/src/constants.cs b/src/constants.cs
index fc5cc33c..c5f96f65 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -1101,6 +1101,7 @@ public class Constants
        public enum EncoderGI {ALL, GRAVITATORY, INERTIAL}
        public enum CheckFileOp {
                JUMPS_PROFILE_SAVE_IMAGE, JUMPS_DJ_OPTIMAL_FALL_SAVE_IMAGE, 
JUMPS_WEIGHT_FV_PROFILE_SAVE_IMAGE, JUMPS_EVOLUTION_SAVE_IMAGE,
+               JUMPS_RJ_FATIGUE_SAVE_IMAGE,
                RUNS_SPRINT_SAVE_IMAGE,
                ENCODER_CAPTURE_EXPORT_ALL, ENCODER_ANALYZE_SAVE_IMAGE,
                ENCODER_ANALYZE_SEND_IMAGE, //like save image but just defines the name exportFileName to be 
sended
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index 4a9e9caf..ad29e6c4 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -2074,6 +2074,7 @@ public partial class ChronoJumpWindow
                                checkFileOp == Constants.CheckFileOp.JUMPS_DJ_OPTIMAL_FALL_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.JUMPS_WEIGHT_FV_PROFILE_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.JUMPS_EVOLUTION_SAVE_IMAGE ||
+                               checkFileOp == Constants.CheckFileOp.JUMPS_RJ_FATIGUE_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.RUNS_SPRINT_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.FORCESENSOR_SAVE_IMAGE_SIGNAL ||
@@ -2130,6 +2131,7 @@ public partial class ChronoJumpWindow
                                checkFileOp == Constants.CheckFileOp.JUMPS_DJ_OPTIMAL_FALL_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.JUMPS_WEIGHT_FV_PROFILE_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.JUMPS_EVOLUTION_SAVE_IMAGE ||
+                               checkFileOp == Constants.CheckFileOp.JUMPS_RJ_FATIGUE_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.RUNS_SPRINT_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.FORCESENSOR_SAVE_IMAGE_SIGNAL ||
@@ -2189,6 +2191,9 @@ public partial class ChronoJumpWindow
                                        if(checkFileOp == Constants.CheckFileOp.JUMPS_EVOLUTION_SAVE_IMAGE)
                                                confirmWin.Button_accept.Clicked +=
                                                        new 
EventHandler(on_overwrite_file_jumps_evolution_save_image_accepted);
+                                       if(checkFileOp == Constants.CheckFileOp.JUMPS_RJ_FATIGUE_SAVE_IMAGE)
+                                               confirmWin.Button_accept.Clicked +=
+                                                       new 
EventHandler(on_overwrite_file_jumps_rj_fatigue_save_image_accepted);
                                        if(checkFileOp == Constants.CheckFileOp.RUNS_SPRINT_SAVE_IMAGE)
                                                confirmWin.Button_accept.Clicked +=
                                                        new 
EventHandler(on_overwrite_file_runs_sprint_save_image_accepted);
@@ -2229,6 +2234,8 @@ public partial class ChronoJumpWindow
                                                on_button_jumps_weight_fv_profile_save_image_selected 
(exportFileName);
                                        else if(checkFileOp == 
Constants.CheckFileOp.JUMPS_EVOLUTION_SAVE_IMAGE)
                                                on_button_jumps_evolution_save_image_selected 
(exportFileName);
+                                       else if(checkFileOp == 
Constants.CheckFileOp.JUMPS_RJ_FATIGUE_SAVE_IMAGE)
+                                               on_button_jumps_rj_fatigue_save_image_selected 
(exportFileName);
                                        else if(checkFileOp == Constants.CheckFileOp.RUNS_SPRINT_SAVE_IMAGE)
                                                on_button_runs_sprint_save_image_selected (exportFileName);
                                        else if(checkFileOp == 
Constants.CheckFileOp.ENCODER_CAPTURE_EXPORT_ALL)
diff --git a/src/gui/app1/jumpsRjFatigue.cs b/src/gui/app1/jumpsRjFatigue.cs
index 8e2b37cc..612f29e8 100644
--- a/src/gui/app1/jumpsRjFatigue.cs
+++ b/src/gui/app1/jumpsRjFatigue.cs
@@ -23,7 +23,7 @@
 using System;
 using Gtk;
 using Glade;
-//using Mono.Unix;
+using Mono.Unix;
 using System.Collections.Generic; //List<T> 
 
 public partial class ChronoJumpWindow 
@@ -221,4 +221,31 @@ public partial class ChronoJumpWindow
                LogB.Information(string.Format("Mouse X: {0}; Mouse Y: {1}", args.Event.X, args.Event.Y));
                jumpsRjFatigueGraph.CalculateAndWriteRealXY(args.Event.X, args.Event.Y);
        }
+
+       private void on_button_jumps_rj_fatigue_save_image_clicked (object o, EventArgs args)
+       {
+               checkFile(Constants.CheckFileOp.JUMPS_RJ_FATIGUE_SAVE_IMAGE);
+       }
+
+       private void on_button_jumps_rj_fatigue_save_image_selected (string destination)
+       {
+               if(drawingarea_jumps_rj_fatigue == null)
+                       return;
+
+               Gdk.Pixbuf pixbuf = Gdk.Pixbuf.FromDrawable(drawingarea_jumps_rj_fatigue.GdkWindow, 
Gdk.Colormap.System,
+                               0, 0, 0, 0,
+                               UtilGtk.WidgetWidth(drawingarea_jumps_rj_fatigue),
+                               UtilGtk.WidgetHeight(drawingarea_jumps_rj_fatigue) );
+
+               LogB.Information("Saving");
+               pixbuf.Save(destination,"png");
+       }
+       private void on_overwrite_file_jumps_rj_fatigue_save_image_accepted (object o, EventArgs args)
+       {
+               on_button_jumps_rj_fatigue_save_image_selected (exportFileName);
+
+               string myString = string.Format(Catalog.GetString("Saved to {0}"), exportFileName);
+               new DialogMessage(Constants.MessageTypes.INFO, myString);
+       }
+
 }


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