Skip to content

Commit

Permalink
show settings window on first run
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne authored and Flora committed Jun 28, 2024
1 parent 4fbcdd9 commit 4f25367
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/BigPictureTV.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Mode(Enum):
current_mode = None
constants = None
settings_window = None
first_run = False

def load_constants():
if not os.path.exists(os.path.dirname(SETTINGS_FILE)):
Expand All @@ -45,6 +46,7 @@ def load_constants():
return json.load(f)

def create_default_settings():
global first_run
settings_template = {
"BIG_PICTURE_KEYWORDS": ["Steam", "mode", "Big", "Picture"],
"GAMEMODE_AUDIO": "TV",
Expand All @@ -54,6 +56,7 @@ def create_default_settings():
}
with open(SETTINGS_FILE, 'w') as f:
json.dump(settings_template, f, indent=4)
first_run = True

def read_stream_status():
file_path = os.path.join(os.environ['APPDATA'], "sunshine-status", "status.txt")
Expand Down Expand Up @@ -392,4 +395,8 @@ def update_mode_timer_interval(check_rate):
initial_check_rate = constants.get('CheckRate', 1000)
update_mode_timer_interval(initial_check_rate)

if first_run:
settings_window.show()
first_run = False

sys.exit(app.exec_())

0 comments on commit 4f25367

Please sign in to comment.