[chronojump] compujump person autologout at 3'
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] compujump person autologout at 3'
- Date: Fri, 7 Jul 2017 15:02:40 +0000 (UTC)
commit b5c07480dc4faf728205d5d7d4f60d87517cbf08
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Jul 7 16:47:49 2017 +0200
compujump person autologout at 3'
src/gui/chronojump.cs | 6 ++++++
src/gui/networks.cs | 4 ++++
src/restTime.cs | 16 +++++++++++++++-
3 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 2188906..9d44d16 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -4039,6 +4039,12 @@ public partial class ChronoJumpWindow
myTreeViewPersons.UpdateRestTimes(restTime);
+ if( configChronojump.Compujump && currentPerson != null &&
+ restTime.CompujumpPersonNeedLogout(currentPerson.UniqueID) )
+ {
+ compujumpPersonLogoutDo();
+ }
+
return true;
}
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 733eaab..dfdd765 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -646,6 +646,10 @@ public partial class ChronoJumpWindow
private void compujumpPersonLogout(object o, EventArgs args)
{
+ compujumpPersonLogoutDo();
+ }
+ private void compujumpPersonLogoutDo()
+ {
dialogPersonPopup.Fake_button_person_logout.Clicked -= new
EventHandler(compujumpPersonLogout);
currentPerson = null;
diff --git a/src/restTime.cs b/src/restTime.cs
index 03927a9..43815ed 100644
--- a/src/restTime.cs
+++ b/src/restTime.cs
@@ -107,7 +107,21 @@ public class RestTime
return "";
}
-
+
+ public bool CompujumpPersonNeedLogout(int personID)
+ {
+ foreach(LastTestTime ltt in list)
+ if(ltt.PersonID == personID)
+ {
+ if(LastTestTime.GetSeconds(ltt.RestedTime) > 180) //3 min
+ return true;
+ else
+ return false;
+ }
+
+ return false;
+ }
+
public void AddOrModify(int personID, bool print)
{
if(exists(personID))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]