Skip to content

Commit

Permalink
Merge pull request #13 from digitalf0x/ft-free-the-gees
Browse files Browse the repository at this point in the history
[Update] Switch to FreeSimpleGUI, update deps
  • Loading branch information
Z4urce authored Jul 10, 2024
2 parents b5b7702 + db77343 commit ef529d3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
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

0 comments on commit ef529d3

Please sign in to comment.