[chronojump] server dialogPersonPopup can be seen pressing a button



commit 16fa2217ebb28dd11609e9f335203b1c6859d4d8
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon May 29 11:59:27 2017 +0200

    server dialogPersonPopup can be seen pressing a button

 glade/app1.glade      |   12 ++++++++----
 src/gui/chronojump.cs |   10 +++++++++-
 src/gui/networks.cs   |   27 +++++++++++++++++++--------
 3 files changed, 36 insertions(+), 13 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 2f35c7e..ca47e3b 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1263,6 +1263,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>
@@ -3152,7 +3155,7 @@ EncoderInertialCapture</property>
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">True</property>
                                                     <property name="tooltip" 
translatable="yes">Person</property>
-                                                    <signal name="clicked" 
handler="on_button_top_person_change_clicked" swapped="no"/>
+                                                    <signal name="clicked" 
handler="on_button_top_person_clicked" swapped="no"/>
                                                     <child>
                                                       <widget class="GtkImage" id="image_person1">
                                                         <property name="visible">True</property>
@@ -3169,7 +3172,6 @@ EncoderInertialCapture</property>
                                                 </child>
                                                 <child>
                                                   <widget class="GtkLabel" id="label_rfid_contacts">
-                                                    <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
                                                   </widget>
                                                   <packing>
@@ -14485,7 +14487,7 @@ Concentric</property>
                                                     <property name="can_focus">True</property>
                                                     <property name="receives_default">True</property>
                                                     <property name="tooltip" 
translatable="yes">Person</property>
-                                                    <signal name="clicked" 
handler="on_button_top_person_change_clicked" swapped="no"/>
+                                                    <signal name="clicked" 
handler="on_button_top_person_clicked" swapped="no"/>
                                                     <child>
                                                       <widget class="GtkImage" id="image_person">
                                                         <property name="visible">True</property>
@@ -14502,7 +14504,6 @@ Concentric</property>
                                                 </child>
                                                 <child>
                                                   <widget class="GtkLabel" id="label_rfid_encoder">
-                                                    <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
                                                   </widget>
                                                   <packing>
@@ -20323,6 +20324,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 e91f29a..8abf843 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2640,8 +2640,16 @@ public partial class ChronoJumpWindow
                }
        }
 
-       private void on_button_top_person_change_clicked (object o, EventArgs args)
+       private void on_button_top_person_clicked (object o, EventArgs args)
        {
+               //if compujump show person profile at server
+               if(configChronojump.Compujump)
+               {
+                       on_button_person_popup_clicked (o, args);
+                       return;
+               }
+
+               //if not compujump show person change window
                ArrayList myPersons = SqlitePersonSession.SelectCurrentSessionPersons(
                                currentSession.UniqueID, 
                                false); //means: do not returnPersonAndPSlist
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 1161814..cd4dd06 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -91,8 +91,8 @@ public partial class ChronoJumpWindow
 
                        //on compujump cannot add/edit persons, do it from server
                        frame_persons_top.Visible = false;
-                       button_contacts_person_change.Visible = false;
-                       button_encoder_person_change.Visible = false;
+                       //button_contacts_person_change.Visible = false;
+                       //button_encoder_person_change.Visible = false;
                        //TODO: don't allow edit person on person treeview
 
                        Json.ChangeServerUrl(configChronojump.CompujumpServerURL);
@@ -425,12 +425,7 @@ public partial class ChronoJumpWindow
                        */
 
                        List<Task> tasks = json.GetTasks(currentPerson.UniqueID);
-
-                       if(dialogPersonPopup != null)
-                               dialogPersonPopup.DestroyDialog();
-
-                       dialogPersonPopup = new DialogPersonPopup(
-                                       currentPerson.UniqueID, currentPerson.Name, capturedRFID, tasks);
+                       showDialogPersonPopup(tasks);
                }
 
                updatingRFIDGuiStuff = false;
@@ -441,6 +436,22 @@ public partial class ChronoJumpWindow
                return true;
        }
 
+       private void on_button_person_popup_clicked (object o, EventArgs args)
+       {
+               Json json = new Json();
+               List<Task> tasks = json.GetTasks(currentPerson.UniqueID);
+               showDialogPersonPopup(tasks);
+       }
+
+       private void showDialogPersonPopup(List<Task> tasks)
+       {
+               if(dialogPersonPopup != null)
+                       dialogPersonPopup.DestroyDialog();
+
+               dialogPersonPopup = new DialogPersonPopup(
+                               currentPerson.UniqueID, currentPerson.Name, capturedRFID, tasks);
+       }
+
 
        /*
         *


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