1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-22 13:34:04 +03:00

minor fix related to grace time

This commit is contained in:
Adolfo Gómez García 2015-02-27 17:24:57 +01:00
parent d371e3f7ac
commit 4bb4987937

View File

@ -175,7 +175,6 @@ class UDSSystemTray(QtGui.QSystemTrayIcon):
self.maxIdleTime = None self.maxIdleTime = None
self.timer = QtCore.QTimer() self.timer = QtCore.QTimer()
self.timer.timeout.connect(self.checkIdle) self.timer.timeout.connect(self.checkIdle)
self.graceTimerShots = 6 # Start counting for idle after 30 seconds after login, got on windows some "instant" logout because of this
self.showIdleWarn = True self.showIdleWarn = True
if self.ipc.isAlive() is False: if self.ipc.isAlive() is False:
@ -198,13 +197,14 @@ class UDSSystemTray(QtGui.QSystemTrayIcon):
self.counter = 0 self.counter = 0
self.timer.start(5000) # Launch idle checking every 5 seconds self.timer.start(5000) # Launch idle checking every 5 seconds
self.graceTimerShots = 6 # Start counting for idle after 30 seconds after login, got on windows some "instant" logout because of idle timer not being reset??
self.ipc.start() self.ipc.start()
# If this is running, it's because he have logged in # If this is running, it's because he have logged in
self.ipc.sendLogin(operations.getCurrentUser()) self.ipc.sendLogin(operations.getCurrentUser())
def checkIdle(self): def checkIdle(self):
if self.maxIdleTime is None or self.maxIdleTime < 30: # No idle check if self.maxIdleTime is None: # No idle check
return return
if self.graceTimerShots > 0: if self.graceTimerShots > 0: