[chronojump] personSelectWin close according to commit: person select window did not select person ...



commit ed6d49c3391a72231d5c984c102384c681bce1a9
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Nov 6 17:21:21 2020 +0100

    personSelectWin close according to commit: person select window did not select person ...

 src/gui/app1/chronojumpPersons.cs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/gui/app1/chronojumpPersons.cs b/src/gui/app1/chronojumpPersons.cs
index f089924c..784d5e25 100644
--- a/src/gui/app1/chronojumpPersons.cs
+++ b/src/gui/app1/chronojumpPersons.cs
@@ -418,7 +418,7 @@ public partial class ChronoJumpWindow
                personSelectWin.FakeButtonEditPerson.Clicked += new 
EventHandler(on_button_top_person_edit_person);
                personSelectWin.FakeButtonPersonShowAllEvents.Clicked += new 
EventHandler(on_button_top_person_show_all_events);
                personSelectWin.FakeButtonDeletePerson.Clicked += new 
EventHandler(on_button_top_person_delete_person);
-               personSelectWin.FakeButtonDone.Clicked += new EventHandler(on_button_top_person_change_done);
+               personSelectWin.FakeButtonDone.Clicked += new EventHandler(on_button_top_person_change_done); 
//on window close, and on double click (it also closes the window)
        }
        private void on_button_top_person_add_person(object o, EventArgs args)
        {
@@ -480,6 +480,12 @@ public partial class ChronoJumpWindow
        }
        private void on_button_top_person_change_done(object o, EventArgs args)
        {
+               if(personSelectWin.SelectedPerson == null)
+                       return;
+
+               if(currentPerson.UniqueID == personSelectWin.SelectedPerson.UniqueID)
+                       return;
+
                currentPerson = personSelectWin.SelectedPerson; 
                currentPersonSession = SqlitePersonSession.Select(currentPerson.UniqueID, 
currentSession.UniqueID);
                label_person_change();


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