mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
clockify module again check for running timer
This commit is contained in:
parent
4db427dcaf
commit
82a945aac4
1 changed files with 9 additions and 6 deletions
|
|
@ -1,4 +1,3 @@
|
||||||
import os
|
|
||||||
import threading
|
import threading
|
||||||
from app import style
|
from app import style
|
||||||
from app.vendor.Qt import QtWidgets
|
from app.vendor.Qt import QtWidgets
|
||||||
|
|
@ -12,6 +11,7 @@ class ClockifyModule:
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.clockapi = ClockifyAPI()
|
self.clockapi = ClockifyAPI()
|
||||||
self.widget_settings = ClockifySettings(main_parent, self)
|
self.widget_settings = ClockifySettings(main_parent, self)
|
||||||
|
self.widget_settings_required = None
|
||||||
|
|
||||||
self.thread_timer_check = None
|
self.thread_timer_check = None
|
||||||
# Bools
|
# Bools
|
||||||
|
|
@ -31,16 +31,12 @@ class ClockifyModule:
|
||||||
if self.bool_workspace_set is False:
|
if self.bool_workspace_set is False:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.bool_thread_check_running = True
|
|
||||||
self.start_timer_check()
|
self.start_timer_check()
|
||||||
|
|
||||||
self.set_menu_visibility()
|
self.set_menu_visibility()
|
||||||
|
|
||||||
def change_timer_run(self, bool_run):
|
|
||||||
self.bool_timer_run = bool_run
|
|
||||||
self.set_menu_visibility()
|
|
||||||
|
|
||||||
def start_timer_check(self):
|
def start_timer_check(self):
|
||||||
|
self.bool_thread_check_running = True
|
||||||
if self.thread_timer_check is None:
|
if self.thread_timer_check is None:
|
||||||
self.thread_timer_check = threading.Thread(
|
self.thread_timer_check = threading.Thread(
|
||||||
target=self.check_running
|
target=self.check_running
|
||||||
|
|
@ -48,6 +44,12 @@ class ClockifyModule:
|
||||||
self.thread_timer_check.daemon = True
|
self.thread_timer_check.daemon = True
|
||||||
self.thread_timer_check.start()
|
self.thread_timer_check.start()
|
||||||
|
|
||||||
|
def stop_timer_check(self):
|
||||||
|
self.bool_thread_check_running = True
|
||||||
|
if self.thread_timer_check is not None:
|
||||||
|
self.thread_timer_check.join()
|
||||||
|
self.thread_timer_check = None
|
||||||
|
|
||||||
def check_running(self):
|
def check_running(self):
|
||||||
import time
|
import time
|
||||||
while self.bool_thread_check_running is True:
|
while self.bool_thread_check_running is True:
|
||||||
|
|
@ -60,6 +62,7 @@ class ClockifyModule:
|
||||||
|
|
||||||
def stop_timer(self):
|
def stop_timer(self):
|
||||||
self.clockapi.finish_time_entry()
|
self.clockapi.finish_time_entry()
|
||||||
|
self.bool_timer_run = False
|
||||||
|
|
||||||
# Definition of Tray menu
|
# Definition of Tray menu
|
||||||
def tray_menu(self, parent):
|
def tray_menu(self, parent):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue