OpenAdaptAI / OpenAdapt

AI-First Process Automation with Large ([Language (LLMs) / Action (LAMs) / Multimodal (LMMs)] / Visual Language (VLMs)) Models
https://www.OpenAdapt.AI
MIT License
735 stars 95 forks source link

Fix tray signals #812

Closed KIRA009 closed 3 days ago

KIRA009 commented 3 days ago

What kind of change does this PR introduce? This PR fixes the issues with signals not being passed around properly on windows

Summary This PR replaces the QSocketNotifier with a QThread and a worker that uses a signal in addition to a parent/child pipe because in windows to pass data around. This additional maneouver was needed because windows wasn't triggered the activated signal of the qsocketnotifier object.

The current data flow is: child_conn -> parent_conn -> signal emit -> signal emit listener.

The signal emit listener is needed, because processing things in the Qthread object is not possible because of how Qt restricts updates from amywhere else other than the main thread. The signal emit listener is executed on the main thread, so the signal is used as a connection to send the data back to the main thread.

Checklist

How can your code be run and tested? Run the code (in development mode) in windows, and ensure that you see the notifications and the tray text changes.

Other information

abrichr commented 3 days ago

Thank you @KIRA009 ! Please address the build issues when you get a chance so we can get this merged.

Also I noticed this includes the changes from https://github.com/OpenAdaptAI/OpenAdapt/pull/810/files, which itself has outstanding comments. How do you suggest we proceed?

KIRA009 commented 3 days ago

@abrichr I have updated both this and the application logs PR. We will have to merge the other PR first, before this gets merged