[chronojump] button contacts capture save image also works for jumps multiple and runs intervallic



commit e45d8db34c2aa19b6d218f43f392f8e6d5ff1aa7
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jan 13 18:12:43 2022 +0100

    button contacts capture save image also works for jumps multiple and runs intervallic

 src/constants.cs           |  4 ++--
 src/gui/app1/chronojump.cs |  8 ++++++--
 src/gui/app1/encoder.cs    | 38 ++++++++++++++++++++++++++------------
 src/gui/app1/jump.cs       |  6 +++---
 src/gui/app1/run.cs        |  6 +++---
 5 files changed, 40 insertions(+), 22 deletions(-)
---
diff --git a/src/constants.cs b/src/constants.cs
index 084cd8858..061ed8fed 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -1112,11 +1112,11 @@ public class Constants
        public enum EncoderGI {ALL, GRAVITATORY, INERTIAL}
        public enum CheckFileOp
        {
-               JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE,
+               JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE, JUMPS_REACTIVE_CAPTURE_SAVE_IMAGE,
                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_SIMPLE_CAPTURE_SAVE_IMAGE,
+               RUNS_SIMPLE_CAPTURE_SAVE_IMAGE, RUNS_INTERVALLIC_CAPTURE_SAVE_IMAGE,
                RUNS_EVOLUTION_SAVE_IMAGE,
                RUNS_SPRINT_SAVE_IMAGE,
                RUNS_SPRINT_EXPORT_INDIVIDUAL_CURRENT_SESSION_NO_IMAGES,
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 389914f5a..fcb04bc07 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -3553,6 +3553,7 @@ public partial class ChronoJumpWindow
                        image_top_laterality_contacts.Visible = false;
 
                        hbox_change_modes_jumps.Visible = true;
+                       button_contacts_capture_save_image.Visible = true;
 
                        if(m == Constants.Modes.JUMPSSIMPLE) 
                        {
@@ -3561,7 +3562,6 @@ public partial class ChronoJumpWindow
 
                                event_graph_label_graph_test.Visible = false;
                                vbox_contacts_simple_graph_controls.Visible = true;
-                               button_contacts_capture_save_image.Visible = true;
 
                                //align_check_vbox_contacts_graph_legend.Visible = true;
                                //vbox_contacts_graph_legend.Visible = false;
@@ -3632,6 +3632,7 @@ public partial class ChronoJumpWindow
                        image_top_laterality_contacts.Visible = false;
 
                        hbox_change_modes_runs.Visible = true;
+                       button_contacts_capture_save_image.Visible = true;
                        check_run_show_time.Visible = true;
 
                        if(m == Constants.Modes.RUNSSIMPLE) 
@@ -3641,7 +3642,6 @@ public partial class ChronoJumpWindow
 
                                event_graph_label_graph_test.Visible = false;
                                vbox_contacts_simple_graph_controls.Visible = true;
-                               button_contacts_capture_save_image.Visible = true;
 
                                //align_check_vbox_contacts_graph_legend.Visible = true;
                                //vbox_contacts_graph_legend.Visible = false;
@@ -4309,8 +4309,12 @@ public partial class ChronoJumpWindow
        {
                if(current_mode == Constants.Modes.JUMPSSIMPLE)
                        checkFile(Constants.CheckFileOp.JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE);
+               else if(current_mode == Constants.Modes.JUMPSREACTIVE)
+                       checkFile(Constants.CheckFileOp.JUMPS_REACTIVE_CAPTURE_SAVE_IMAGE);
                else if(current_mode == Constants.Modes.RUNSSIMPLE)
                        checkFile(Constants.CheckFileOp.RUNS_SIMPLE_CAPTURE_SAVE_IMAGE);
+               else if(current_mode == Constants.Modes.RUNSINTERVALLIC)
+                       checkFile(Constants.CheckFileOp.RUNS_INTERVALLIC_CAPTURE_SAVE_IMAGE);
        }
 
        [Widget] Gtk.Label label_button_execute_connect;
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index cab26e073..12f6f892f 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -2141,12 +2141,14 @@ public partial class ChronoJumpWindow
                        exportString = Catalog.GetString ("Export set in CSV format");
                else if(
                                checkFileOp == Constants.CheckFileOp.JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE ||
+                               checkFileOp == Constants.CheckFileOp.JUMPS_REACTIVE_CAPTURE_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.JUMPS_PROFILE_SAVE_IMAGE ||
                                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_SIMPLE_CAPTURE_SAVE_IMAGE ||
+                               checkFileOp == Constants.CheckFileOp.RUNS_INTERVALLIC_CAPTURE_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.RUNS_EVOLUTION_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.RUNS_SPRINT_SAVE_IMAGE ||
                                checkFileOp == Constants.CheckFileOp.ENCODER_ANALYZE_SAVE_IMAGE ||
@@ -2231,15 +2233,23 @@ public partial class ChronoJumpWindow
                        nameString += "_encoder_set.png";
                else if(
                                checkFileOp == Constants.CheckFileOp.JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE ||
-                               checkFileOp == Constants.CheckFileOp.RUNS_SIMPLE_CAPTURE_SAVE_IMAGE)
+                               checkFileOp == Constants.CheckFileOp.JUMPS_REACTIVE_CAPTURE_SAVE_IMAGE ||
+                               checkFileOp == Constants.CheckFileOp.RUNS_SIMPLE_CAPTURE_SAVE_IMAGE ||
+                               checkFileOp == Constants.CheckFileOp.RUNS_INTERVALLIC_CAPTURE_SAVE_IMAGE)
                {
                        //if showing all persons, do not person name on filename
                        if(radio_contacts_graph_allPersons.Active)
                                nameString = currentSession.DateShortAsSQL;
 
-                       string testType = "_" + Catalog.GetString("jumps") + "_";
-                       if(checkFileOp == Constants.CheckFileOp.RUNS_SIMPLE_CAPTURE_SAVE_IMAGE)
-                               testType = "_" + Catalog.GetString("races") + "_";
+                       string testType = "";
+                       if(checkFileOp == Constants.CheckFileOp.JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE)
+                               testType = "_" + Util.ChangeChars(Catalog.GetString("Jumps simple"), " ", 
"_") + "_";
+                       else if(checkFileOp == Constants.CheckFileOp.JUMPS_REACTIVE_CAPTURE_SAVE_IMAGE)
+                               testType = "_" + Util.ChangeChars(Catalog.GetString("Jumps multiple"), " ", 
"_") + "_";
+                       else if(checkFileOp == Constants.CheckFileOp.RUNS_SIMPLE_CAPTURE_SAVE_IMAGE)
+                               testType = "_" + Util.ChangeChars(Catalog.GetString("Races simple"), " ", 
"_") + "_";
+                       else if(checkFileOp == Constants.CheckFileOp.RUNS_INTERVALLIC_CAPTURE_SAVE_IMAGE)
+                               testType = "_" + Util.ChangeChars(Catalog.GetString("Races intervallic"), " 
", "_") + "_";
 
                        //if showing a jump or all, show on filename
                        if(radio_contacts_graph_allTests.Active)
@@ -2350,9 +2360,10 @@ public partial class ChronoJumpWindow
                                                                "Are you sure you want to overwrite: "), "",
                                                        exportFileName);
 
-                                       if(checkFileOp == 
Constants.CheckFileOp.JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE)
+                                       if(checkFileOp == 
Constants.CheckFileOp.JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE ||
+                                                       checkFileOp == 
Constants.CheckFileOp.JUMPS_REACTIVE_CAPTURE_SAVE_IMAGE)
                                                confirmWin.Button_accept.Clicked +=
-                                                       new 
EventHandler(on_overwrite_file_jumps_simple_capture_save_image_accepted);
+                                                       new 
EventHandler(on_overwrite_file_jumps_capture_save_image_accepted);
                                        else if(checkFileOp == Constants.CheckFileOp.JUMPS_PROFILE_SAVE_IMAGE)
                                                confirmWin.Button_accept.Clicked +=
                                                        new 
EventHandler(on_overwrite_file_jumps_profile_save_image_accepted);
@@ -2368,9 +2379,10 @@ public partial class ChronoJumpWindow
                                        else 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_SIMPLE_CAPTURE_SAVE_IMAGE)
+                                       else if(checkFileOp == 
Constants.CheckFileOp.RUNS_SIMPLE_CAPTURE_SAVE_IMAGE ||
+                                                       checkFileOp == 
Constants.CheckFileOp.RUNS_INTERVALLIC_CAPTURE_SAVE_IMAGE)
                                                confirmWin.Button_accept.Clicked +=
-                                                       new 
EventHandler(on_overwrite_file_runs_simple_capture_save_image_accepted);
+                                                       new 
EventHandler(on_overwrite_file_runs_capture_save_image_accepted);
                                        else if(checkFileOp == 
Constants.CheckFileOp.RUNS_EVOLUTION_SAVE_IMAGE)
                                                confirmWin.Button_accept.Clicked +=
                                                        new 
EventHandler(on_overwrite_file_runs_evolution_save_image_accepted);
@@ -2432,8 +2444,9 @@ public partial class ChronoJumpWindow
                                                        new 
EventHandler(on_overwrite_file_raceAnalyzer_save_table_accepted);
 
                                } else {
-                                       if(checkFileOp == 
Constants.CheckFileOp.JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE)
-                                               on_button_jumps_simple_capture_save_image_selected 
(exportFileName);
+                                       if(checkFileOp == 
Constants.CheckFileOp.JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE ||
+                                                       checkFileOp == 
Constants.CheckFileOp.JUMPS_REACTIVE_CAPTURE_SAVE_IMAGE)
+                                               on_button_jumps_capture_save_image_selected (exportFileName);
                                        else if(checkFileOp == Constants.CheckFileOp.JUMPS_PROFILE_SAVE_IMAGE)
                                                on_button_jumps_profile_save_image_selected (exportFileName);
                                        else if(checkFileOp == 
Constants.CheckFileOp.JUMPS_DJ_OPTIMAL_FALL_SAVE_IMAGE)
@@ -2444,8 +2457,9 @@ public partial class ChronoJumpWindow
                                                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_SIMPLE_CAPTURE_SAVE_IMAGE)
