[chronojump] ForceSensor bands configuration better messages and gui



commit 4f55847828931a36c29760483f740946d38f05eb
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Oct 25 12:43:21 2019 +0200

    ForceSensor bands configuration better messages and gui

 glade/force_sensor_elastic_bands.glade | 273 ++++++++++++++++++---------------
 src/gui/forceSensor.cs                 |   4 +-
 src/gui/forceSensorElasticBands.cs     |  12 +-
 3 files changed, 156 insertions(+), 133 deletions(-)
---
diff --git a/glade/force_sensor_elastic_bands.glade b/glade/force_sensor_elastic_bands.glade
index c9dc70b3..fc484dea 100644
--- a/glade/force_sensor_elastic_bands.glade
+++ b/glade/force_sensor_elastic_bands.glade
@@ -111,7 +111,7 @@
                     <property name="spacing">20</property>
                     <child>
                       <widget class="GtkButton" id="button_add_show">
-                        <property name="label" translatable="yes">Add new fixation</property>
+                        <property name="label" translatable="yes">Add new elastic band/tube</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">True</property>
@@ -173,123 +173,13 @@
                 <property name="can_focus">False</property>
                 <property name="border_width">12</property>
                 <property name="spacing">20</property>
-                <child>
-                  <widget class="GtkHBox" id="hbox4">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="spacing">30</property>
-                    <child>
-                      <widget class="GtkHBox" id="hbox6">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="spacing">20</property>
-                        <child>
-                          <widget class="GtkCheckButton" id="check_active">
-                            <property name="label" translatable="yes">Active</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="draw_indicator">True</property>
-                            <signal name="toggled" handler="on_check_active_toggled" swapped="no"/>
-                          </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_active">
-                            <property name="can_focus">False</property>
-                            <property name="spacing">6</property>
-                            <child>
-                              <widget class="GtkLabel" id="label6">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">Active units</property>
-                              </widget>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <widget class="GtkSpinButton" id="spin_active_units">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="invisible_char">●</property>
-                                <property name="primary_icon_activatable">False</property>
-                                <property name="secondary_icon_activatable">False</property>
-                                <property name="primary_icon_sensitive">True</property>
-                                <property name="secondary_icon_sensitive">True</property>
-                                <property name="adjustment">1 1 99 1 10 0</property>
-                                <property name="numeric">True</property>
-                                <signal name="value_changed" handler="on_spin_active_units_value_changed" 
swapped="no"/>
-                              </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">True</property>
-                        <property name="fill">True</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkVButtonBox" id="vbuttonbox1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="layout_style">spread</property>
-                        <child>
-                          <widget class="GtkButton" id="button_save">
-                            <property name="label">gtk-save</property>
-                            <property name="visible">True</property>
-                            <property name="sensitive">False</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">True</property>
-                            <property name="use_stock">True</property>
-                            <signal name="clicked" handler="on_button_save_clicked" swapped="no"/>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </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="GtkTable" id="table_add_edit">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="n_rows">4</property>
+                    <property name="n_rows">5</property>
                     <property name="n_columns">2</property>
-                    <property name="column_spacing">12</property>
+                    <property name="column_spacing">20</property>
                     <property name="row_spacing">8</property>
                     <child>
                       <widget class="GtkEntry" id="entry_comments">
@@ -306,8 +196,8 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="right_attach">2</property>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
+                        <property name="top_attach">4</property>
+                        <property name="bottom_attach">5</property>
                       </packing>
                     </child>
                     <child>
@@ -318,8 +208,8 @@
                         <property name="label">Comments</property>
                       </widget>
                       <packing>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
+                        <property name="top_attach">4</property>
+                        <property name="bottom_attach">5</property>
                         <property name="x_options">GTK_FILL</property>
                       </packing>
                     </child>
@@ -331,8 +221,8 @@
                         <property name="label" translatable="yes">Brand</property>
                       </widget>
                       <packing>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
                         <property name="x_options">GTK_FILL</property>
                       </packing>
                     </child>
@@ -344,8 +234,8 @@
                         <property name="label">Color</property>
                       </widget>
                       <packing>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
                         <property name="x_options">GTK_FILL</property>
                       </packing>
                     </child>
@@ -364,8 +254,8 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="right_attach">2</property>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
                       </packing>
                     </child>
                     <child>
@@ -383,8 +273,8 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="right_attach">2</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
                       </packing>
                     </child>
                     <child>
@@ -395,6 +285,8 @@
                         <property name="label" translatable="yes">Stiffness</property>
                       </widget>
                       <packing>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
                         <property name="x_options">GTK_FILL</property>
                       </packing>
                     </child>
@@ -452,11 +344,125 @@
                           <widget class="GtkLabel" id="label_stiffness_of_each_fixture">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">(of each fixture)</property>
