Skip to content

Commit

Permalink
chat: GUI updates run from main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 committed Dec 12, 2023
1 parent feccdb7 commit 0189636
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 7 additions & 0 deletions MAVProxy/modules/mavproxy_chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ def __init__(self, mpstate):
else:
print("chat: wx support required")

# update function rapidly called by mavproxy
def idle_task(self):
# update chat window
if mp_util.has_wxpython:
if self.chat_window is not None:
self.chat_window.idle_task()

# show help on command line options
def usage(self):
return "Usage: chat <show>"
Expand Down
4 changes: 0 additions & 4 deletions MAVProxy/modules/mavproxy_chat/chat_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ def __init__(self, mpstate):
# create chat_voice_to_text object
self.chat_voice_to_text = chat_voice_to_text.chat_voice_to_text()

# run chat window in a separate thread
self.thread = Thread(target=self.idle_task)
self.thread.start()

# update function rapidly called by mavproxy
def idle_task(self):
# update chat window
Expand Down

0 comments on commit 0189636

Please sign in to comment.