-                                               on_button_runs_simple_capture_save_image_selected 
(exportFileName);
+                                       else if(checkFileOp == 
Constants.CheckFileOp.RUNS_SIMPLE_CAPTURE_SAVE_IMAGE ||
+                                                       checkFileOp == 
Constants.CheckFileOp.RUNS_INTERVALLIC_CAPTURE_SAVE_IMAGE)
+                                               on_button_runs_capture_save_image_selected (exportFileName);
                                        else if(checkFileOp == 
Constants.CheckFileOp.RUNS_EVOLUTION_SAVE_IMAGE)
                                                on_button_runs_evolution_save_image_selected (exportFileName);
                                        else if(checkFileOp == Constants.CheckFileOp.RUNS_SPRINT_SAVE_IMAGE)
diff --git a/src/gui/app1/jump.cs b/src/gui/app1/jump.cs
index 41a31f816..3c38bb5d2 100644
--- a/src/gui/app1/jump.cs
+++ b/src/gui/app1/jump.cs
@@ -714,7 +714,7 @@ public partial class ChronoJumpWindow
 
        // ---- save jumps simple image start ---->
 
-       private void on_button_jumps_simple_capture_save_image_selected (string destination)
+       private void on_button_jumps_capture_save_image_selected (string destination)
        {
                if(event_execute_drawingarea_cairo == null)
                        return;
@@ -727,9 +727,9 @@ public partial class ChronoJumpWindow
                LogB.Information("Saving");
                pixbuf.Save(destination,"png");
        }
