[chronojump] compujump person_logout button



commit 69b52ecc9ce9981e0b74d0717955a5131f55a10a
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Jul 7 14:00:25 2017 +0200

    compujump person_logout button

 glade/dialog_person_popup.glade             |  192 ++++++++++++++++++++-------
 images/md/ic_person_logout_blue_24dp_1x.png |  Bin 0 -> 381 bytes
 src/Makefile.am                             |    1 +
 src/gui/dialogPersonPopup.cs                |   11 ++
 src/gui/networks.cs                         |   13 ++
 5 files changed, 167 insertions(+), 50 deletions(-)
---
diff --git a/glade/dialog_person_popup.glade b/glade/dialog_person_popup.glade
index 2b4679f..5133e0c 100644
--- a/glade/dialog_person_popup.glade
+++ b/glade/dialog_person_popup.glade
@@ -32,6 +32,7 @@
                     <property name="spacing">30</property>
                     <child>
                       <widget class="GtkImage" id="image_person">
+                        <property name="height_request">300</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="stock">gtk-missing-image</property>
@@ -48,10 +49,147 @@
                         <property name="can_focus">False</property>
                         <property name="spacing">20</property>
                         <child>
-                          <widget class="GtkLabel" id="label_name">
+                          <widget class="GtkHBox" id="hbox3">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">label</property>
+                            <child>
+                              <widget class="GtkVBox" id="vbox3">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <child>
+                                  <widget class="GtkHBox" id="hbox5">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <child>
+                                      <widget class="GtkButton" id="button_close">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="can_default">True</property>
+                                        <property name="receives_default">False</property>
+                                        <signal name="clicked" handler="on_button_close_clicked" 
swapped="no"/>
+                                        <accelerator key="Escape" signal="clicked"/>
+                                        <child>
+                                          <widget class="GtkVBox" id="vbox2">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="spacing">4</property>
+                                            <child>
+                                              <widget class="GtkImage" id="image_close">
+                                                <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="label1">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">Close 
window</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">0</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkHBox" id="hbox4">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">30</property>
+                                    <child>
+                                      <widget class="GtkLabel" id="label_name">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label" translatable="yes">label</property>
+                                      </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_person_logout">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="can_default">True</property>
+                                        <property name="receives_default">False</property>
+                                        <signal name="clicked" handler="on_button_person_logout_clicked" 
swapped="no"/>
+                                        <child>
+                                          <widget class="GtkVBox" id="vbox6">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="spacing">4</property>
+                                            <child>
+                                              <widget class="GtkImage" id="image_person_logout">
+                                                <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="label2">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">Logout</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="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">True</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>
                           </widget>
                           <packing>
                             <property name="expand">True</property>
@@ -61,14 +199,13 @@
                         </child>
                         <child>
                           <widget class="GtkLabel" id="label_rfid">
-                            <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="label" translatable="yes">label</property>
                           </widget>
                           <packing>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
-                            <property name="position">1</property>
+                            <property name="position">0</property>
                           </packing>
                         </child>
                       </widget>
@@ -81,55 +218,10 @@
                   </widget>
                   <packing>
                     <property name="expand">True</property>
-                    <property name="fill">False</property>
+                    <property name="fill">True</property>
                     <property name="position">0</property>
                   </packing>
                 </child>
-                <child>
-                  <widget class="GtkVBox" id="vbox5">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <child>
-                      <widget class="GtkHButtonBox" id="hbuttonbox1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="layout_style">end</property>
-                        <child>
-                          <widget class="GtkButton" id="button_close">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="can_default">True</property>
-                            <property name="receives_default">False</property>
-                            <signal name="clicked" handler="on_button_close_clicked" swapped="no"/>
-                            <accelerator key="Escape" signal="clicked"/>
-                            <child>
-                              <widget class="GtkImage" id="image_close">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="stock">gtk-missing-image</property>
-                              </widget>
-                            </child>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</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">1</property>
-                  </packing>
-                </child>
               </widget>
               <packing>
                 <property name="expand">False</property>
