[chronojump] Show time on Run simple graph: glade and signals working



commit 9b250c02fb53b4881e8fb05c52825e071aea3659
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Mar 11 19:29:11 2021 +0100

    Show time on Run simple graph: glade and signals working

 glade/app1.glade           | 44 ++++++++++++++++++++++++++++++++------------
 src/gui/app1/chronojump.cs |  2 ++
 src/gui/eventExecute.cs    | 18 ++++++++++++++----
 3 files changed, 48 insertions(+), 16 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 11ef5ffc..216202fa 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -7886,6 +7886,20 @@ EncoderInertialCapture</property>
                                                             <property name="position">2</property>
                                                             </packing>
                                                             </child>
+                                                            <child>
+                                                            <widget class="GtkCheckButton" 
id="check_run_simple_show_time">
+                                                            <property name="label" translatable="yes">Show 
time</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <signal name="toggled" 
handler="on_check_run_simple_show_time_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">3</property>
+                                                            </packing>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -23843,6 +23857,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -29926,6 +29943,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>
@@ -29962,18 +29991,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>
@@ -38354,6 +38371,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 58ea4b20..f8288711 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -3034,6 +3034,7 @@ public partial class ChronoJumpWindow
 
                                event_graph_label_graph_test.Visible = false;
                                hbox_contacts_simple_graph_controls.Visible = true;
+                               check_run_simple_show_time.Visible = false;
 
                                check_vbox_contacts_graph_legend.Visible = true;
                                //vbox_contacts_graph_legend.Visible = false;
@@ -3087,6 +3088,7 @@ public partial class ChronoJumpWindow
 
                                event_graph_label_graph_test.Visible = false;
                                hbox_contacts_simple_graph_controls.Visible = true;
+                               check_run_simple_show_time.Visible = true;
 
                                check_vbox_contacts_graph_legend.Visible = true;
                                //vbox_contacts_graph_legend.Visible = false;
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 7505d898..e7b0bb79 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -56,6 +56,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.RadioButton radio_contacts_graph_allPersons;
        [Widget] Gtk.Image image_radio_contacts_graph_currentPerson;
        [Widget] Gtk.Image image_radio_contacts_graph_allPersons;
+       [Widget] Gtk.CheckButton check_run_simple_show_time;
        
        [Widget] Gtk.ProgressBar event_execute_progressbar_event;
        [Widget] Gtk.ProgressBar event_execute_progressbar_time;
@@ -323,6 +324,7 @@ public partial class ChronoJumpWindow
        {
                event_graph_label_graph_test.Visible = false;
                hbox_contacts_simple_graph_controls.Visible = true;
+               check_run_simple_show_time.Visible = false;
 
                check_vbox_contacts_graph_legend.Visible = true;
                //vbox_contacts_graph_legend.Visible = false;
@@ -361,6 +363,7 @@ public partial class ChronoJumpWindow
        {
                event_graph_label_graph_test.Visible = false;
                hbox_contacts_simple_graph_controls.Visible = true;
+               check_run_simple_show_time.Visible = true;
 
                check_vbox_contacts_graph_legend.Visible = true;
                //vbox_contacts_graph_legend.Visible = false;
@@ -872,7 +875,9 @@ public partial class ChronoJumpWindow
                                        event_execute_run_simple_double_contacts_pixmap);
 
                        paintRunSimple (event_execute_drawingarea, eventGraph,
-                                       maxValue, minValue, topMargin, bottomMargin, animate, runPTL);
+                                       maxValue, minValue, topMargin, bottomMargin, animate,
+                                       check_run_simple_show_time.Active,
+                                       runPTL);
                
                
                // -- refresh
@@ -1686,7 +1691,7 @@ public partial class ChronoJumpWindow
        }
 
        private void paintRunSimple (Gtk.DrawingArea drawingarea, PrepareEventGraphRunSimple eventGraph,
-                       double maxValue, double minValue, int topMargin, int bottomMargin, bool animate,
+                       double maxValue, double minValue, int topMargin, int bottomMargin, bool animate, bool 
showTime,
                        RunPhaseTimeList runPTL)
        {
                int ancho=drawingarea.Allocation.Width;
@@ -1747,7 +1752,7 @@ public partial class ChronoJumpWindow
                        List<Event> events = Run.RunListToEventList(eventGraph.runsAtSQL);
                        longestWordSize = findLongestWordSize (events, eventGraph.type == ""); // condition 
for "all runs"
                        layoutText = calculateLayoutFontForText (events, longestWordSize, layoutText, ancho);
-                       maxRowsForText = calculateMaxRowsForText (events, longestWordSize, eventGraph.type == 
"", true); //also adds +1 if simulated
+                       maxRowsForText = calculateMaxRowsForText (events, longestWordSize, eventGraph.type == 
"", showTime); //also adds +1 if simulated
                        bottomMargin = calculateBottomMarginForText (maxRowsForText, layoutText);
                }
                        
@@ -1803,7 +1808,6 @@ public partial class ChronoJumpWindow
                                                
Convert.ToInt32((ancho-event_execute_rightMargin)*(countToDraw-.5)/countRuns),
                                                alto, layoutText);
 
-                       bool showTime = true;
                        if (
                                        ( showTextOnBar && (eventGraph.type == "" || run.Description != "") ) 
||
                                        showTime
@@ -2792,6 +2796,12 @@ public partial class ChronoJumpWindow
                        updateGraphRunsSimple ();
        }
 
+       private void on_check_run_simple_show_time_toggled (object o, EventArgs args)
+       {
+               //only is shown on run simple
+               updateGraphRunsSimple ();
+       }
+
        // <---- end of test simple controls -----
 
        private void on_event_execute_update_graph_in_progress_clicked(object o, EventArgs args)


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