Skip to content

Commit

Permalink
Merge branch 'main' into feat/tex-compress
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Jan 31, 2025
2 parents f42d222 + b8affdf commit aad2728
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- Saves CPU/GPU usage by redrawing less if disabled when unfocused, but still uses same VRAM

### Updated:
- New notification system with buttons and better platform support (#220 by @Willy-JL)
- New notification system with buttons and better platform support, option to include banner image in update notifs (#220 by @Willy-JL)
- Updates popup is now cumulative, new updates get grouped with any previous popups and moved to top (#220 by @Willy-JL)
- Executable paths in More Info popup wrap after `/` and `\` characters for easier readability (by @Willy-JL)

Expand Down
1 change: 1 addition & 0 deletions common/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ class Settings:
mark_installed_after_add : bool
max_connections : int
max_retries : int
notifs_show_update_banner : bool
play_gifs : bool
play_gifs_unfocused : bool
proxy_type : ProxyType
Expand Down
1 change: 1 addition & 0 deletions modules/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ async def connect():
"mark_installed_after_add": f'INTEGER DEFAULT {int(False)}',
"max_connections": f'INTEGER DEFAULT 10',
"max_retries": f'INTEGER DEFAULT 2',
"notifs_show_update_banner": f'INTEGER DEFAULT {int(True)}',
"play_gifs": f'INTEGER DEFAULT {int(True)}',
"play_gifs_unfocused": f'INTEGER DEFAULT {int(False)}',
"proxy_type": f'INTEGER DEFAULT {ProxyType.Disabled}',
Expand Down
6 changes: 6 additions & 0 deletions modules/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -4862,6 +4862,12 @@ def select_callback(selected):
draw_settings_label("Check alerts and inbox:")
draw_settings_checkbox("check_notifs")

draw_settings_label(
"Banners in update notifs:",
"Whether to include a banner image when sending desktop notifications for updates."
)
draw_settings_checkbox("notifs_show_update_banner")

draw_settings_label("Refresh if archived:")
draw_settings_checkbox("refresh_archived_games")

Expand Down
10 changes: 5 additions & 5 deletions modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ def done_callback(future: asyncio.Future):
globals.popup_stack.remove(popup)
push_popup(type(globals.gui).draw_updates_popup, globals.gui).uuid = "updates"
if globals.gui.hidden or not globals.gui.focused:
image = list(filter(lambda f: f.suffix not in (".zst", ".aastc"), globals.images_path.glob(f"{first}.*")))
if image:
image = desktop_notifier.Attachment(path=image[0])
else:
image = None
image = None
if globals.settings.notifs_show_update_banner:
image_paths = list(filter(lambda f: f.suffix not in (".zst", ".aastc"), globals.images_path.glob(f"{first}.*")))
if image_paths:
image = desktop_notifier.Attachment(path=image_paths[0])
count = len(globals.updated_games)
notification_proc.notify(
title="Updates",
Expand Down

0 comments on commit aad2728

Please sign in to comment.