Skip to content

Commit

Permalink
Added recent and favorite games filters to advanced search.
Browse files Browse the repository at this point in the history
  • Loading branch information
joeraz committed Feb 11, 2024
1 parent af2f730 commit 9e90157
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 13 deletions.
8 changes: 7 additions & 1 deletion po/de_pysol.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: PySol 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-01-15 22:12-0500\n"
"PO-Revision-Date: 2024-02-11 11:04-0500\n"
"Last-Translator: H. Schaekel <[email protected]>\n"
"Language-Team: German\n"
"Language: de\n"
Expand Down Expand Up @@ -3625,6 +3625,12 @@ msgstr ""
msgid "Popular"
msgstr ""

msgid "Recent"
msgstr ""

msgid "Favorite"
msgstr ""

msgid "Children's"
msgstr ""

Expand Down
8 changes: 7 additions & 1 deletion po/fr_pysol.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: 1.02\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-01-15 22:13-0500\n"
"PO-Revision-Date: 2024-02-11 11:04-0500\n"
"Last-Translator: Eric Rausch <[email protected]>\n"
"Language-Team: French\n"
"Language: fr\n"
Expand Down Expand Up @@ -3669,6 +3669,12 @@ msgstr ""
msgid "Popular"
msgstr ""

msgid "Recent"
msgstr ""

msgid "Favorite"
msgstr ""

msgid "Children's"
msgstr ""

Expand Down
8 changes: 7 additions & 1 deletion po/it_pysol.po
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ msgstr ""
"Project-Id-Version: it_pysol\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-01-15 22:58-0500\n"
"PO-Revision-Date: 2024-02-11 11:03-0500\n"
"Last-Translator: Giuliano Colla <[email protected]>\n"
"Language-Team: Italiano <[email protected]>\n"
"Language: it\n"
Expand Down Expand Up @@ -3731,6 +3731,12 @@ msgstr ""
msgid "Popular"
msgstr ""

msgid "Recent"
msgstr ""

msgid "Favorite"
msgstr ""

msgid "Children's"
msgstr ""

Expand Down
8 changes: 7 additions & 1 deletion po/pl_pysol.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: PySolFC\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-01-15 22:13-0500\n"
"PO-Revision-Date: 2024-02-11 11:03-0500\n"
"Last-Translator: Jerzy Trzeciak <[email protected]>\n"
"Language-Team: Polish <[email protected]>\n"
"Language: pl\n"
Expand Down Expand Up @@ -3686,6 +3686,12 @@ msgstr ""
msgid "Popular"
msgstr "Popularny"

msgid "Recent"
msgstr ""

msgid "Favorite"
msgstr ""

msgid "Children's"
msgstr "Dziecięcy"

Expand Down
8 changes: 7 additions & 1 deletion po/pt_BR_pysol.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-01-15 22:14-0500\n"
"PO-Revision-Date: 2024-02-11 11:02-0500\n"
"Last-Translator: Matheus Knack <[email protected]>\n"
"Language-Team: \n"
"Language: pt_BR\n"
Expand Down Expand Up @@ -3692,6 +3692,12 @@ msgstr ""
msgid "Popular"
msgstr "Popular"

msgid "Recent"
msgstr ""

msgid "Favorite"
msgstr ""

msgid "Children's"
msgstr "Filhos de"

Expand Down
6 changes: 6 additions & 0 deletions po/pysol.pot
Original file line number Diff line number Diff line change
Expand Up @@ -3491,6 +3491,12 @@ msgstr ""
msgid "Popular"
msgstr ""

msgid "Recent"
msgstr ""

msgid "Favorite"
msgstr ""

msgid "Children's"
msgstr ""

Expand Down
8 changes: 7 additions & 1 deletion po/ru_pysol.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-12-10 10:19-0500\n"
"PO-Revision-Date: 2024-01-15 22:14-0500\n"
"PO-Revision-Date: 2024-02-11 11:02-0500\n"
"Last-Translator: Skomoroh <[email protected]>\n"
"Language-Team: Russian <[email protected]>\n"
"Language: ru\n"
Expand Down Expand Up @@ -3741,6 +3741,12 @@ msgstr ""
msgid "Popular"
msgstr ""

msgid "Recent"
msgstr ""

msgid "Favorite"
msgstr ""

msgid "Children's"
msgstr ""

