[chronojump] Merged: button_jumps/runs_simple_capture_save_image



commit f1f85f5073caafc9ae95579d8b6367aa58e988d8
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jan 13 17:50:38 2022 +0100

    Merged: button_jumps/runs_simple_capture_save_image

 glade/app1.glade           | 82 +++++++++++++---------------------------------
 src/gui/app1/chronojump.cs | 16 ++++++---
 src/gui/app1/icons.cs      | 13 +++-----
 src/gui/app1/jump.cs       |  6 ----
 src/gui/app1/run.cs        |  6 ----
 5 files changed, 38 insertions(+), 85 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index c914c76ce..5d8b6f761 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -8203,18 +8203,18 @@ EncoderInertialCapture</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
-                                                            <widget class="GtkButton" 
id="button_jumps_simple_capture_save_image">
+                                                            <widget class="GtkButton" 
id="button_contacts_capture_save_image">
                                                             <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_simple_capture_save_image_clicked" swapped="no"/>
+                                                            <signal name="clicked" 
handler="on_button_contacts_capture_save_image_clicked" swapped="no"/>
                                                             <child>
                                                             <widget class="GtkVBox" id="vbox259">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
                                                             <child>
-                                                            <widget class="GtkImage" 
id="image_button_jumps_simple_capture_save_image_chart">
+                                                            <widget class="GtkImage" 
id="image_button_contacts_capture_save_image_chart">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property 
name="stock">gtk-missing-image</property>
@@ -8226,7 +8226,7 @@ EncoderInertialCapture</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkImage" 
id="image_button_jumps_simple_capture_save_image_disk">
+                                                            <widget class="GtkImage" 
id="image_button_contacts_capture_save_image_disk">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property 
name="stock">gtk-missing-image</property>
@@ -8246,50 +8246,6 @@ EncoderInertialCapture</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
-                                                            <child>
-                                                            <widget class="GtkButton" 
id="button_runs_simple_capture_save_image">
-                                                            <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_runs_simple_capture_save_image_clicked" swapped="no"/>
-                                                            <child>
-                                                            <widget class="GtkVBox" id="vbox260">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkImage" 
id="image_button_runs_simple_capture_save_image_chart">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property 
name="stock">gtk-missing-image</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">0</property>
-                                                            </packing>
-                                                            </child>
-                                                            <child>
-                                                            <widget class="GtkImage" 
id="image_button_runs_simple_capture_save_image_disk">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property 
name="stock">gtk-missing-image</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</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>
                                                             <property name="expand">False</property>
@@ -24880,6 +24836,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -31237,18 +31196,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>
@@ -31285,6 +31232,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>
@@ -40654,6 +40613,9 @@ then click this button.</property>
                                                             <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 27ebc82f1..389914f5a 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -100,6 +100,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.HBox hbox_contacts_capture_show_need_one;
        [Widget] Gtk.CheckButton check_contacts_capture_graph;
        [Widget] Gtk.CheckButton check_contacts_capture_table;
+       [Widget] Gtk.Button button_contacts_capture_save_image;
 
        [Widget] Gtk.EventBox eventbox_button_show_modes_contacts;
        [Widget] Gtk.EventBox eventbox_change_modes_contacts_jumps_simple;
@@ -3489,8 +3490,7 @@ public partial class ChronoJumpWindow
                radio_mode_contacts_capture.Active = true; //it is safe to change to capture, because analyze 
has different graphs depending on mode
                radio_mode_encoder_capture_small.Active = true; //it is safe to change to capture, to ensure 
all widgets are ok on analyze (everything seems ok, but just to have same behaviour than in contacts)
 
-               button_jumps_simple_capture_save_image.Visible = false;
-               button_runs_simple_capture_save_image.Visible = false;
+               button_contacts_capture_save_image.Visible = false;
                radio_mode_contacts_jumps_profile.Active = true;
                hbox_radio_mode_contacts_analyze_buttons.Visible = false;
                radio_mode_contacts_jumps_rj_fatigue.Visible = false;
@@ -3561,7 +3561,7 @@ public partial class ChronoJumpWindow
 
                                event_graph_label_graph_test.Visible = false;
                                vbox_contacts_simple_graph_controls.Visible = true;
-                               button_jumps_simple_capture_save_image.Visible = true;
+                               button_contacts_capture_save_image.Visible = true;
 
                                //align_check_vbox_contacts_graph_legend.Visible = true;
                                //vbox_contacts_graph_legend.Visible = false;
@@ -3641,7 +3641,7 @@ public partial class ChronoJumpWindow
 
                                event_graph_label_graph_test.Visible = false;
                                vbox_contacts_simple_graph_controls.Visible = true;
-                               button_runs_simple_capture_save_image.Visible = true;
+                               button_contacts_capture_save_image.Visible = true;
 
                                //align_check_vbox_contacts_graph_legend.Visible = true;
                                //vbox_contacts_graph_legend.Visible = false;
@@ -4305,6 +4305,14 @@ public partial class ChronoJumpWindow
                        notebook_mode_selector.CurrentPage = 0; //main
        }
 
