Skip to content

Commit 748c5c2

Browse files
committed
changed summary notification
1 parent 4e4a992 commit 748c5c2

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

config.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Settings]
2-
SEARCH_PATHS = C:\Users\Wreck\Downloads\, I:\Downloads, J:\Downloads, G:\testfolder
2+
SEARCH_PATHS = C:\Users\Wreck\Downloads\, I:\Downloads, J:\Downloads
33
EXTRACTABLE_EXTENSIONS = zip, rar, 7z, tar, gz, bzip2, iso, img, dmg
44
DAYS_UNTIL_DELETION = 14
55
START_WITH_WINDOWS = true
6-
MAX_LOG_SIZE_MB = 2
6+
MAX_LOG_SIZE_MB = 2

wfc/file.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
from typing import List, Tuple
77

8-
from wfc import popup, config, registry, paths, logger
8+
from wfc import notification, config, registry, paths, logger
99

1010
# TODO: Testmode toggle
1111
TESTMODE = True
@@ -163,8 +163,9 @@ def process_things():
163163
if bytes_to_delete == 0.0:
164164
logger.show_summary()
165165
else:
166-
popup.show_notification(
166+
notification.show_notification(
167167
f"Deleted {_bytes_to_string(bytes_to_delete)} from your computer.",
168168
f"{len(files_to_delete)} files and {len(folders_to_delete)} folders.\n"
169169
+ f"{amount_reason_unpacked} files already unpacked, {amount_reason_age} too old ({config.data[2]} days)",
170+
False,
170171
)

wfc/logger.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from datetime import datetime
33
import logging
44
from typing import Tuple
5-
from wfc import paths, popup
5+
from wfc import notification, paths
66

77

88
ENCODING = "utf-8"
@@ -38,9 +38,10 @@ def show_summary():
3838
size_saved += float(size[:-3])
3939

4040
size_saved /= 1024.0
41-
popup.show_notification(
41+
notification.show_notification(
4242
"There's nothing to delete!",
4343
f"You have saved {size_saved:.2f} GB in the last 30 days.",
44+
True,
4445
)
4546

4647

wfc/popup.py renamed to wfc/notification.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,21 @@ def _tray_clicked(button: dict):
1515
os.startfile("shell:RecycleBinFolder")
1616

1717

18-
def show_notification(title: str, message: str):
18+
def show_notification(title: str, message: str, summary: bool):
1919
time.sleep(1)
2020

2121
icon = {"src": paths.ICON_PATH, "placement": "appLogoOverride"}
22+
buttons = [LOG_BUTTON_TXT, RECYCLE_BIN_BUTTON_TXT]
23+
24+
if summary:
25+
buttons.remove(RECYCLE_BIN_BUTTON_TXT)
2226

2327
win11toast.toast(
2428
title,
2529
message,
2630
audio={"silent": "true"},
2731
duration="long",
2832
on_click=lambda args: _tray_clicked(args),
29-
buttons=[LOG_BUTTON_TXT, RECYCLE_BIN_BUTTON_TXT],
33+
buttons=buttons,
3034
icon=icon,
3135
)

0 commit comments

Comments
 (0)