add toggle for update check

This commit is contained in:
Prohurtz 2023-01-22 19:17:37 -06:00
parent f492e3fdab
commit 2573d04ce8
3 changed files with 42 additions and 28 deletions

View File

@ -47,6 +47,7 @@ class EyeTrackSettingsConfig(BaseModel):
gui_BLOBP: int = 4
gui_skip_autoradius: bool = True
gui_thresh_add: int = 20
gui_update_check: bool = True
class EyeTrackConfig(BaseModel):
version: int = 1

View File

@ -50,7 +50,7 @@ def main():
# Check to see if we can connect to our video source first. If not, bring up camera finding
# dialog.
if config.settings.gui_update_check:
print("\033[95m[INFO] Checking for updates...\033[0m")
url = "https://raw.githubusercontent.com/RedHawk989/EyeTrackVR-Installer/master/Version-Data/Version_Num.txt"
html = urlopen(url).read()

View File

@ -39,6 +39,7 @@ class SettingsWidget:
self.gui_BLOBP = f"-BLOBP{widget_id}-"
self.gui_thresh_add = f"-THRESHADD{widget_id}-"
self.gui_update_check = f"-UPDATECHECK{widget_id}-"
self.gui_threshold_slider = f"-BLOBTHRESHOLD{widget_id}-"
self.main_config = main_config
self.config = main_config.settings
@ -88,6 +89,15 @@ class SettingsWidget:
tooltip = "Only send a blink to VRC if both eyes are closed.",
),
],
[sg.Checkbox(
"Check For Updates",
default=self.config.gui_update_check,
key=self.gui_update_check,
background_color='#424042',
tooltip = "Toggle update check on launch.",
),
],
[
sg.Text("Tracking Algorithim Settings:", background_color='#242224'),
@ -420,6 +430,9 @@ class SettingsWidget:
self.config.gui_skip_autoradius = values[self.gui_skip_autoradius]
changed = True
if self.config.gui_update_check != values[self.gui_update_check]:
self.config.gui_update_check = values[self.gui_update_check]
changed = True
if self.config.gui_BLINK != values[self.gui_BLINK]:
self.config.gui_BLINK = values[self.gui_BLINK]