[chronojump/michrolab] Gui for detect/capture buttons on encoder like in contacts



commit 60c1034d312dab7a378da305599e62cf9b605c5d
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Jun 24 08:35:40 2022 +0200

    Gui for detect/capture buttons on encoder like in contacts

 glade/app1.glade           | 198 +++++++++++++++++++++++++++++++++++++++++++--
 src/gui/app1/chronojump.cs |   6 +-
 src/gui/app1/icons.cs      |   6 ++
 3 files changed, 202 insertions(+), 8 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 39b5b4811..8948725f1 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -5311,12 +5311,15 @@ EncoderInertialCapture</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
                                                             <property name="has_tooltip">True</property>
-                                                            <signal name="clicked" 
handler="on_button_contacts_detect_clicked" swapped="no"/>
+                                                            <property name="tooltip" 
translatable="yes">Detect device</property>
+                                                            <signal name="clicked" 
handler="on_button_detect_clicked" swapped="no"/>
                                                             <accelerator key="space" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
                                                             <child>
                                                             <widget class="GtkVBox" id="vbox59">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
+                                                            <property name="border_width">2</property>
+                                                            <property name="spacing">2</property>
                                                             <child>
                                                             <widget class="GtkHBox" id="hbox225">
                                                             <property name="visible">True</property>
@@ -5438,7 +5441,8 @@ EncoderInertialCapture</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
-                                                            <signal name="clicked" 
handler="on_button_contacts_detect_clicked" swapped="no"/>
+                                                            <property name="tooltip" 
translatable="yes">Change device</property>
+                                                            <signal name="clicked" 
handler="on_button_detect_clicked" swapped="no"/>
                                                             <child>
                                                             <widget class="GtkHBox" id="hbox325">
                                                             <property name="visible">True</property>
@@ -31881,25 +31885,207 @@ Concentric</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">8</property>
                                                             <child>
-                                                            <widget class="GtkButton" 
id="button_encoder_capture">
+                                                            <widget class="GtkHBox" id="hbox328">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_encoder_detect">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="can_default">True</property>
                                                             <property name="receives_default">True</property>
                                                             <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" 
translatable="yes">Execute test</property>
+                                                            <property name="tooltip" 
translatable="yes">Detect device</property>
                                                             <property name="relief">half</property>
                                                             <property name="use_underline">True</property>
-                                                            <signal name="clicked" 
handler="on_button_encoder_capture_clicked" swapped="no"/>
+                                                            <signal name="clicked" 
handler="on_button_detect_clicked" swapped="no"/>
                                                             <accelerator key="space" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
                                                             <child>
-                                                            <widget class="GtkImage" 
id="image_encoder_capture_execute">
+                                                            <widget class="GtkVBox" id="vbox101">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="border_width">2</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox379">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_chronopic_connect_contacts4">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-connect</property>
+                                                            <property name="icon-size">2</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" 
id="label_button_contacts_detect3">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label">Device</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </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_encoder_detect">
                                                             <property name="width_request">48</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property 
name="stock">gtk-missing-image</property>
                                                             <property name="icon-size">6</property>
                                                             </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</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">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" 
id="hbox_encoder_detect_and_execute">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">8</property>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_encoder_capture">
+                                                            <property name="visible">True</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_encoder_capture_clicked" swapped="no"/>
+                                                            <accelerator key="space" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
+                                                            <child>
+                                                            <widget class="GtkVBox" id="vbox88">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="border_width">2</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label278">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label" 
translatable="yes">Capture</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_encoder_capture_execute">
+                                                            <property name="visible">True</property>
+                                                            <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">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkVBox" id="vbox100">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">8</property>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_encoder_detect_small">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <property name="tooltip" 
translatable="yes">Change device</property>
+                                                            <signal name="clicked" 
handler="on_button_detect_clicked" swapped="no"/>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox365">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">6</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_chronopic_connect_contacts3">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-connect</property>
+                                                            <property name="icon-size">2</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" 
id="label_button_contacts_detect2">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label">Device</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">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </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">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
                                                             </child>
                                                             </widget>
                                                             <packing>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index accec4944..757b6a84a 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -4642,8 +4642,9 @@ public partial class ChronoJumpWindow
 
        //right now implemented only contacts
        DiscoverWindow discoverWin;
-       private void on_button_contacts_detect_clicked (object o, EventArgs args)
+       private void on_button_detect_clicked (object o, EventArgs args)
        {
+               /*
                if(
                                current_mode != Constants.Modes.JUMPSSIMPLE &&
                                current_mode != Constants.Modes.JUMPSREACTIVE &&
@@ -4652,6 +4653,7 @@ public partial class ChronoJumpWindow
                                ! Constants.ModeIsFORCESENSOR (current_mode) &&
                                current_mode != Constants.Modes.RUNSENCODER)
                        return;
+                       */
 
                app1s_notebook_sup_entered_from = notebook_sup.CurrentPage; //CONTACTS or ENCODER
                notebook_sup.CurrentPage = Convert.ToInt32 (notebook_sup_pages.MICRODISCOVER);
@@ -4760,7 +4762,7 @@ public partial class ChronoJumpWindow
                                else
                                {
                                        if (! configChronojump.Compujump)
-                                               on_button_contacts_detect_clicked (o, args); //open discover 
win
+                                               on_button_detect_clicked (o, args); //open discover win
                                }
                        } else {
                                LogB.Information ("getSelectedFormode: " + 
chronopicRegister.GetSelectedForMode (current_mode).ToString ());
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index 263428ced..ce63a0954 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -55,10 +55,13 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_chronopic_connect_contacts;
        [Widget] Gtk.Image image_chronopic_connect_contacts1;
        [Widget] Gtk.Image image_chronopic_connect_contacts2;
+       [Widget] Gtk.Image image_chronopic_connect_contacts3;
+       [Widget] Gtk.Image image_chronopic_connect_contacts4;
        [Widget] Gtk.Image image_chronopic_connect_encoder;
        [Widget] Gtk.Image image_chronopic_connect_encoder1;
        [Widget] Gtk.Image image_chronopic_connect_encoder2;
        [Widget] Gtk.Image image_button_contacts_detect;
+       [Widget] Gtk.Image image_button_encoder_detect;
        [Widget] Gtk.Image image_button_execute;
        [Widget] Gtk.Image image_contacts_bell;
        [Widget] Gtk.Image image_contacts_close_and_capture;
@@ -454,6 +457,8 @@ public partial class ChronoJumpWindow
                image_chronopic_connect_contacts.Pixbuf = pixbuf;
                image_chronopic_connect_contacts1.Pixbuf = pixbuf;
                image_chronopic_connect_contacts2.Pixbuf = pixbuf;
+               image_chronopic_connect_contacts3.Pixbuf = pixbuf;
+               image_chronopic_connect_contacts4.Pixbuf = pixbuf;
                image_chronopic_connect_encoder.Pixbuf = pixbuf;
                image_chronopic_connect_encoder1.Pixbuf = pixbuf;
                image_chronopic_connect_encoder2.Pixbuf = pixbuf;
@@ -514,6 +519,7 @@ public partial class ChronoJumpWindow
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_capture.png");
                image_button_contacts_detect.Pixbuf = pixbuf;
+               image_button_encoder_detect.Pixbuf = pixbuf;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_capture_big.png");
                image_encoder_capture_execute.Pixbuf = pixbuf;
                image_button_execute.Pixbuf = pixbuf;


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