[chronojump] Networks encoder/rfid problem centered and usable for other sensors



commit 9613943a83ab73dd2524a3e64287252b6be4c848
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jan 30 13:27:41 2020 +0100

    Networks encoder/rfid problem centered and usable for other sensors

 glade/app1.glade      | 479 ++++++++++++++++++++++++++++++++++++--------------
 src/gui/app1/icons.cs |   6 +
 src/gui/networks.cs   |  18 +-
 3 files changed, 371 insertions(+), 132 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 8f8b5486..648cc1a4 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -23112,6 +23112,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -23885,120 +23888,6 @@ Concentric</property>
                                                     <property name="position">2</property>
                                                   </packing>
                                                 </child>
-                                                <child>
-                                                  <widget class="GtkVBox" id="vbox108">
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">False</property>
-                                                    <property name="spacing">4</property>
-                                                    <child>
-                                                      <widget class="GtkHBox" id="hbox_encoder_disconnected">
-                                                        <property name="can_focus">False</property>
-                                                        <child>
-                                                          <widget class="GtkImage" 
id="image_encoder_disconnected">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="stock">gtk-no</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_chronopic_disconnected">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="xpad">5</property>
-                                                            <property name="label" 
translatable="yes">Encoder disconnected.</property>
-                                                            <property name="use_markup">True</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="GtkHBox" id="hbox_RFID_disconnected">
-                                                        <property name="can_focus">False</property>
-                                                        <child>
-                                                          <widget class="GtkImage" 
id="image_RFID_disconnected">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="stock">gtk-no</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="GtkVBox" id="vbox110">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="spacing">2</property>
-                                                            <child>
-                                                            <widget class="GtkLabel" 
id="label_RFID_disconnected">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="xalign">0</property>
-                                                            <property name="xpad">5</property>
-                                                            <property name="label" translatable="yes">RFID 
has been disconnected!</property>
-                                                            <property name="use_markup">True</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_RFID_disconnected1">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="xalign">0</property>
-                                                            <property name="xpad">5</property>
-                                                            <property name="label" 
translatable="yes">Please, connect it and restart Chronojump.</property>
-                                                            <property name="use_markup">True</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">1</property>
-                                                          </packing>
-                                                        </child>
-                                                      </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">True</property>
-                                                    <property name="position">3</property>
-                                                  </packing>
-                                                </child>
                                                 <child>
                                                   <widget class="GtkLabel" id="label_rfid_encoder_wait">
                                                     <property name="can_focus">False</property>
@@ -24007,7 +23896,7 @@ Concentric</property>
                                                   <packing>
                                                     <property name="expand">True</property>
                                                     <property name="fill">True</property>
-                                                    <property name="position">4</property>
+                                                    <property name="position">3</property>
                                                   </packing>
                                                 </child>
                                                 <child>
@@ -24147,7 +24036,7 @@ Concentric</property>
                                                   <packing>
                                                     <property name="expand">True</property>
                                                     <property name="fill">True</property>
-                                                    <property name="position">5</property>
+                                                    <property name="position">4</property>
                                                   </packing>
                                                 </child>
                                               </widget>
@@ -24215,7 +24104,7 @@ Concentric</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkButton" 
id="button_preferences_not_menu_minimize1">
+                                                  <widget class="GtkButton" id="button_not_menu_minimize1">
                                                     <property name="width_request">50</property>
                                                     <property name="can_focus">True</property>
                                                     <property name="can_default">True</property>
@@ -24239,7 +24128,7 @@ Concentric</property>
                                                   </packing>
                                                 </child>
                                                 <child>
-                                                  <widget class="GtkButton" 
id="button_preferences_not_menu_quit">
+                                                  <widget class="GtkButton" id="button_not_menu_quit">
                                                     <property name="width_request">50</property>
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">True</property>
@@ -25497,6 +25386,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>
@@ -25533,18 +25434,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>
@@ -32811,6 +32700,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -33908,6 +33800,333 @@ then click this button.</property>
                 <property name="type">tab</property>
               </packing>
             </child>
