mirror of
https://github.com/rangermix/TwitchDropsMiner.git
synced 2026-05-31 01:19:36 +00:00
Add an option to hide excluded games from the inventory view
This commit is contained in:
16
gui.py
16
gui.py
@@ -1003,11 +1003,13 @@ class Notebook:
|
||||
|
||||
class InventoryOverview:
|
||||
def __init__(self, manager: GUIManager, master: ttk.Widget):
|
||||
self._cache = manager._cache
|
||||
self._cache: ImageCache = manager._cache
|
||||
self._settings: Settings = manager._twitch.settings
|
||||
self._filters = {
|
||||
"linked": IntVar(master, 1),
|
||||
"expired": IntVar(master, 0),
|
||||
"upcoming": IntVar(master, 1),
|
||||
"expired": IntVar(master, 0),
|
||||
"excluded": IntVar(master, 0),
|
||||
"finished": IntVar(master, 0),
|
||||
}
|
||||
# Filtering options
|
||||
@@ -1044,6 +1046,14 @@ class InventoryOverview:
|
||||
text=_("gui", "inventory", "filter", "expired"),
|
||||
padding=(0, 0, LABEL_SPACING, 0),
|
||||
).grid(column=(icolumn := icolumn + 1), row=0)
|
||||
ttk.Checkbutton(
|
||||
filter_frame, variable=self._filters["excluded"]
|
||||
).grid(column=(icolumn := icolumn + 1), row=0)
|
||||
ttk.Label(
|
||||
filter_frame,
|
||||
text=_("gui", "inventory", "filter", "excluded"),
|
||||
padding=(0, 0, LABEL_SPACING, 0),
|
||||
).grid(column=(icolumn := icolumn + 1), row=0)
|
||||
ttk.Checkbutton(
|
||||
filter_frame, variable=self._filters["finished"]
|
||||
).grid(column=(icolumn := icolumn + 1), row=0)
|
||||
@@ -1080,11 +1090,13 @@ class InventoryOverview:
|
||||
frame = self._campaigns[campaign]
|
||||
linked = bool(self._filters["linked"].get())
|
||||
expired = bool(self._filters["expired"].get())
|
||||
excluded = bool(self._filters["excluded"].get())
|
||||
upcoming = bool(self._filters["upcoming"].get())
|
||||
finished = bool(self._filters["finished"].get())
|
||||
if (
|
||||
(not linked or campaign.linked)
|
||||
and (campaign.active or upcoming and campaign.upcoming or expired and campaign.expired)
|
||||
and (excluded or not excluded and campaign.game.name not in self._settings.exclude)
|
||||
and (finished or not campaign.finished)
|
||||
):
|
||||
frame.grid()
|
||||
|
||||
@@ -120,8 +120,9 @@ class GUIInvFilter(TypedDict):
|
||||
name: str
|
||||
show: str
|
||||
linked: str
|
||||
expired: str
|
||||
upcoming: str
|
||||
expired: str
|
||||
excluded: str
|
||||
finished: str
|
||||
refresh: str
|
||||
|
||||
@@ -306,8 +307,9 @@ default_translation: Translation = {
|
||||
"name": "Filter",
|
||||
"show": "Show:",
|
||||
"linked": "Linked only",
|
||||
"expired": "Expired",
|
||||
"upcoming": "Upcoming",
|
||||
"expired": "Expired",
|
||||
"excluded": "Excluded",
|
||||
"finished": "Finished",
|
||||
"refresh": "Refresh",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user