Skip to content

Commit 2b17030

Browse files
committed
Prepare task UI and logging updates
1 parent 1207b76 commit 2b17030

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

ok/device/interaction_methods/post_message.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ def update_mouse_pos(self, x, y, activate=True):
224224
except Exception as e:
225225
class_name = f'<class error: {e}>'
226226
hwnd_descriptions.append(f'{index}:{candidate}({class_name})')
227-
logger.debug(
228-
f'hwnd_window hwnds hwnd={self.hwnd_window.hwnd} top_hwnd={self.hwnd_window.top_hwnd}: {hwnd_descriptions}')
229-
logger.debug(
230-
f'mouse_pos dynamically aimed at {target_hwnd} ({win32gui.GetClassName(target_hwnd)}): {local_x}, {local_y}')
227+
# logger.debug(
228+
# f'hwnd_window hwnds hwnd={self.hwnd_window.hwnd} top_hwnd={self.hwnd_window.top_hwnd}: {hwnd_descriptions}')
229+
# logger.debug(
230+
# f'mouse_pos dynamically aimed at {target_hwnd} ({win32gui.GetClassName(target_hwnd)}): {local_x}, {local_y}')
231231
return win32api.MAKELONG(local_x, local_y)
232232

233233
except Exception as e:

ok/gui/MainWindow.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ def __init__(self, app, config, ok_config, icon, title, version, debug=False, ab
110110
visible_onetime_tasks = [task for task in self.executor.onetime_tasks if getattr(task, 'visible', True)]
111111
visible_trigger_tasks = [task for task in self.executor.trigger_tasks if getattr(task, 'visible', True)]
112112

113+
if len(visible_trigger_tasks) > 0:
114+
from ok.gui.tasks.TriggerTaskTab import TriggerTaskTab
115+
self.trigger_tab = TriggerTaskTab()
116+
if self.first_task_tab is None:
117+
self.first_task_tab = self.trigger_tab
118+
self.addSubInterface(self.trigger_tab, FluentIcon.STOP_WATCH, self.tr('Triggers'))
119+
113120
if visible_onetime_tasks:
114121
from ok.gui.tasks.OneTimeTaskTab import OneTimeTaskTab
115122
from collections import defaultdict
@@ -139,13 +146,6 @@ def __init__(self, app, config, ok_config, icon, title, version, debug=False, ab
139146
self.addSubInterface(group_tab, group_icon, self.app.tr(group_name))
140147
self.grouped_task_tabs.append(group_tab)
141148

142-
if len(visible_trigger_tasks) > 0:
143-
from ok.gui.tasks.TriggerTaskTab import TriggerTaskTab
144-
self.trigger_tab = TriggerTaskTab()
145-
if self.first_task_tab is None:
146-
self.first_task_tab = self.trigger_tab
147-
self.addSubInterface(self.trigger_tab, FluentIcon.ROBOT, self.tr('Triggers'))
148-
149149
# Add custom tabs that should appear after built-in task tabs
150150
for tab_obj in after_custom_tabs:
151151
self.addSubInterface(tab_obj, tab_obj.icon, tab_obj.name, position=tab_obj.position)

ok/task/TaskExecutor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def sleep(self, timeout: float):
306306
task.sleep_check()
307307
self.reset_scene()
308308
except Exception as e:
309-
logger.error(f"sleep_check error {task}", e)
309+
logger.info(f"sleep_check error {task}")
310310
raise
311311
finally:
312312
task.last_sleep_check_time = time.time()

0 commit comments

Comments
 (0)