diff --git a/images/md/ic_person_logout_blue_24dp_1x.png b/images/md/ic_person_logout_blue_24dp_1x.png
new file mode 100644
index 0000000..4b63672
Binary files /dev/null and b/images/md/ic_person_logout_blue_24dp_1x.png differ
diff --git a/src/Makefile.am b/src/Makefile.am
index c44de02..639fd9c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -388,6 +388,7 @@ RESOURCES = \
        ../images/md/ic_developer_board_blue_24dp_1x.png,image_chronopic_connect.png \
        ../images/md/ic_developer_board_blue_24dp_2x.png,image_chronopic_connect_big.png \
        ../images/md/ic_person_blue_24dp_1x.png,image_person.png \
+       ../images/md/ic_person_logout_blue_24dp_1x.png,image_person_logout.png \
        ../images/md/ic_cached_blue_24dp_1x.png,image_recalculate.png \
        ../images/md/ic_delete_blue_24dp_1x.png,stock_delete.png \
        ../images/md/ic_create_new_folder_blue_24dp_2x.png,folder_new_big.png \
diff --git a/src/gui/dialogPersonPopup.cs b/src/gui/dialogPersonPopup.cs
index 663c923..c060f2c 100644
--- a/src/gui/dialogPersonPopup.cs
+++ b/src/gui/dialogPersonPopup.cs
@@ -30,6 +30,7 @@ public class DialogPersonPopup
        [Widget] Gtk.Dialog dialog_person_popup;
        [Widget] Gtk.Label label_name;
        [Widget] Gtk.Image image_person;
+       [Widget] Gtk.Image image_person_logout;
        [Widget] Gtk.Image image_close;
        [Widget] Gtk.Label label_rfid;
        [Widget] Gtk.Frame frame_tasks_parametrized;
@@ -43,6 +44,7 @@ public class DialogPersonPopup
 
        private Task taskActive;
        public Button Fake_button_start_task;
+       public Button Fake_button_person_logout;
 
        public DialogPersonPopup (int personID, string name, string rfid, List<Task> tasks)
        {
@@ -60,6 +62,9 @@ public class DialogPersonPopup
                Pixbuf pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_close.png");
                image_close.Pixbuf = pixbuf;
 
+               pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_person_logout.png");
+               image_person_logout.Pixbuf = pixbuf;
+
                string photoFile = Util.GetPhotoFileName(false, personID);
                if(File.Exists(photoFile))
                {
@@ -83,6 +88,7 @@ public class DialogPersonPopup
                list_buttons_done_id = new List<int>();
                taskActive = new Task();
                Fake_button_start_task = new Gtk.Button();
+               Fake_button_person_logout = new Gtk.Button();
 
                bool task_parametrized_exist = false;
                pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "image_capture.png");
@@ -207,6 +213,11 @@ public class DialogPersonPopup
                }
        }
 
+       public void on_button_person_logout_clicked (object obj, EventArgs args)
+       {
+               Fake_button_person_logout.Click();
+       }
+
        public void on_button_close_clicked (object obj, EventArgs args)
        {
                dialog_person_popup.Destroy ();
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 6c682b8..733eaab 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -594,6 +594,9 @@ public partial class ChronoJumpWindow
 
                dialogPersonPopup.Fake_button_start_task.Clicked -= new EventHandler(compujumpTaskStart);
                dialogPersonPopup.Fake_button_start_task.Clicked += new EventHandler(compujumpTaskStart);
+
+               dialogPersonPopup.Fake_button_person_logout.Clicked -= new 
EventHandler(compujumpPersonLogout);
+               dialogPersonPopup.Fake_button_person_logout.Clicked += new 
EventHandler(compujumpPersonLogout);
        }
 
        private void compujumpTaskStart(object o, EventArgs args)
@@ -641,6 +644,16 @@ public partial class ChronoJumpWindow
                on_button_encoder_capture_clicked (new object(), new EventArgs ());
        }
 
+       private void compujumpPersonLogout(object o, EventArgs args)
+       {
+               dialogPersonPopup.Fake_button_person_logout.Clicked -= new 
EventHandler(compujumpPersonLogout);
+
+               currentPerson = null;
+               currentPersonSession = null;
+               sensitiveGuiNoPerson ();
+
+               dialogPersonPopup.DestroyDialog();
+       }
 
        /*
         *


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