[chronojump] Encoder capture 4 views now managed by checkbuttons



commit e63e3386286fe13d533adb0752fbd81889e2a5c0
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Jul 19 11:45:25 2021 +0200

    Encoder capture 4 views now managed by checkbuttons

 glade/app1.glade        | 40 ++++++++++-----------------------------
 src/gui/app1/encoder.cs | 50 +++++++++++++++++++------------------------------
 2 files changed, 29 insertions(+), 61 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 898bb60b0..4d3b3a61e 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -32311,14 +32311,13 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkRadioButton" 
id="radio_encoder_capture_show_bars">
-                                                            <property name="label">bars</property>
+                                                            <widget class="GtkCheckButton" 
id="check_encoder_capture_bars">
+                                                            <property name="label" 
translatable="yes">Bars</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property 
name="receives_default">False</property>
-                                                            <property name="active">True</property>
                                                             <property name="draw_indicator">True</property>
-                                                            <signal name="toggled" 
handler="on_radio_encoder_capture_show_toggled" swapped="no"/>
+                                                            <signal name="clicked" 
handler="on_check_encoder_capture_bars_clicked" swapped="no"/>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -32327,15 +32326,13 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkRadioButton" 
id="radio_encoder_capture_show_table">
-                                                            <property name="label">table</property>
+                                                            <widget class="GtkCheckButton" 
id="check_encoder_capture_table">
+                                                            <property name="label" 
translatable="yes">Table</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property 
name="receives_default">False</property>
-                                                            <property name="active">True</property>
                                                             <property name="draw_indicator">True</property>
-                                                            <property 
name="group">radio_encoder_capture_show_bars</property>
-                                                            <signal name="toggled" 
handler="on_radio_encoder_capture_show_toggled" swapped="no"/>
+                                                            <signal name="clicked" 
handler="on_check_encoder_capture_table_clicked" swapped="no"/>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -32344,14 +32341,13 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkRadioButton" 
id="radio_encoder_capture_show_bars_and_table">
-                                                            <property name="label">bars, table</property>
+                                                            <widget class="GtkCheckButton" 
id="check_encoder_capture_signal">
+                                                            <property name="label" 
translatable="yes">Signal</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property 
name="receives_default">False</property>
                                                             <property name="draw_indicator">True</property>
-                                                            <property 
name="group">radio_encoder_capture_show_bars</property>
-                                                            <signal name="toggled" 
handler="on_radio_encoder_capture_show_toggled" swapped="no"/>
+                                                            <signal name="clicked" 
handler="on_check_encoder_capture_signal_clicked" swapped="no"/>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -32359,22 +32355,6 @@ Concentric</property>
                                                             <property name="position">3</property>
                                                             </packing>
                                                             </child>
-                                                            <child>
-                                                            <widget class="GtkRadioButton" 
id="radio_encoder_capture_show_bars_table_and_signal">
-                                                            <property name="label">bars, table, 
signal</property>
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property 
name="receives_default">False</property>
-                                                            <property name="draw_indicator">True</property>
-                                                            <property 
name="group">radio_encoder_capture_show_bars</property>
-                                                            <signal name="toggled" 
handler="on_radio_encoder_capture_show_toggled" swapped="no"/>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">False</property>
-                                                            <property name="fill">False</property>
-                                                            <property name="position">4</property>
-                                                            </packing>
-                                                            </child>
                                                             </widget>
                                                             </child>
                                                             </widget>
@@ -32588,7 +32568,7 @@ Concentric</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox156">
+                                                            <widget class="GtkHBox" 
id="hbox_encoder_capture_save_repetitions">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <child>
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index cf69d62c3..ca8368fdc 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -120,10 +120,11 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Notebook notebook_encoder_sup;
        [Widget] Gtk.Notebook notebook_encoder_capture;
 
-       [Widget] Gtk.RadioButton radio_encoder_capture_show_bars;
-       [Widget] Gtk.RadioButton radio_encoder_capture_show_table;
-       [Widget] Gtk.RadioButton radio_encoder_capture_show_bars_and_table;
-       [Widget] Gtk.RadioButton radio_encoder_capture_show_bars_table_and_signal;
+       //encoder capture tab view options
+       [Widget] Gtk.CheckButton check_encoder_capture_bars;
+       [Widget] Gtk.CheckButton check_encoder_capture_table;
+       [Widget] Gtk.CheckButton check_encoder_capture_signal;
+       [Widget] Gtk.HBox hbox_encoder_capture_save_repetitions;
        [Widget] Gtk.Alignment alignment_encoder_capture_curves_bars_drawingarea;
 
        [Widget] Gtk.Box hbox_combo_encoder_exercise_capture;
@@ -1332,35 +1333,22 @@ public partial class ChronoJumpWindow
                }
        }
 
-
-       private void on_radio_encoder_capture_show_toggled (object o, EventArgs args)
+       private void on_check_encoder_capture_bars_clicked (object o, EventArgs args)
        {
-               if(o == (object) radio_encoder_capture_show_bars)
-               {
-                       alignment_encoder_capture_curves_bars_drawingarea.Visible = true;
-                       alignment_treeview_encoder_capture_curves.Visible = false;
-                       vpaned_encoder_capture_video_and_set_graph.Visible = false;
-               }
-               else if(o == (object) radio_encoder_capture_show_table)
-               {
-                       alignment_encoder_capture_curves_bars_drawingarea.Visible = false;
-                       alignment_treeview_encoder_capture_curves.Visible = true;
-                       vpaned_encoder_capture_video_and_set_graph.Visible = false;
-               }
-               else if(o == (object) radio_encoder_capture_show_bars_and_table)
-               {
-                       alignment_encoder_capture_curves_bars_drawingarea.Visible = true;
-                       alignment_treeview_encoder_capture_curves.Visible = true;
-                       vpaned_encoder_capture_video_and_set_graph.Visible = false;
-               }
-               else if(o == (object) radio_encoder_capture_show_bars_table_and_signal)
-               {
-                       alignment_encoder_capture_curves_bars_drawingarea.Visible = true;
-                       alignment_treeview_encoder_capture_curves.Visible = true;
-                       vpaned_encoder_capture_video_and_set_graph.Visible = true;
-               }
+               alignment_encoder_capture_curves_bars_drawingarea.Visible = check_encoder_capture_bars.Active;
+               hbox_encoder_capture_save_repetitions.Visible =
+                       (check_encoder_capture_bars.Active || check_encoder_capture_table.Active);
+       }
+       private void on_check_encoder_capture_table_clicked (object o, EventArgs args)
+       {
+               alignment_treeview_encoder_capture_curves.Visible = check_encoder_capture_table.Active;
+               hbox_encoder_capture_save_repetitions.Visible =
+                       (check_encoder_capture_bars.Active || check_encoder_capture_table.Active);
+       }
+       private void on_check_encoder_capture_signal_clicked (object o, EventArgs args)
+       {
+               vpaned_encoder_capture_video_and_set_graph.Visible = check_encoder_capture_signal.Active;
        }
-
 
        private void encoderUpdateTreeViewCapture(List<string> contents)
        {


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