[chronojump] person image small on main GUI



commit 7e883af6918ef911e2bc1524a1ff07b4c974522e
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Feb 1 18:04:55 2018 +0100

    person image small on main GUI

 glade/app1.glade           |  270 +++++++++++++++++++++++++-------------------
 src/gui/chronojump.cs      |   18 +++
 src/gui/chronojumpIcons.cs |    2 +
 src/gui/networks.cs        |    2 +
 4 files changed, 175 insertions(+), 117 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 50b158c..85bf04e 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1524,6 +1524,9 @@
                                                             <placeholder/>
                                                             </child>
                                                             <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkLabel" 
id="label_start_selector_jumps">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -2294,23 +2297,19 @@ EncoderInertialCapture</property>
                                                 <property name="can_focus">False</property>
                                                 <property name="spacing">4</property>
                                                 <child>
-                                                  <widget class="GtkVBox" id="vbox61">
+                                                  <widget class="GtkFrame" id="frame_persons_top">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
+                                                    <property name="label_xalign">0</property>
+                                                    <property name="label_yalign">1</property>
+                                                    <property name="shadow_type">none</property>
                                                     <child>
-                                                      <widget class="GtkFrame" id="frame_persons_top">
+                                                      <widget class="GtkHBox" id="hbox167">
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">False</property>
-                                                        <property name="label_xalign">0</property>
-                                                        <property name="label_yalign">1</property>
-                                                        <property name="shadow_type">in</property>
+                                                        <property name="border_width">2</property>
                                                         <child>
-                                                          <widget class="GtkHBox" id="hbox167">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="border_width">2</property>
-                                                            <child>
-                                                            <widget class="GtkVBox" id="vbox62">
+                                                          <widget class="GtkVBox" id="vbox62">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="border_width">2</property>
@@ -2349,10 +2348,67 @@ EncoderInertialCapture</property>
                                                             <widget class="GtkLabel" id="label197">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
+                                                            <property name="xalign">0</property>
                                                             <property name="label" 
translatable="yes">Persons</property>
                                                             <property name="use_markup">True</property>
                                                             </widget>
                                                             <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox91">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkButton" id="button_persons_up">
+                                                            <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">Select previous person
+&lt;Control&gt;Up</property>
+                                                            <property name="relief">half</property>
+                                                            <signal name="clicked" 
handler="on_treeview_persons_up" swapped="no"/>
+                                                            <accelerator key="Up" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
+                                                            <child>
+                                                            <widget class="GtkArrow" id="arrow_up1">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="arrow_type">up</property>
+                                                            </widget>
+                                                            </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_persons_down">
+                                                            <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">Select next person
+&lt;Control&gt;Down</property>
+                                                            <property name="relief">half</property>
+                                                            <signal name="clicked" 
handler="on_treeview_persons_down" swapped="no"/>
+                                                            <accelerator key="Down" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
+                                                            <child>
+                                                            <widget class="GtkArrow" id="arrow_down1">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="arrow_type">down</property>
+                                                            </widget>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
                                                             <property name="position">1</property>
@@ -2360,6 +2416,14 @@ EncoderInertialCapture</property>
                                                             </child>
                                                             </widget>
                                                             <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="pack_type">end</property>
+                                                            <property name="position">2</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
                                                             <property name="expand">True</property>
                                                             <property name="fill">True</property>
                                                             <property name="position">0</property>
@@ -2390,7 +2454,7 @@ EncoderInertialCapture</property>
                                                             <widget class="GtkHButtonBox" id="hbuttonbox10">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="spacing">2</property>
+                                                            <property name="spacing">6</property>
                                                             <child>
                                                             <widget class="GtkButton" 
id="button_person_add_single">
                                                             <property name="visible">True</property>
@@ -2520,7 +2584,7 @@ EncoderInertialCapture</property>
                                                             <widget class="GtkHButtonBox" id="hbuttonbox11">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="spacing">2</property>
+                                                            <property name="spacing">6</property>
                                                             <child>
                                                             <widget class="GtkButton" 
id="button_recuperate_person">
                                                             <property name="visible">True</property>
@@ -2636,26 +2700,19 @@ EncoderInertialCapture</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>
-                                                        </child>
-                                                        <child>
-                                                          <placeholder/>
                                                           <packing>
-                                                            <property name="type">label_item</property>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
                                                           </packing>
                                                         </child>
                                                       </widget>
+                                                    </child>
+                                                    <child>
+                                                      <placeholder/>
                                                       <packing>
-                                                        <property name="expand">False</property>
-                                                        <property name="fill">False</property>
-                                                        <property name="position">-1</property>
+                                                        <property name="type">label_item</property>
                                                       </packing>
                                                     </child>
                                                   </widget>
@@ -2703,107 +2760,92 @@ EncoderInertialCapture</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox91">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <child>
-                                                            <widget class="GtkButton" 
id="button_edit_current_person">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">True</property>
-                                                            <property name="receives_default">True</property>
-                                                            <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" translatable="yes">Edit 
selected person
-&lt;Control&gt;p</property>
-                                                            <property name="relief">half</property>
-                                                            <signal name="clicked" 
handler="on_edit_current_person_clicked_from_main_gui" swapped="no"/>
-                                                            <accelerator key="p" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
-                                                            <child>
-                                                            <widget class="GtkImage" 
id="image_edit_current_person">
+                                                            <widget class="GtkImage" 
id="image_current_person">
+                                                            <property name="width_request">150</property>
+                                                            <property name="height_request">150</property>
                                                             <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="expand">True</property>
+                                                            <property name="fill">True</property>
                                                             <property name="position">0</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkButton" 
id="button_show_all_person_events">
+                                                            <widget class="GtkHBox" id="hbox_rest_time">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <widget class="GtkButton" id="button_rest_show">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
-                                                            <property name="has_tooltip">True</property>
-                                                            <property name="tooltip" translatable="yes">Show 
all tests of this person</property>
-                                                            <property name="relief">half</property>
-                                                            <signal name="clicked" 
handler="on_show_all_person_events_activate" swapped="no"/>
+                                                            <property name="tooltip" 
translatable="yes">Manage rest time</property>
+                                                            <signal name="clicked" 
handler="on_button_rest_show_clicked" swapped="no"/>
                                                             <child>
-                                                            <widget class="GtkImage" 
id="image_all_persons_events">
+                                                            <widget class="GtkImage" id="image_rest">
                                                             <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="position">1</property>
+                                                            <property name="position">0</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkButton" 
id="button_delete_current_person">
-                                                            <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">Delete person</property>
-                                                            <property name="relief">half</property>
-                                                            <signal name="clicked" 
handler="on_delete_current_person_from_session_clicked" swapped="no"/>
-                                                            <child>
-                                                            <widget class="GtkImage" 
id="image_person_delete">
+                                                            <widget class="GtkLabel" id="label_rest">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="icon-size">2</property>
-                                                            </widget>
-                                                            </child>
+                                                            <property name="xalign">0</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
-                                                            <property name="position">2</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>
+                                                            <property name="position">1</property>
                                                             </packing>
                                                             </child>
-                                                            <child>
-                                                            <widget class="GtkHBox" id="hbox_rest_time">
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <widget class="GtkVBox" id="vbox117">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="spacing">2</property>
                                                             <child>
-                                                            <widget class="GtkButton" id="button_rest_show">
+                                                            <widget class="GtkButton" 
id="button_image_current_person_zoom">
                                                             <property name="visible">True</property>
+                                                            <property name="sensitive">False</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
-                                                            <property name="tooltip" 
translatable="yes">Manage rest time</property>
-                                                            <signal name="clicked" 
handler="on_button_rest_show_clicked" swapped="no"/>
+                                                            <property name="has_tooltip">True</property>
+                                                            <property name="tooltip" translatable="yes">Zoom 
image</property>
+                                                            <property name="relief">half</property>
+                                                            <signal name="clicked" 
handler="on_button_image_current_person_zoom_clicked" swapped="no"/>
+                                                            <accelerator key="p" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
                                                             <child>
-                                                            <widget class="GtkImage" id="image_rest">
+                                                            <widget class="GtkImage" 
id="image_current_person_zoom">
                                                             <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>
@@ -2814,86 +2856,77 @@ EncoderInertialCapture</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkLabel" id="label_rest">
+                                                            <widget class="GtkButton" 
id="button_edit_current_person">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <property name="has_tooltip">True</property>
+                                                            <property name="tooltip" translatable="yes">Edit 
selected person
+&lt;Control&gt;p</property>
+                                                            <property name="relief">half</property>
+                                                            <signal name="clicked" 
handler="on_edit_current_person_clicked_from_main_gui" swapped="no"/>
+                                                            <accelerator key="p" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_edit_current_person">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="xalign">0</property>
+                                                            <property 
name="stock">gtk-missing-image</property>
+                                                            <property name="icon-size">2</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">True</property>
-                                                            <property name="fill">True</property>
+                                                            <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="GtkVBox" id="vbox117">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
                                                             <child>
-                                                            <widget class="GtkButton" id="button_persons_up">
+                                                            <widget class="GtkButton" 
id="button_show_all_person_events">
                                                             <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">Select previous person