+            <child>
+              <widget class="GtkVBox" id="vbox108">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="spacing">4</property>
+                <child>
+                  <widget class="GtkHBox" id="hbox354">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">20</property>
+                    <child>
+                      <widget class="GtkButton" id="button_not_menu_networks_problems_quit">
+                        <property name="width_request">50</property>
+                        <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">Quit</property>
+                        <property name="relief">half</property>
+                        <signal name="clicked" handler="on_quit1_activate" swapped="no"/>
+                        <child>
+                          <widget class="GtkImage" id="image_quit3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="stock">gtk-missing-image</property>
+                          </widget>
+                        </child>
+                      </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="GtkButton" id="button_not_menu_networks_problems_preferences">
+                        <property name="width_request">50</property>
+                        <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">Preferences</property>
+                        <property name="relief">half</property>
+                        <signal name="clicked" handler="on_preferences_activate" swapped="no"/>
+                        <child>
+                          <widget class="GtkImage" id="image_settings2">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="stock">gtk-missing-image</property>
+                            <property name="icon-size">2</property>
+                          </widget>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="pack_type">end</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="GtkFrame" id="frame8">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <widget class="GtkVBox" id="vbox110">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <widget class="GtkHBox" id="hbox355">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <widget class="GtkButton" 
id="button_activate_chronopics_encoder_networks_problems">
+                                <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">Connect encoder</property>
+                                <property name="relief">half</property>
+                                <signal name="clicked" handler="on_chronopic_encoder_clicked" swapped="no"/>
+                                <child>
+                                  <widget class="GtkHBox" id="hbox356">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">6</property>
+                                    <child>
+                                      <widget class="GtkLabel" id="label435">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label" translatable="yes">Device</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkImage" id="image_chronopic_connect_encoder1">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="stock">gtk-missing-image</property>
+                                        <property name="icon-size">2</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">False</property>
+                                <property name="fill">False</property>
+                                <property name="padding">12</property>
+                                <property name="pack_type">end</property>
+                                <property name="position">0</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="GtkHBox" id="hbox353">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <widget class="GtkVBox" id="vbox166">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <child>
+                                  <widget class="GtkFrame" id="frame10">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label_xalign">0</property>
+                                    <property name="shadow_type">none</property>
+                                    <child>
+                                      <widget class="GtkVBox" id="vbox167">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="border_width">20</property>
+                                        <property name="spacing">20</property>
+                                        <child>
+                                          <widget class="GtkHBox" id="hbox_encoder_disconnected">
+                                            <property name="can_focus">False</property>
+                                            <property name="spacing">30</property>
+                                            <child>
+                                              <widget class="GtkImage" id="image_encoder_disconnected">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="stock">gtk-no</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_chronopic_disconnected">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="xpad">5</property>
+                                                <property name="label" translatable="yes">Encoder 
disconnected.</property>
+                                                <property name="use_markup">True</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="GtkHBox" id="hbox_RFID_disconnected">
+                                            <property name="can_focus">False</property>
+                                            <property name="spacing">30</property>
+                                            <child>
+                                              <widget class="GtkImage" id="image_RFID_disconnected">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="stock">gtk-no</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="GtkVBox" id="vbox168">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="spacing">8</property>
+                                                <child>
+                                                  <widget class="GtkLabel" id="label_RFID_disconnected">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="xalign">0</property>
+                                                    <property name="xpad">5</property>
+                                                    <property name="label" translatable="yes">RFID has been 
disconnected!</property>
+                                                    <property name="use_markup">True</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_RFID_disconnected1">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="xalign">0</property>
+                                                    <property name="xpad">5</property>
+                                                    <property name="label" translatable="yes">Please, 
connect it and restart Chronojump.</property>
+                                                    <property name="use_markup">True</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">1</property>
+                                              </packing>
+                                            </child>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                    </child>
+                                    <child>
+                                      <placeholder/>
+                                      <packing>
+                                        <property name="type">label_item</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                          </widget>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <placeholder/>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label434">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label">networks problems</property>
+              </widget>
+              <packing>
+                <property name="position">3</property>
+                <property name="tab_fill">False</property>
+                <property name="type">tab</property>
+              </packing>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index af3e5520..b3e0c96d 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -31,11 +31,13 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_home1;
        [Widget] Gtk.Image image_settings;
        [Widget] Gtk.Image image_settings1;
+       [Widget] Gtk.Image image_settings2;
        [Widget] Gtk.Image image_minimize;
        [Widget] Gtk.Image image_minimize1;
        [Widget] Gtk.Image image_quit;
        [Widget] Gtk.Image image_quit1;
        [Widget] Gtk.Image image_quit2;
+       [Widget] Gtk.Image image_quit3;
        [Widget] Gtk.Image image_quit_from_app1;
        [Widget] Gtk.Image image_session_new;
        [Widget] Gtk.Image image_session_new2;
@@ -64,6 +66,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_person_delete_h;
        [Widget] Gtk.Image image_chronopic_connect_contacts;
        [Widget] Gtk.Image image_chronopic_connect_encoder;
+       [Widget] Gtk.Image image_chronopic_connect_encoder1;
        [Widget] Gtk.Image image_button_execute;
        [Widget] Gtk.Image image_contacts_bell;
        [Widget] Gtk.Image image_contacts_close_and_capture;
@@ -250,6 +253,7 @@ public partial class ChronoJumpWindow
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_settings.png");
                image_settings.Pixbuf = pixbuf;
                image_settings1.Pixbuf = pixbuf;
+               image_settings2.Pixbuf = pixbuf;
                image_session_preferences.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_minimize.png");
@@ -260,6 +264,7 @@ public partial class ChronoJumpWindow
                image_quit.Pixbuf = pixbuf;
                image_quit1.Pixbuf = pixbuf;
                image_quit2.Pixbuf = pixbuf;
+               image_quit3.Pixbuf = pixbuf;
                image_quit_from_app1.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_warning_red.png");
@@ -367,6 +372,7 @@ public partial class ChronoJumpWindow
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_chronopic_connect.png");
                image_chronopic_connect_contacts.Pixbuf = pixbuf;
                image_chronopic_connect_encoder.Pixbuf = pixbuf;
+               image_chronopic_connect_encoder1.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_recalculate.png");
                image_recalculate.Pixbuf = pixbuf;
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 4126ea4d..7eac0160 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -1042,12 +1042,26 @@ public partial class ChronoJumpWindow
 
        private void networksShowDeviceMissingEncoder (bool missing)
        {
-               hbox_encoder_disconnected.Visible = missing;
+               if(missing) {
+                       hbox_encoder_disconnected.Visible = true;
+                       notebook_start.CurrentPage = 3; //networks problems
+               }
+               else {
+                       hbox_encoder_disconnected.Visible = false;
+                       notebook_start.CurrentPage = 1; //program
+               }
        }
 
        private void networksShowDeviceMissingRFID (bool missing)
        {
-               hbox_RFID_disconnected.Visible = missing;
+               if(missing) {
+                       hbox_RFID_disconnected.Visible = true;
+                       notebook_start.CurrentPage = 3; //networks problems
+               }
+               else {
+                       hbox_RFID_disconnected.Visible = false;
+                       notebook_start.CurrentPage = 1; //program
+               }
        }
 
        /*



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