Skip to content

Commit

Permalink
Suppress TclError for set_theme
Browse files Browse the repository at this point in the history
  • Loading branch information
elibroftw committed Apr 16, 2024
1 parent 4771a7e commit dc3fba8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Music Caster by Elijah Lopez Changelog

5.18.3
- [Fix] Handle experimental feature error

5.18.2
- [Fix] Changing cast device

Expand Down
8 changes: 4 additions & 4 deletions build_files/mc_version_info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# For more details about fixed file info 'ffi' see: http://msdn.microsoft.com/en-us/library/ms646997.aspx
VSVersionInfo(
ffi=FixedFileInfo(
prodvers=(5, 18, 2, 0),
filevers=(5, 18, 2, 0),
prodvers=(5, 18, 3, 0),
filevers=(5, 18, 3, 0),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x17,
# Contains a bitmask that specifies the Boolean attributes of the file.
Expand All @@ -27,12 +27,12 @@ VSVersionInfo(
'000004b0',
[StringStruct('CompanyName', 'Elijah Lopez'),
StringStruct('FileDescription', 'Music Caster'),
StringStruct('FileVersion', '5.18.2.0'),
StringStruct('FileVersion', '5.18.3.0'),
StringStruct('InternalName', 'Music Caster'),
StringStruct('LegalCopyright', 'Copyright (c) 2019 - 2024, Elijah Lopez'),
StringStruct('OriginalFilename', 'Music Caster.exe'),
StringStruct('ProductName', 'Music Caster'),
StringStruct('ProductVersion', '5.18.2.0')])
StringStruct('ProductVersion', '5.18.3.0')])
]),
VarFileInfo([VarStruct('Translation', [0, 1200])])
]
Expand Down
2 changes: 1 addition & 1 deletion build_files/setup_script.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MyAppName "Music Caster"
#define MyAppVersion "5.18.2"
#define MyAppVersion "5.18.3"
#define MyAppPublisher "Elijah Lopez"
#define MyAppURL "https://elijahlopez.ca/software#music-caster"
#define MyAppExeName "Music Caster.exe"
Expand Down
2 changes: 1 addition & 1 deletion src/meta.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = latest_version = '5.18.2'
VERSION = latest_version = '5.18.3'
UPDATE_MESSAGE = """
[NEW] Better Error Capturing
[MSG] Language translators wanted
Expand Down
11 changes: 9 additions & 2 deletions src/music_caster.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ def activate_instance(port=2001, default_timeout=0.5, to_port=2004):
sun_valley_tcl_path = f'{sys._MEIPASS}/{SUN_VALLEY_TCL}'
except AttributeError:
sun_valley_tcl_path = SUN_VALLEY_TCL
sun_valley_tcl_path = os.path.abspath(sun_valley_tcl_path)
# LOGS
log_format = logging.Formatter('%(asctime)s %(levelname)s (%(lineno)d): %(message)s')
# max 1 MB log file
Expand Down Expand Up @@ -2612,9 +2613,15 @@ def activate_gui(selected_tab=None, url_option='url_play'):
location=window_location, metadata=window_metadata, debugger_enabled=is_debug())
if State.using_tcl_theme:
Sg.PySimpleGUI.TOOLTIP_BACKGROUND_COLOR = settings['theme']['background']
with suppress(TclError):
try:
# as per State.using_tcl_theme, sun_valley_tcl_path exists
gui_window.TKroot.tk.call('source', sun_valley_tcl_path)
gui_window.TKroot.tk.call('set_theme', 'dark')
gui_window.TKroot.tk.call('set_theme', 'dark')
except TclError as e:
if IS_FROZEN:
handle_exception(e)
else:
raise e
if not settings['mini_mode']:
gui_window['queue'].update(set_to_index=len(done_queue), scroll_to_index=len(done_queue))
pl_tracks_values, pl_length = format_pl_lb(pl_tracks)
Expand Down

0 comments on commit dc3fba8

Please sign in to comment.