[chronojump] Fixed: 776621 Text trimmed in Threshold window. labels -> textviews



commit 2b7320a45d08bf2dab2d98be962fd66bc4982159
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Dec 30 20:31:02 2016 +0100

    Fixed: 776621 Text trimmed in Threshold window. labels -> textviews

 glade/dialog_threshold.glade |  211 +++++++++---------------------------------
 po/POTFILES.in               |    1 +
 src/gui/dialogThreshold.cs   |   39 ++++++++
 3 files changed, 84 insertions(+), 167 deletions(-)
---
diff --git a/glade/dialog_threshold.glade b/glade/dialog_threshold.glade
index f35511a..e5585c3 100644
--- a/glade/dialog_threshold.glade
+++ b/glade/dialog_threshold.glade
@@ -3,6 +3,7 @@
   <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-naming-policy toplevel-contextual -->
   <widget class="GtkDialog" id="dialog_threshold">
+    <property name="width_request">600</property>
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="border_width">10</property>
@@ -41,7 +42,7 @@
           </widget>
           <packing>
             <property name="expand">False</property>
-            <property name="fill">True</property>
+            <property name="fill">False</property>
             <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
@@ -52,14 +53,14 @@
             <property name="can_focus">False</property>
             <property name="spacing">20</property>
             <child>
-              <widget class="GtkFrame" id="frame1">
+              <widget class="GtkFrame" id="frame2">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label_xalign">0</property>
                 <property name="label_yalign">0.69999998807907104</property>
                 <property name="shadow_type">out</property>
                 <child>
-                  <widget class="GtkAlignment" id="alignment1">
+                  <widget class="GtkAlignment" id="alignment2">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="top_padding">10</property>
@@ -67,77 +68,26 @@
                     <property name="left_padding">10</property>
                     <property name="right_padding">10</property>
                     <child>
-                      <widget class="GtkVBox" id="vbox1">
+                      <widget class="GtkScrolledWindow" id="scrolledwindow5">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="spacing">6</property>
-                        <child>
-                          <widget class="GtkLabel" id="label2">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Spurius signals are common on 
electronics.</property>
-                            <property name="width_chars">100</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="label3">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Threshold refers to the minimum value 
measurable and is the common way to clean this spurius signals. Threshold should be a value lower than 
expected values.</property>
-                            <property name="wrap">True</property>
-                            <property name="width_chars">100</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <widget class="GtkLabel" id="label4">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">On database three different thresholds 
are stored: jumps, races and other tests.
-If you change this values they will be stored once test is executed.</property>
-                            <property name="wrap">True</property>
-                            <property name="ellipsize">middle</property>
-                            <property name="width_chars">100</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
+                        <property name="can_focus">True</property>
+                        <property name="hscrollbar_policy">automatic</property>
+                        <property name="vscrollbar_policy">never</property>
                         <child>
-                          <widget class="GtkLabel" id="label5">
+                          <widget class="GtkTextView" id="textview_about">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="xalign">0</property>
-                            <property name="label" translatable="yes">Usually threshold values should not be 
changed but this option is useful for special cases.</property>
-                            <property name="wrap">True</property>
-                            <property name="width_chars">100</property>
+                            <property name="can_focus">True</property>
+                            <property name="border_width">2</property>
+                            <property name="editable">False</property>
+                            <property name="cursor_visible">False</property>
                           </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">3</property>
-                          </packing>
                         </child>
                       </widget>
                     </child>
                   </widget>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="label1">