Expand Down
42 changes: 35 additions & 7 deletions pysollib/tile/selectgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,12 @@ def performSearch(self):
if (self.criteria.popular and
not (game.si.game_flags & GI.GT_POPULAR)):
continue
if (self.criteria.recent and
not (game.id in self.app.opt.recent_gameid)):
continue
if (self.criteria.favorite and
not (game.id in self.app.opt.favorite_gameid)):
continue
if (self.criteria.children and
not (game.si.game_flags & GI.GT_CHILDREN)):
continue
Expand Down Expand Up @@ -674,6 +680,8 @@ def advancedSearch(self):
self.criteria.statistics = d.statistics.get()

self.criteria.popular = d.popular.get()
self.criteria.recent = d.recent.get()
self.criteria.favorite = d.favorite.get()
self.criteria.children = d.children.get()
self.criteria.scoring = d.scoring.get()
self.criteria.stripped = d.stripped.get()
Expand Down Expand Up @@ -865,6 +873,8 @@ def __init__(self):
self.statistics = ""

self.popular = False
self.recent = False
self.favorite = False
self.children = False
self.scoring = False
self.stripped = False
Expand Down Expand Up @@ -946,6 +956,10 @@ def __init__(self, parent, title, criteria, **kw):

self.popular = tkinter.BooleanVar()
self.popular.set(criteria.popular)
self.recent = tkinter.BooleanVar()
self.recent.set(criteria.recent)
self.favorite = tkinter.BooleanVar()
self.favorite.set(criteria.favorite)
self.children = tkinter.BooleanVar()
self.children.set(criteria.children)
self.scoring = tkinter.BooleanVar()
Expand Down Expand Up @@ -1101,19 +1115,33 @@ def __init__(self, parent, title, criteria, **kw):
text=_("Popular"), anchor="w")
popularCheck.grid(row=row, column=col, columnspan=1, sticky='ew',
padx=1, pady=1)
col += 1
col += 2

recentCheck = tkinter.Checkbutton(top_frame, variable=self.recent,
text=_("Recent"), anchor="w")
recentCheck.grid(row=row, column=col, columnspan=1, sticky='ew',
padx=1, pady=1)
col += 2

favoriteCheck = tkinter.Checkbutton(top_frame, variable=self.favorite,
text=_("Favorite"), anchor="w")
favoriteCheck.grid(row=row, column=col, columnspan=1, sticky='ew',
padx=1, pady=1)

row += 1
col = 0

childCheck = tkinter.Checkbutton(top_frame, variable=self.children,
text=_("Children's"), anchor="w")
childCheck.grid(row=row, column=col, columnspan=1, sticky='ew',
padx=1, pady=1)
col += 1
col += 2

scoreCheck = tkinter.Checkbutton(top_frame, variable=self.scoring,
text=_("Scored"), anchor="w")
scoreCheck.grid(row=row, column=col, columnspan=1, sticky='ew',
padx=1, pady=1)
col += 1
col += 2

stripCheck = tkinter.Checkbutton(top_frame, variable=self.stripped,
text=_("Stripped Deck"), anchor="w")
Expand All @@ -1126,25 +1154,25 @@ def __init__(self, parent, title, criteria, **kw):
text=_("Separate Decks"), anchor="w")
sepCheck.grid(row=row, column=col, columnspan=1, sticky='ew',
padx=1, pady=1)
col += 1
col += 2

openCheck = tkinter.Checkbutton(top_frame, variable=self.open,
text=_("Open"), anchor="w")
openCheck.grid(row=row, column=col, columnspan=1, sticky='ew',
padx=1, pady=1)
col += 1
col += 2

relaxedCheck = tkinter.Checkbutton(top_frame, variable=self.relaxed,
text=_("Relaxed"), anchor="w")
relaxedCheck.grid(row=row, column=col, columnspan=1, sticky='ew',
padx=1, pady=1)
col += 1
row += 1
col = 0

originalCheck = tkinter.Checkbutton(top_frame, variable=self.original,
text=_("Original"), anchor="w")
originalCheck.grid(row=row, column=col, columnspan=1, sticky='ew',
padx=1, pady=1)
col += 1

focus = self.createButtons(bottom_frame, kw)
# focus = text_w
Expand Down

0 comments on commit 9e90157

Please sign in to comment.