+       private void on_button_contacts_capture_save_image_clicked (object o, EventArgs args)
+       {
+               if(current_mode == Constants.Modes.JUMPSSIMPLE)
+                       checkFile(Constants.CheckFileOp.JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE);
+               else if(current_mode == Constants.Modes.RUNSSIMPLE)
+                       checkFile(Constants.CheckFileOp.RUNS_SIMPLE_CAPTURE_SAVE_IMAGE);
+       }
+
        [Widget] Gtk.Label label_button_execute_connect;
 
        private void button_execute_test_show_connect_or_execute (bool connect_or_execute)
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index 47d1dc2e5..7f2d37d4b 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -119,14 +119,11 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_edit_selected_reaction_time;
        [Widget] Gtk.Image image_edit_selected_multi_chronopic;
 
-       //jumps
-       [Widget] Gtk.Image image_button_jumps_simple_capture_save_image_chart;
-       [Widget] Gtk.Image image_button_jumps_simple_capture_save_image_disk;
+       [Widget] Gtk.Image image_button_contacts_capture_save_image_chart;
+       [Widget] Gtk.Image image_button_contacts_capture_save_image_disk;
 
        //run
        [Widget] Gtk.Image image_run_simple_show_time;
-       [Widget] Gtk.Image image_button_runs_simple_capture_save_image_chart;
-       [Widget] Gtk.Image image_button_runs_simple_capture_save_image_disk;
        [Widget] Gtk.Image image_run_execute_running;
        [Widget] Gtk.Image image_run_execute_photocell;
        [Widget] Gtk.Image image_sprint_analyze_save;
@@ -835,8 +832,7 @@ public partial class ChronoJumpWindow
                UtilGtk.ColorsCheckbox(viewport_chronopics, check_encoder_analyze_show_time_to_peak_power);
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_analyze.png");
-               image_button_jumps_simple_capture_save_image_chart.Pixbuf = pixbuf;
-               image_button_runs_simple_capture_save_image_chart.Pixbuf = pixbuf;
+               image_button_contacts_capture_save_image_chart.Pixbuf = pixbuf;
                image_encoder_analyze_stats.Pixbuf = pixbuf;
                image_encoder_capture_image_save.Pixbuf = pixbuf;
                image_encoder_analyze_image_save.Pixbuf = pixbuf;
@@ -858,8 +854,7 @@ public partial class ChronoJumpWindow
                image_run_encoder_analyze_image_save_graph.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "save.png");
-               image_button_jumps_simple_capture_save_image_disk.Pixbuf = pixbuf;
-               image_button_runs_simple_capture_save_image_disk.Pixbuf = pixbuf;
+               image_button_contacts_capture_save_image_disk.Pixbuf = pixbuf;
                image_jumps_rj_fatigue_image_save.Pixbuf = pixbuf;
                image_sprint_analyze_table_save_1.Pixbuf = pixbuf;
                image_button_encoder_exercise_actions_edit_do.Pixbuf = pixbuf;
diff --git a/src/gui/app1/jump.cs b/src/gui/app1/jump.cs
index d18301187..41a31f816 100644
--- a/src/gui/app1/jump.cs
+++ b/src/gui/app1/jump.cs
@@ -48,7 +48,6 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.RadioButton extra_window_jumps_radiobutton_weight;
        //[Widget] Gtk.Label extra_window_jumps_label_weight;
        [Widget] Gtk.CheckButton extra_window_jumps_check_dj_arms;
-       [Widget] Gtk.Button button_jumps_simple_capture_save_image;
 
        //show weight on kg when percent is selected (SJl, CMJl, ABKl)
        [Widget] Gtk.Label label_extra_window_jumps_radiobutton_weight_percent_as_kg;
@@ -715,11 +714,6 @@ public partial class ChronoJumpWindow
 
        // ---- save jumps simple image start ---->
 
-       private void on_button_jumps_simple_capture_save_image_clicked (object o, EventArgs args)
-       {
-               checkFile(Constants.CheckFileOp.JUMPS_SIMPLE_CAPTURE_SAVE_IMAGE);
-       }
-
        private void on_button_jumps_simple_capture_save_image_selected (string destination)
        {
                if(event_execute_drawingarea_cairo == null)
diff --git a/src/gui/app1/run.cs b/src/gui/app1/run.cs
index b5aac73cf..b589543f4 100644
--- a/src/gui/app1/run.cs
+++ b/src/gui/app1/run.cs
@@ -40,7 +40,6 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Button button_runs_simple_track_distance;
        [Widget] Gtk.Label label_runs_simple_track_distance_value;
        [Widget] Gtk.Label label_runs_simple_track_distance_units;
-       [Widget] Gtk.Button button_runs_simple_capture_save_image;
 
        //options runs interval
        [Widget] Gtk.Button button_combo_runs_interval_exercise_capture_left;
@@ -504,11 +503,6 @@ public partial class ChronoJumpWindow
 
        // ---- save runs simple image start ---->
 
-       private void on_button_runs_simple_capture_save_image_clicked (object o, EventArgs args)
-       {
-               checkFile(Constants.CheckFileOp.RUNS_SIMPLE_CAPTURE_SAVE_IMAGE);
-       }
-
        private void on_button_runs_simple_capture_save_image_selected (string destination)
        {
                if(event_execute_drawingarea_cairo == null)


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