-       private void on_overwrite_file_jumps_simple_capture_save_image_accepted (object o, EventArgs args)
+       private void on_overwrite_file_jumps_capture_save_image_accepted (object o, EventArgs args)
        {
-               on_button_jumps_simple_capture_save_image_selected (exportFileName);
+               on_button_jumps_capture_save_image_selected (exportFileName);
 
                string myString = string.Format(Catalog.GetString("Saved to {0}"), exportFileName);
                new DialogMessage(Constants.MessageTypes.INFO, myString);
diff --git a/src/gui/app1/run.cs b/src/gui/app1/run.cs
index b589543f4..825a14d34 100644
--- a/src/gui/app1/run.cs
+++ b/src/gui/app1/run.cs
@@ -503,7 +503,7 @@ public partial class ChronoJumpWindow
 
        // ---- save runs simple image start ---->
 
-       private void on_button_runs_simple_capture_save_image_selected (string destination)
+       private void on_button_runs_capture_save_image_selected (string destination)
        {
                if(event_execute_drawingarea_cairo == null)
                        return;
@@ -516,9 +516,9 @@ public partial class ChronoJumpWindow
                LogB.Information("Saving");
                pixbuf.Save(destination,"png");
        }
-       private void on_overwrite_file_runs_simple_capture_save_image_accepted (object o, EventArgs args)
+       private void on_overwrite_file_runs_capture_save_image_accepted (object o, EventArgs args)
        {
-               on_button_runs_simple_capture_save_image_selected (exportFileName);
+               on_button_runs_capture_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]