-&lt;Control&gt;Up</property>
+                                                            <property name="tooltip" translatable="yes">Show 
all tests of this person</property>
                                                             <property name="relief">half</property>
-                                                            <property name="yalign">1</property>
-                                                            <signal name="clicked" 
handler="on_treeview_persons_up" swapped="no"/>
-                                                            <accelerator key="Up" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
+                                                            <signal name="clicked" 
handler="on_show_all_person_events_activate" swapped="no"/>
                                                             <child>
-                                                            <widget class="GtkArrow" id="arrow_up1">
+                                                            <widget class="GtkImage" 
id="image_all_persons_events">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="arrow_type">up</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="position">0</property>
+                                                            <property name="position">2</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkButton" 
id="button_persons_down">
+                                                            <widget class="GtkButton" 
id="button_delete_current_person">
                                                             <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">Select next person
-&lt;Control&gt;Down</property>
+                                                            <property name="tooltip" 
translatable="yes">Delete person</property>
                                                             <property name="relief">half</property>
-                                                            <signal name="clicked" 
handler="on_treeview_persons_down" swapped="no"/>
-                                                            <accelerator key="Down" signal="clicked" 
modifiers="GDK_CONTROL_MASK"/>
+                                                            <signal name="clicked" 
handler="on_delete_current_person_from_session_clicked" swapped="no"/>
                                                             <child>
-                                                            <widget class="GtkArrow" id="arrow_down1">
+                                                            <widget class="GtkImage" 
id="image_person_delete">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="arrow_type">down</property>
+                                                            <property name="icon-size">2</property>
                                                             </widget>
                                                             </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
                                                             <property name="fill">False</property>
-                                                            <property name="position">1</property>
+                                                            <property name="position">3</property>
                                                             </packing>
                                                             </child>
                                                           </widget>
@@ -22618,6 +22651,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index a57d9b0..d9796db 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -1018,6 +1018,24 @@ public partial class ChronoJumpWindow
 
                label_top_encoder_person_name.Text = "<b>" + currentPerson.Name + "</b>";
                label_top_encoder_person_name.UseMarkup = true;
+
+               string filenameMini = Util.UserPhotoURL(true, currentPerson.UniqueID);
+               if(filenameMini != "")
+               {
+                       Pixbuf pixbuf = new Pixbuf (filenameMini);
+                       image_current_person.Pixbuf = pixbuf;
+                       button_image_current_person_zoom.Sensitive = true;
+               } else {
+                       image_current_person.Pixbuf = null;
+                       button_image_current_person_zoom.Sensitive = false;
+               }
+       }
+
+       private void on_button_image_current_person_zoom_clicked(object o, EventArgs args)
+       {
+               new DialogImageTest(currentPerson.Name,
+                               Util.UserPhotoURL(false, currentPerson.UniqueID),
+                               DialogImageTest.ArchiveType.FILE);
        }
        
        private void treeview_persons_storeReset()
diff --git a/src/gui/chronojumpIcons.cs b/src/gui/chronojumpIcons.cs
index 22299b7..8d97363 100644
--- a/src/gui/chronojumpIcons.cs
+++ b/src/gui/chronojumpIcons.cs
@@ -43,6 +43,7 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Image image_session_preferences;
        [Widget] Gtk.Image image_mode_encoder_capture;
        [Widget] Gtk.Image image_manage_persons;
+       [Widget] Gtk.Image image_current_person_zoom;
        [Widget] Gtk.Image image_person;
        [Widget] Gtk.Image image_person1;
        [Widget] Gtk.Image image_edit_current_person;
@@ -179,6 +180,7 @@ public partial class ChronoJumpWindow
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "folder_check.png");
                image_force_sensor_open_folder.Pixbuf = pixbuf;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "zoom.png");
+               image_current_person_zoom.Pixbuf = pixbuf;
                image_force_sensor_check_version.Pixbuf = pixbuf;
 
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_gravity.png");
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index fe9aaa0..2fa2226 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -54,6 +54,8 @@ public partial class ChronoJumpWindow
        [Widget] Gtk.Box hbox_top_person_encoder;
        [Widget] Gtk.Label label_top_person_name;
        [Widget] Gtk.Label label_top_encoder_person_name;
+       [Widget] Gtk.Button button_image_current_person_zoom;
+       [Widget] Gtk.Image image_current_person;
        [Widget] Gtk.Button button_contacts_person_change;
        [Widget] Gtk.Button button_encoder_person_change;
        [Widget] Gtk.VBox vbox_encoder_capture_1_or_cont;



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