diff --git a/po/de_pysol.po b/po/de_pysol.po index 0d5b4f94..12c7f74d 100644 --- a/po/de_pysol.po +++ b/po/de_pysol.po @@ -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: 2022-08-13 11:50-0400\n" +"PO-Revision-Date: 2022-08-22 17:51-0400\n" "Last-Translator: H. Schaekel \n" "Language-Team: German\n" "Language: de\n" @@ -3372,6 +3372,18 @@ msgstr "" msgid "Check alternate names" msgstr "" +msgid "New in" +msgstr "" + +msgid "Present in" +msgstr "" + +msgid "New since" +msgstr "" + +msgid "Popular" +msgstr "" + msgid "Children's" msgstr "" diff --git a/po/fr_pysol.po b/po/fr_pysol.po index b2d86d7c..5251fcd7 100644 --- a/po/fr_pysol.po +++ b/po/fr_pysol.po @@ -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: 2022-08-13 11:49-0400\n" +"PO-Revision-Date: 2022-08-22 17:52-0400\n" "Last-Translator: Eric Rausch \n" "Language-Team: French\n" "Language: fr\n" @@ -3418,6 +3418,18 @@ msgstr "" msgid "Check alternate names" msgstr "" +msgid "New in" +msgstr "" + +msgid "Present in" +msgstr "" + +msgid "New since" +msgstr "" + +msgid "Popular" +msgstr "" + msgid "Children's" msgstr "" diff --git a/po/it_pysol.po b/po/it_pysol.po index b79c4196..21c16b52 100644 --- a/po/it_pysol.po +++ b/po/it_pysol.po @@ -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: 2022-08-13 11:49-0400\n" +"PO-Revision-Date: 2022-08-22 17:53-0400\n" "Last-Translator: Giuliano Colla \n" "Language-Team: Italiano \n" "Language: it\n" @@ -3479,6 +3479,18 @@ msgstr "" msgid "Check alternate names" msgstr "" +msgid "New in" +msgstr "" + +msgid "Present in" +msgstr "" + +msgid "New since" +msgstr "" + +msgid "Popular" +msgstr "" + msgid "Children's" msgstr "" diff --git a/po/pl_pysol.po b/po/pl_pysol.po index df421b0e..1b71cd62 100644 --- a/po/pl_pysol.po +++ b/po/pl_pysol.po @@ -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: 2022-08-13 11:48-0400\n" +"PO-Revision-Date: 2022-08-22 17:53-0400\n" "Last-Translator: Jerzy Trzeciak \n" "Language-Team: Polish \n" "Language: pl\n" @@ -3518,6 +3518,18 @@ msgstr "" msgid "Check alternate names" msgstr "" +msgid "New in" +msgstr "" + +msgid "Present in" +msgstr "" + +msgid "New since" +msgstr "" + +msgid "Popular" +msgstr "" + msgid "Children's" msgstr "" diff --git a/po/pysol.pot b/po/pysol.pot index 682e768c..54c28aab 100644 --- a/po/pysol.pot +++ b/po/pysol.pot @@ -3244,6 +3244,18 @@ msgstr "" msgid "Check alternate names" msgstr "" +msgid "New in" +msgstr "" + +msgid "Present in" +msgstr "" + +msgid "New since" +msgstr "" + +msgid "Popular" +msgstr "" + msgid "Children's" msgstr "" diff --git a/po/ru_pysol.po b/po/ru_pysol.po index e120912e..2462cd25 100644 --- a/po/ru_pysol.po +++ b/po/ru_pysol.po @@ -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: 2022-08-13 11:47-0400\n" +"PO-Revision-Date: 2022-08-22 17:54-0400\n" "Last-Translator: Skomoroh \n" "Language-Team: Russian \n" "Language: ru\n" @@ -3490,6 +3490,18 @@ msgstr "" msgid "Check alternate names" msgstr "" +msgid "New in" +msgstr "" + +msgid "Present in" +msgstr "" + +msgid "New since" +msgstr "" + +msgid "Popular" +msgstr "" + msgid "Children's" msgstr "" diff --git a/pysollib/tile/selectgame.py b/pysollib/tile/selectgame.py index 3a39c1cc..e746dd13 100644 --- a/pysollib/tile/selectgame.py +++ b/pysollib/tile/selectgame.py @@ -582,6 +582,29 @@ class SelectGameDialogWithPreview(SelectGameDialog): if not invent_okay: continue + if self.criteria.version != "": + version_okay = False + version_found = False + for name, games in GI.GAMES_BY_PYSOL_VERSION: + if self.criteria.version == name: + version_found = True + if game.id in games: + version_okay = True + break + elif ((not version_found and + self.criteria.versioncompare == "Present in") + or (version_found and + self.criteria.versioncompare == "New since")): + if game.id in games: + version_okay = True + break + + if not version_okay: + continue + + if (self.criteria.popular and + not (game.si.game_flags & GI.GT_POPULAR)): + continue if (self.criteria.children and not (game.si.game_flags & GI.GT_CHILDREN)): continue @@ -632,7 +655,10 @@ class SelectGameDialogWithPreview(SelectGameDialog): self.criteria.redeals = d.redeals.get() self.criteria.compat = d.compat.get() self.criteria.inventor = d.inventor.get() + self.criteria.versioncompare = d.versioncompare.get() + self.criteria.version = d.version.get() + self.criteria.popular = d.popular.get() self.criteria.children = d.children.get() self.criteria.scoring = d.scoring.get() self.criteria.stripped = d.stripped.get() @@ -810,7 +836,10 @@ class SearchCriteria: self.redeals = "" self.compat = "" self.inventor = "" + self.versioncompare = "New in" + self.version = "" + self.popular = False self.children = False self.scoring = False self.stripped = False @@ -848,6 +877,8 @@ class SearchCriteria: "Variable redeals": -2, "Other number of redeals": 4} + self.versionCompareOptions = ("New in", "Present in", "New since") + class SelectGameAdvancedSearch(MfxDialog): def __init__(self, parent, title, criteria, **kw): @@ -875,7 +906,13 @@ class SelectGameAdvancedSearch(MfxDialog): self.compat.set(criteria.compat) self.inventor = tkinter.StringVar() self.inventor.set(criteria.inventor) + self.versioncompare = tkinter.StringVar() + self.versioncompare.set(criteria.versioncompare) + self.version = tkinter.StringVar() + self.version.set(criteria.version) + self.popular = tkinter.BooleanVar() + self.popular.set(criteria.popular) self.children = tkinter.BooleanVar() self.children.set(criteria.children) self.scoring = tkinter.BooleanVar() @@ -994,7 +1031,33 @@ class SelectGameAdvancedSearch(MfxDialog): padx=1, pady=1) row += 1 + versionCompareValues = list(criteria.versionCompareOptions) + versionValues = list() + versionValues.append("") + for name, games in GI.GAMES_BY_PYSOL_VERSION: + versionValues.append(name) + + labelVersion = tkinter.Label(top_frame, text="PySol Version:", + anchor="w") + labelVersion.grid(row=row, column=0, columnspan=1, sticky='ew', + padx=1, pady=1) + textVersionCompare = PysolCombo(top_frame, values=versionCompareValues, + textvariable=self.versioncompare) + textVersionCompare.grid(row=row, column=1, columnspan=2, sticky='ew', + padx=1, pady=1) + textVersion = PysolCombo(top_frame, values=versionValues, + textvariable=self.version) + textVersion.grid(row=row, column=3, columnspan=2, sticky='ew', + padx=1, pady=1) + row += 1 + col = 0 + popularCheck = tkinter.Checkbutton(top_frame, variable=self.popular, + text=_("Popular"), anchor="w") + popularCheck.grid(row=row, column=col, columnspan=1, sticky='ew', + padx=1, pady=1) + col += 1 + childCheck = tkinter.Checkbutton(top_frame, variable=self.children, text=_("Children's"), anchor="w") childCheck.grid(row=row, column=col, columnspan=1, sticky='ew', @@ -1011,14 +1074,14 @@ class SelectGameAdvancedSearch(MfxDialog): text=_("Stripped Deck"), anchor="w") stripCheck.grid(row=row, column=col, columnspan=1, sticky='ew', padx=1, pady=1) - col += 1 + row += 1 + col = 0 sepCheck = tkinter.Checkbutton(top_frame, variable=self.separate, text=_("Separate Decks"), anchor="w") sepCheck.grid(row=row, column=col, columnspan=1, sticky='ew', padx=1, pady=1) - row += 1 - col = 0 + col += 1 openCheck = tkinter.Checkbutton(top_frame, variable=self.open, text=_("Open"), anchor="w")