[chronojump] chronopic button execute can be connect or execute



commit b438cc8c0a72ef4c01410fa86a2a83e2b7594d37
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Oct 16 19:22:32 2020 +0200

    chronopic button execute can be connect or execute

 glade/app1.glade           | 55 ++++++++++++++++++++++++++++++++++------------
 src/gui/app1/chronojump.cs | 31 ++++++++++++++++++++++++++
 src/gui/app1/shortcuts.cs  |  6 ++---
 src/gui/chronopic.cs       |  4 ++++
 4 files changed, 79 insertions(+), 17 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index c8f5f8a1..a294892d 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -5891,15 +5891,36 @@ EncoderInertialCapture</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
                                                             <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" 
translatable="yes">Execute test</property>
                                                             <signal name="clicked" 
handler="on_button_execute_test_clicked" swapped="no"/>
                                                             <accelerator key="space" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
                                                             <child>
-                                                            <widget class="GtkImage" 
id="image_button_execute">
+                                                            <widget class="GtkVBox" id="vbox70">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_button_execute">
+                                                            <property name="can_focus">False</property>
                                                             <property name="stock">gtk-apply</property>
                                                             </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" 
id="label_button_execute_connect">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">Connect</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
                                                             </child>
                                                             </widget>
                                                             <packing>
@@ -25002,6 +25023,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -27858,6 +27882,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>
@@ -27894,18 +27930,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>
@@ -35988,6 +36012,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 987d0369..bfdb894d 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -2988,6 +2988,8 @@ public partial class ChronoJumpWindow
 
                if(m == Constants.Menuitem_modes.JUMPSSIMPLE || m == Constants.Menuitem_modes.JUMPSREACTIVE)
                {
+                       button_execute_test_show_connect_or_execute(! 
cp2016.SuccededConnectContactsRealThread);
+
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.CONTACTS);
                        //notebook_capture_analyze.ShowTabs = true;
                        hbox_contacts_sup_capture_analyze_two_buttons.Visible = true;
@@ -3035,6 +3037,8 @@ public partial class ChronoJumpWindow
                }
                else if(m == Constants.Menuitem_modes.RUNSSIMPLE || m == 
Constants.Menuitem_modes.RUNSINTERVALLIC)
                {
+                       button_execute_test_show_connect_or_execute(! 
cp2016.SuccededConnectContactsRealThread);
+
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.CONTACTS);
                        //notebook_capture_analyze.ShowTabs = true;
                        hbox_contacts_sup_capture_analyze_two_buttons.Visible = true;
@@ -3178,6 +3182,8 @@ public partial class ChronoJumpWindow
                } 
                else if(m == Constants.Menuitem_modes.FORCESENSOR)
                {
+                       button_execute_test_show_connect_or_execute(false);
+
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.CONTACTS);
                        notebooks_change(m);
 
@@ -3217,6 +3223,8 @@ public partial class ChronoJumpWindow
                }
                else if(m == Constants.Menuitem_modes.RUNSENCODER)
                {
+                       button_execute_test_show_connect_or_execute(false);
+
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.CONTACTS);
                        notebooks_change(m);
 
@@ -3252,6 +3260,8 @@ public partial class ChronoJumpWindow
                }
                else if(m == Constants.Menuitem_modes.RT)
                {
+                       button_execute_test_show_connect_or_execute(! 
cp2016.SuccededConnectContactsRealThread);
+
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.CONTACTS);
                        notebooks_change(m);
                        on_extra_window_reaction_times_test_changed(new object(), new EventArgs());
@@ -3266,6 +3276,8 @@ public partial class ChronoJumpWindow
                        pixbufModeGrid = new Pixbuf (null, Util.GetImagePath(false) + "image_modes_rt.png");
                }
                else {  //m == Constants.Menuitem_modes.OTHER (contacts / other)
+                       button_execute_test_show_connect_or_execute(! 
cp2016.SuccededConnectContactsRealThread);
+
                        notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.CONTACTS);
                        hbox_other.Visible = true;
                        notebooks_change(m);
@@ -3597,6 +3609,25 @@ public partial class ChronoJumpWindow
                        notebook_mode_selector.CurrentPage = 0; //main
        }
 
+       [Widget] Gtk.Label label_button_execute_connect;
+
+       private void button_execute_test_show_connect_or_execute (bool connect_or_execute)
+       {
+               string space = Catalog.GetString("Space");
+
+               if(connect_or_execute)
+               {
+                       label_button_execute_connect.Visible = true;
+                       image_button_execute.Visible = false;
+                       button_execute_test.TooltipText = Catalog.GetString("Connect") + string.Format(" 
({0}+{1})", kCtrl, space);
+               } else
+               {
+                       label_button_execute_connect.Visible = false;
+                       image_button_execute.Visible = true;
+                       button_execute_test.TooltipText = Catalog.GetString("Execute test") + string.Format(" 
({0}+{1})", kCtrl, space);
+               }
+       }
+
        /*
         * end of menu test selectors
         */
diff --git a/src/gui/app1/shortcuts.cs b/src/gui/app1/shortcuts.cs
index 99feed04..a0b63ea3 100644
--- a/src/gui/app1/shortcuts.cs
+++ b/src/gui/app1/shortcuts.cs
@@ -31,11 +31,11 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Button button_encoder_exercise;
        [Widget] Gtk.Button button_encoder_exercise_close_and_capture;
 
+       private string kCtrl = "Ctrl";
+       private string kEnter = "Enter";
+
        private void addShortcutsToTooltips(bool isMac)
        {
-               string kCtrl = "Ctrl";
-               string kEnter = "Enter";
-
                /*
                 * on 2.0 mac will also use ctrl until we find the way to use command
                 *
diff --git a/src/gui/chronopic.cs b/src/gui/chronopic.cs
index 529c7edd..415d6ecd 100644
--- a/src/gui/chronopic.cs
+++ b/src/gui/chronopic.cs
@@ -149,6 +149,10 @@ public partial class ChronoJumpWindow
                        connectingSequence = connectingSequenceEnum.FIRMWAREIFNEEDED;
                        chronopicConnectionSequenceDo();
                        */
+
+                       //change appearance of execute test button
+                       button_execute_test_show_connect_or_execute(false);
+
                } else
                        LogB.Warning("Failure at Connecting real! (main GUI)");
        }


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