Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Update] Switch to FreeSimpleGUI, update deps #13

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions BridgeApp/app_gui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PySimpleGUI as sg
import FreeSimpleGUI as sg
import webbrowser

from app_config import AppConfig, PatternConfig
Expand Down Expand Up @@ -39,6 +39,7 @@ def __init__(self, app_config: AppConfig, tracker_test_event, restart_osc_event,
self.restart_osc_event = restart_osc_event
self.refresh_trackers_event = refresh_trackers_event
self.config = app_config
self.shutting_down = False
self.window = None
self.trackers = []
self.osc_status_bar = sg.Text('', key=KEY_OSC_STATUS_BAR)
Expand Down Expand Up @@ -165,10 +166,11 @@ def update_osc_status_bar(self, message, is_error=False):
self.osc_status_bar.DisplayText = message
self.osc_status_bar.TextColor = text_color
return
try:
self.osc_status_bar.update(message, text_color=text_color)
except Exception as e:
print("[GUI] Failed to update server status bar.")
if not self.shutting_down:
try:
self.osc_status_bar.update(message, text_color=text_color)
except Exception as e:
print("[GUI] Failed to update server status bar.")

def run(self):
if self.window is None:
Expand All @@ -181,6 +183,7 @@ def run(self):

# React to Event
if event == sg.WIN_CLOSED or event == 'Exit': # if user closes window or clicks cancel
self.shutting_down = True
print("[GUI] Closing application.")
return False
if event[0] == KEY_BTN_TEST:
Expand Down
12 changes: 6 additions & 6 deletions BridgeApp/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pysimplegui==4.60.5
openvr==1.26.701
pydantic==2.5.3
pyserial==3.5
python-osc==1.8.3
websockets==12.0
freesimplegui~=5.1.0
openvr~=1.26.701
pydantic~=2.8.0
pyserial~=3.5
python-osc~=1.8.3
websockets~=12.0