def lock(self, msg=""): if not status.Active: if self.set_active(True, msg): self.stop_lock_delay() if utils.user_can_lock(): status.Locked = True else: if utils.user_can_lock(): status.Locked = True self.stage.set_message(msg)
def lock(self, msg=""): """ Initiate locking (activating first if necessary.) """ if not status.Active: if self.set_active(True, True, msg): self.stop_lock_delay() if utils.user_can_lock(): status.Locked = True else: if utils.user_can_lock(): status.Locked = True self.stage.set_message(msg)
def lock(self, msg=""): """ Initiate locking (activating first if necessary.) """ if not status.Active: if self.set_active(True, msg): self.stop_lock_delay() if utils.user_can_lock(): status.Locked = True else: if utils.user_can_lock(): status.Locked = True self.stage.set_message(msg)
def lock(self, msg=""): """ Initiate locking (activating first if necessary.) Return True if we were already active and just need to set the lock flag (or we were already locked as well). Return False if we're not active, and need to construct a stage, etc... """ if not status.Active: if self.set_active(True, True, msg): self.stop_lock_delay() if utils.user_can_lock(): status.Locked = True return False else: if utils.user_can_lock(): status.Locked = True self.stage.set_message(msg) # Return True to complete any invocation immediately because: # - we were already active and possibly already locked # - we were unable to achieve a server grab, or something else # prevents the activation from proceeding, and we don't want to # block anything...?? return True
def lock(self, msg=""): """ Initiate locking (activating first if necessary.) Return True if we were already active and just need to set the lock flag (or we were already locked as well). Return False if we're not active, and need to construct a stage, etc... """ if not status.Active: if self.set_active(True, msg): self.stop_lock_delay() if utils.user_can_lock(): status.Locked = True return False else: if utils.user_can_lock(): status.Locked = True self.stage.set_message(msg) # Return True to complete any invocation immediately because: # - we were already active and possibly already locked # - we were unable to achieve a server grab, or something else # prevents the activation from proceeding, and we don't want to # block anything...?? return True
def start_lock_delay(self): if not settings.get_idle_lock_enabled(): return if not utils.user_can_lock(): return lock_delay = settings.get_idle_lock_delay() if lock_delay == 0: self.on_lock_delay_timeout() else: trackers.timer_tracker_get().start_seconds( "idle-lock-delay", lock_delay, self.on_lock_delay_timeout)
def start_lock_delay(self): if not settings.get_idle_lock_enabled(): return if not utils.user_can_lock(): return lock_delay = settings.get_idle_lock_delay() if lock_delay == 0: self.on_lock_delay_timeout() else: trackers.timer_tracker_get().start_seconds("idle-lock-delay", lock_delay, self.on_lock_delay_timeout)
def start_lock_delay(self): """ Setup the lock delay timer based on user prefs - if there is no delay, or if idle locking isn't enabled, we run the callback immediately, or simply return, respectively. """ if not settings.get_idle_lock_enabled(): return if not utils.user_can_lock(): return lock_delay = settings.get_idle_lock_delay() if lock_delay == 0: self.on_lock_delay_timeout() else: trackers.timer_tracker_get().start_seconds( "idle-lock-delay", lock_delay, self.on_lock_delay_timeout)
def start_lock_delay(self): """ Setup the lock delay timer based on user prefs - if there is no delay, or if idle locking isn't enabled, we run the callback immediately, or simply return, respectively. """ if not settings.get_idle_lock_enabled(): return if not utils.user_can_lock(): return lock_delay = settings.get_idle_lock_delay() if lock_delay == 0: self.on_lock_delay_timeout() else: trackers.timer_tracker_get().start_seconds("idle-lock-delay", lock_delay, self.on_lock_delay_timeout)