+                  <widget class="GtkLabel" id="label23">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">&lt;b&gt;About threshold&lt;/b&gt;</property>
@@ -159,58 +109,24 @@ If you change this values they will be stored once test is executed.</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <child>
-                  <widget class="GtkVBox" id="vbox2">
+                  <widget class="GtkScrolledWindow" id="scrolledwindow6">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="border_width">10</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <widget class="GtkLabel" id="label9">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Default value: 50 ms</property>
-                        <property name="width_chars">100</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="label10">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">On jumps with contact platforms a value of 
50 ms (3 cm jump approximately) is enough to solve electronical problems.</property>
-                        <property name="width_chars">100</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
+                    <property name="can_focus">True</property>
+                    <property name="border_width">6</property>
+                    <property name="hscrollbar_policy">automatic</property>
+                    <property name="vscrollbar_policy">never</property>
                     <child>
-                      <widget class="GtkLabel" id="label11">
+                      <widget class="GtkTextView" id="textview_jumps">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">You may change this value if you have a 
jumper that looses pressure with the platform
-while going down on the eccentric phase previous to a CMJ or ABK jump.
-This jumper should change his technique, but if it's difficult, a solution is to increase 
threshold.</property>
+                        <property name="can_focus">True</property>
+                        <property name="editable">False</property>
+                        <property name="cursor_visible">False</property>
                       </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">2</property>
-                      </packing>
                     </child>
                   </widget>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="label6">
+                  <widget class="GtkLabel" id="label21">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Jumps</property>
@@ -221,39 +137,19 @@ This jumper should change his technique, but if it's difficult, a solution is to
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkVBox" id="vbox3">
+                  <widget class="GtkScrolledWindow" id="scrolledwindow7">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="border_width">10</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <widget class="GtkLabel" id="label12">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Default value: 10 ms</property>
-                        <property name="width_chars">100</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
+                    <property name="can_focus">True</property>
+                    <property name="border_width">6</property>
+                    <property name="hscrollbar_policy">automatic</property>
+                    <property name="vscrollbar_policy">never</property>
                     <child>
-                      <widget class="GtkLabel" id="label13">
+                      <widget class="GtkTextView" id="textview_races">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">On races with photocells a value of 10 ms 
is the default value.
-As Chronojump manages double contacts on photocells, changing threshold value is not very common.</property>
-                        <property name="width_chars">100</property>
+                        <property name="can_focus">True</property>
+                        <property name="editable">False</property>
+                        <property name="cursor_visible">False</property>
                       </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
                     </child>
                   </widget>
                   <packing>
@@ -261,7 +157,7 @@ As Chronojump manages double contacts on photocells, changing threshold value is
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="label7">
+                  <widget class="GtkLabel" id="label26">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Races</property>
@@ -273,38 +169,19 @@ As Chronojump manages double contacts on photocells, changing threshold value is
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkVBox" id="vbox4">
+                  <widget class="GtkScrolledWindow" id="scrolledwindow8">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="border_width">10</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <widget class="GtkLabel" id="label14">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Default value: 50 ms</property>
-                        <property name="width_chars">100</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
+                    <property name="can_focus">True</property>
+                    <property name="border_width">6</property>
+                    <property name="hscrollbar_policy">automatic</property>
+                    <property name="vscrollbar_policy">never</property>
                     <child>
-                      <widget class="GtkLabel" id="label15">
+                      <widget class="GtkTextView" id="textview_other">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Depending on the test, user could change 
values.</property>
-                        <property name="width_chars">100</property>
+                        <property name="can_focus">True</property>
+                        <property name="editable">False</property>
+                        <property name="cursor_visible">False</property>
                       </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
                     </child>
                   </widget>
                   <packing>
@@ -312,7 +189,7 @@ As Chronojump manages double contacts on photocells, changing threshold value is
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="label8">
+                  <widget class="GtkLabel" id="label29">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="label" translatable="yes">Other tests</property>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f1764c2..d1aba37 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -62,6 +62,7 @@ src/gui/chronojump.cs
 src/gui/chronopic.cs
 src/gui/chronopicRegister.cs
 src/gui/convertWeight.cs
+src/gui/dialogThreshold.cs
 src/gui/encoderConfiguration.cs
 src/gui/encoder.cs
 src/gui/encoderOverview.cs
diff --git a/src/gui/dialogThreshold.cs b/src/gui/dialogThreshold.cs
index bd76fc3..8b77e83 100644
--- a/src/gui/dialogThreshold.cs
+++ b/src/gui/dialogThreshold.cs
@@ -22,11 +22,16 @@ using System;
 using Gtk;
 using Gdk;
 using Glade;
+using Mono.Unix;
 
 public class DialogThreshold
 {
        [Widget] Gtk.Dialog dialog_threshold;
        [Widget] Gtk.Notebook notebook;
+       [Widget] Gtk.TextView textview_about;
+       [Widget] Gtk.TextView textview_jumps;
+       [Widget] Gtk.TextView textview_races;
+       [Widget] Gtk.TextView textview_other;
 
        public DialogThreshold (Constants.Menuitem_modes m)
        {
@@ -37,6 +42,8 @@ public class DialogThreshold
                //put an icon to window
                UtilGtk.IconWindow(dialog_threshold);
 
+               writeTexts();
+
                if(m == Constants.Menuitem_modes.JUMPSSIMPLE || m == Constants.Menuitem_modes.JUMPSREACTIVE)
                        notebook.CurrentPage = 0;
                 else if(m == Constants.Menuitem_modes.RUNSSIMPLE || m == 
Constants.Menuitem_modes.RUNSINTERVALLIC)
@@ -45,6 +52,38 @@ public class DialogThreshold
                        notebook.CurrentPage = 2;
        }
 
+       private void writeTexts()
+       {
+               TextBuffer tb_about = new TextBuffer (new TextTagTable());
+               tb_about.Text =  Catalog.GetString("Spurius signals are common on electronics.") +
+                       "\n\n" + Catalog.GetString("Threshold refers to the minimum value measurable and is 
the common way to clean this spurius signals.") +
+                       "\n"   + Catalog.GetString("Threshold should be a value lower than expected values.") 
+
+
+                       "\n\n" + Catalog.GetString("On database three different thresholds are stored: jumps, 
races and other tests.") +
+                       "\n"  +  Catalog.GetString("If you change this values they will be stored once test 
is executed.") +
+
+                       "\n\n" + Catalog.GetString("Usually threshold values should not be changed but this 
option is useful for special cases.");
+               textview_about.Buffer = tb_about;
+
+               TextBuffer tb_jumps = new TextBuffer (new TextTagTable());
+               tb_jumps.Text =  Catalog.GetString("Default value: 50 ms.") +
+                       "\n\n" + Catalog.GetString("On jumps with contact platforms a value of 50 ms (3 cm 
jump approximately) is enough to solve electronical problems.") +
+                       "\n\n" + Catalog.GetString("You may change this value if you have a jumper that 
looses pressure with the platform while going down on the eccentric phase previous to a CMJ or ABK jump.") +
+                       "\n" +   Catalog.GetString("This jumper should change his technique, but if it's 
difficult, a solution is to increase threshold.");
+               textview_jumps.Buffer = tb_jumps;
+
+               TextBuffer tb_races = new TextBuffer (new TextTagTable());
+               tb_races.Text =  Catalog.GetString("Default value: 10 ms.") +
+                       "\n\n" + Catalog.GetString("On races with photocells a value of 10 ms is the default 
value.") +
+                       "\n\n" + Catalog.GetString("As Chronojump manages double contacts on photocells, 
changing threshold value is not very common.");
+               textview_races.Buffer = tb_races;
+
+               TextBuffer tb_other = new TextBuffer (new TextTagTable());
+               tb_other.Text =  Catalog.GetString("Default value: 50 ms.") +
+                       "\n\n" + Catalog.GetString("Depending on the test, user could change values.");
+               textview_other.Buffer = tb_other;
+       }
+
        public void on_button_close_clicked (object obj, EventArgs args) {
                dialog_threshold.Destroy ();
        }


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