+                            <property name="label" translatable="yes">(of each one)</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="hbox4">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">30</property>
+                        <child>
+                          <widget class="GtkHBox" id="hbox6">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="spacing">20</property>
+                            <child>
+                              <widget class="GtkHBox" id="hbox_active">
+                                <property name="can_focus">False</property>
+                                <property name="spacing">6</property>
+                                <child>
+                                  <widget class="GtkLabel" id="label6">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">Attached units</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkSpinButton" id="spin_active_units">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">●</property>
+                                    <property name="primary_icon_activatable">False</property>
+                                    <property name="secondary_icon_activatable">False</property>
+                                    <property name="primary_icon_sensitive">True</property>
+                                    <property name="secondary_icon_sensitive">True</property>
+                                    <property name="adjustment">1 1 99 1 10 0</property>
+                                    <property name="numeric">True</property>
+                                    <signal name="value_changed" 
handler="on_spin_active_units_value_changed" swapped="no"/>
+                                  </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>
                           </widget>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkButton" id="button_save">
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="border_width">8</property>
+                            <signal name="clicked" handler="on_button_save_clicked" swapped="no"/>
+                            <child>
+                              <widget class="GtkHBox" id="hbox7">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">6</property>
+                                <child>
+                                  <widget class="GtkImage" id="image_save">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="stock">gtk-missing-image</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkLabel" id="label7">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label" translatable="yes">Save</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="pack_type">end</property>
                             <property name="position">1</property>
                           </packing>
                         </child>
@@ -466,11 +472,24 @@
                         <property name="right_attach">2</property>
                       </packing>
                     </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="check_active">
+                        <property name="label" translatable="yes">Attached</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                        <signal name="toggled" handler="on_check_active_toggled" swapped="no"/>
+                      </widget>
+                      <packing>
+                        <property name="x_options">GTK_FILL</property>
+                      </packing>
+                    </child>
                   </widget>
                   <packing>
                     <property name="expand">True</property>
                     <property name="fill">True</property>
-                    <property name="position">1</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
               </widget>
diff --git a/src/gui/forceSensor.cs b/src/gui/forceSensor.cs
index be2b2a61..df20fe0e 100644
--- a/src/gui/forceSensor.cs
+++ b/src/gui/forceSensor.cs
@@ -2434,7 +2434,7 @@ LogB.Information(" fs R ");
        private void on_button_force_sensor_stiffness_clicked (object o, EventArgs args)
        {
                forceSensorElasticBandsWin = ForceSensorElasticBandsWindow.Show(
-                               Catalog.GetString("Elastic band selection"), "Elastic bands and other 
fixtures");
+                               Catalog.GetString("Stiffness configuration"), Catalog.GetString("Configure 
attached elastic bands/tubes"));
                forceSensorElasticBandsWin.FakeButton_stiffness_changed.Clicked -= new 
EventHandler(on_elastic_bands_win_stiffness_changed);
                forceSensorElasticBandsWin.FakeButton_stiffness_changed.Clicked += new 
EventHandler(on_elastic_bands_win_stiffness_changed);
        }
@@ -2447,7 +2447,7 @@ LogB.Information(" fs R ");
        private void setStiffnessButtonLabel (double stiffness)
        {
                if(stiffness <= 0)
-                       button_force_sensor_stiffness.Label = Catalog.GetString("Configure fixation");
+                       button_force_sensor_stiffness.Label = Catalog.GetString("Configure bands/tubes");
                else
                        button_force_sensor_stiffness.Label = Catalog.GetString("Stiffness:") + " " +
                                stiffness.ToString() + " N/m";
diff --git a/src/gui/forceSensorElasticBands.cs b/src/gui/forceSensorElasticBands.cs
index c69d0282..e9e56f3a 100644
--- a/src/gui/forceSensorElasticBands.cs
+++ b/src/gui/forceSensorElasticBands.cs
@@ -32,6 +32,7 @@ public class ForceSensorElasticBandsWindow
        [Widget] Gtk.Label label_header;
        //[Widget] Gtk.ScrolledWindow scrolled_window_treeview;
        [Widget] Gtk.TreeView treeview;
+       [Widget] Gtk.Image image_save;
        [Widget] Gtk.Button button_save;
        [Widget] Gtk.Button button_delete;
        [Widget] Gtk.Button button_close;
@@ -66,7 +67,10 @@ public class ForceSensorElasticBandsWindow
                Glade.XML gladeXML;
                gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "force_sensor_elastic_bands.glade", 
"force_sensor_elastic_bands", "chronojump");
                gladeXML.Autoconnect(this);
-       
+
+               Pixbuf pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "save.png");
+               image_save.Pixbuf = pixbuf;
+
                //HideOnAccept = true;
                //DestroyOnAccept = false;
                fakeButton_stiffness_changed = new Gtk.Button();
@@ -165,7 +169,7 @@ public class ForceSensorElasticBandsWindow
        {
                string [] columnsString = new string [] {
                        "ID",
-                       Catalog.GetString("Active units"),
+                       Catalog.GetString("Attached units"),
                        Catalog.GetString("Stiffness"),
                        Catalog.GetString("Brand"),
                        Catalog.GetString("Color"),
@@ -235,7 +239,7 @@ public class ForceSensorElasticBandsWindow
                {
                        currentMode = modes.EDITING;
                        button_delete.Sensitive = true;
-                       label_edit_or_add.Text = Catalog.GetString("Edit selected fixation");
+                       label_edit_or_add.Text = Catalog.GetString("Edit selected");
                        ForceSensorElasticBand fseb = getSelectedForceSensorElasticBand();
                        fill_frame(fseb);
                        frame_add_edit.Sensitive = true;
@@ -246,7 +250,7 @@ public class ForceSensorElasticBandsWindow
        {
                currentMode = modes.ADDING;
                empty_frame(); //empty all
-               label_edit_or_add.Text = Catalog.GetString("Add fixation");
+               label_edit_or_add.Text = Catalog.GetString("Add new");
                frame_add_edit.Sensitive = true;
        }
        private void on_button_save_clicked (object o, EventArgs args)


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