mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Option to filter by game subcategory/cardset subtype.
This commit is contained in:
parent
a6df89489a
commit
d3a4548f69
9 changed files with 162 additions and 9 deletions
|
@ -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-03-03 11:34-0500\n"
|
||||
"PO-Revision-Date: 2024-03-15 23:06-0400\n"
|
||||
"Last-Translator: H. Schaekel <Holger.Schaekel@web.de>\n"
|
||||
"Language-Team: German\n"
|
||||
"Language: de\n"
|
||||
|
@ -1801,6 +1801,9 @@ msgstr "Gründe für eine Scheidung"
|
|||
msgid "Type:"
|
||||
msgstr "Typ:"
|
||||
|
||||
msgid "Subtype:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/wizardutil.py:151 pysollib/wizardutil.py:157
|
||||
msgid "No redeals"
|
||||
msgstr "Keine neuen Karten"
|
||||
|
@ -3535,6 +3538,9 @@ msgstr "Alternative Namen:"
|
|||
msgid "Category:"
|
||||
msgstr "Kategorie:"
|
||||
|
||||
msgid "Subcategory:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/pysolgtk/selectgame.py:119 pysollib/tile/selectgame.py:397
|
||||
#: pysollib/tk/selectgame.py:397
|
||||
msgid "Decks:"
|
||||
|
|
|
@ -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-03-03 11:34-0500\n"
|
||||
"PO-Revision-Date: 2024-03-15 23:06-0400\n"
|
||||
"Last-Translator: Eric Rausch <neelix570@gmail.com>\n"
|
||||
"Language-Team: French\n"
|
||||
"Language: fr\n"
|
||||
|
@ -1831,6 +1831,9 @@ msgstr "Grounds for a Divorce"
|
|||
msgid "Type:"
|
||||
msgstr "Type:"
|
||||
|
||||
msgid "Subtype:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/wizardutil.py:151 pysollib/wizardutil.py:157
|
||||
msgid "No redeals"
|
||||
msgstr "Une donne"
|
||||
|
@ -3579,6 +3582,9 @@ msgstr "Noms alternatifs:"
|
|||
msgid "Category:"
|
||||
msgstr "Catégorie:"
|
||||
|
||||
msgid "Subcategory:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/pysolgtk/selectgame.py:119 pysollib/tile/selectgame.py:397
|
||||
#: pysollib/tk/selectgame.py:397
|
||||
msgid "Decks:"
|
||||
|
|
|
@ -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-03-03 11:35-0500\n"
|
||||
"PO-Revision-Date: 2024-03-15 23:06-0400\n"
|
||||
"Last-Translator: Giuliano Colla <giuliano.colla@gmail.com>\n"
|
||||
"Language-Team: Italiano <it@li.org>\n"
|
||||
"Language: it\n"
|
||||
|
@ -1839,6 +1839,9 @@ msgstr "Grounds for a Divorce"
|
|||
msgid "Type:"
|
||||
msgstr "Tipi:"
|
||||
|
||||
msgid "Subtype:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/wizardutil.py:151 pysollib/wizardutil.py:157
|
||||
msgid "No redeals"
|
||||
msgstr "Nessuna ridistribuzione"
|
||||
|
@ -3641,6 +3644,9 @@ msgstr "Nomi alternativi:"
|
|||
msgid "Category:"
|
||||
msgstr "Categoria:"
|
||||
|
||||
msgid "Subcategory:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/pysolgtk/selectgame.py:119 pysollib/tile/selectgame.py:397
|
||||
#: pysollib/tk/selectgame.py:397
|
||||
msgid "Decks:"
|
||||
|
|
|
@ -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-03-03 11:35-0500\n"
|
||||
"PO-Revision-Date: 2024-03-15 23:05-0400\n"
|
||||
"Last-Translator: Jerzy Trzeciak <artusek@wp.pl>\n"
|
||||
"Language-Team: Polish <pl@li.org>\n"
|
||||
"Language: pl\n"
|
||||
|
@ -1838,6 +1838,9 @@ msgstr ""
|
|||
msgid "Type:"
|
||||
msgstr "Typ:"
|
||||
|
||||
msgid "Subtype:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/wizardutil.py:151 pysollib/wizardutil.py:157
|
||||
msgid "No redeals"
|
||||
msgstr "Bez dodatkowych rozdań"
|
||||
|
@ -3596,6 +3599,9 @@ msgstr "Inne nazwy:"
|
|||
msgid "Category:"
|
||||
msgstr "Kategoria:"
|
||||
|
||||
msgid "Subcategory:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/pysolgtk/selectgame.py:119 pysollib/tile/selectgame.py:397
|
||||
#: pysollib/tk/selectgame.py:397
|
||||
msgid "Decks:"
|
||||
|
|
|
@ -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-03-03 11:36-0500\n"
|
||||
"PO-Revision-Date: 2024-03-15 23:05-0400\n"
|
||||
"Last-Translator: Matheus Knack <mtknack555@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: pt_BR\n"
|
||||
|
@ -1849,6 +1849,9 @@ msgstr "Motivos para um divórcio"
|
|||
msgid "Type:"
|
||||
msgstr "Tipo:"
|
||||
|
||||
msgid "Subtype:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/wizardutil.py:151 pysollib/wizardutil.py:157
|
||||
msgid "No redeals"
|
||||
msgstr "Sem re-distribuições"
|
||||
|
@ -3602,6 +3605,9 @@ msgstr "Nomes alternativos:"
|
|||
msgid "Category:"
|
||||
msgstr "Categoria:"
|
||||
|
||||
msgid "Subcategory:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/pysolgtk/selectgame.py:119 pysollib/tile/selectgame.py:397
|
||||
#: pysollib/tk/selectgame.py:397
|
||||
msgid "Decks:"
|
||||
|
|
|
@ -1725,6 +1725,9 @@ msgstr ""
|
|||
msgid "Type:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Subtype:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/wizardutil.py:151 pysollib/wizardutil.py:157
|
||||
msgid "No redeals"
|
||||
msgstr ""
|
||||
|
@ -3401,6 +3404,9 @@ msgstr ""
|
|||
msgid "Category:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Subcategory:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/pysolgtk/selectgame.py:119 pysollib/tile/selectgame.py:397
|
||||
#: pysollib/tk/selectgame.py:397
|
||||
msgid "Decks:"
|
||||
|
|
|
@ -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-03-03 11:36-0500\n"
|
||||
"PO-Revision-Date: 2024-03-15 23:05-0400\n"
|
||||
"Last-Translator: Skomoroh <skomoroh@gmail.com>\n"
|
||||
"Language-Team: Russian <ru@li.org>\n"
|
||||
"Language: ru\n"
|
||||
|
@ -1831,6 +1831,9 @@ msgstr ""
|
|||
msgid "Type:"
|
||||
msgstr "Тип:"
|
||||
|
||||
msgid "Subtype:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/wizardutil.py:151 pysollib/wizardutil.py:157
|
||||
msgid "No redeals"
|
||||
msgstr "Без пересдачи"
|
||||
|
@ -3651,6 +3654,9 @@ msgstr "Другие имена:"
|
|||
msgid "Category:"
|
||||
msgstr "Категория:"
|
||||
|
||||
msgid "Subcategory:"
|
||||
msgstr ""
|
||||
|
||||
#: pysollib/pysolgtk/selectgame.py:119 pysollib/tile/selectgame.py:397
|
||||
#: pysollib/tk/selectgame.py:397
|
||||
msgid "Decks:"
|
||||
|
|
|
@ -508,7 +508,10 @@ class SelectCardsetDialogWithPreview(MfxDialog):
|
|||
and self.criteria.typeOptions[self.criteria.type]
|
||||
!= cardset.si.type):
|
||||
continue
|
||||
|
||||
if (self.criteria.subtype != "" and
|
||||
self.criteria.subtypeOptionsAll[self.criteria.subtype]
|
||||
!= cardset.si.subtype):
|
||||
continue
|
||||
if (self.criteria.style != ""
|
||||
and self.criteria.styleOptions[self.criteria.style]
|
||||
not in cardset.si.styles):
|
||||
|
@ -542,6 +545,7 @@ class SelectCardsetDialogWithPreview(MfxDialog):
|
|||
|
||||
self.criteria.size = d.size.get()
|
||||
self.criteria.type = d.type.get()
|
||||
self.criteria.subtype = d.subtype.get()
|
||||
self.criteria.style = d.style.get()
|
||||
self.criteria.date = d.date.get()
|
||||
self.criteria.nationality = d.nationality.get()
|
||||
|
@ -722,6 +726,7 @@ class SearchCriteria:
|
|||
self.name = ""
|
||||
self.size = ""
|
||||
self.type = ""
|
||||
self.subtype = ""
|
||||
self.style = ""
|
||||
self.date = ""
|
||||
self.nationality = ""
|
||||
|
@ -740,6 +745,14 @@ class SearchCriteria:
|
|||
typeOptions[key] = name
|
||||
self.typeOptions = dict((v, k) for k, v in typeOptions.items())
|
||||
|
||||
self.subtypeOptions = {"": -1}
|
||||
|
||||
subtypeOptionsAll = {"": -1}
|
||||
for t in CSI.SUBTYPE_NAME.values():
|
||||
subtypeOptionsAll.update(t)
|
||||
self.subtypeOptionsAll = dict((v, k) for k, v in
|
||||
subtypeOptionsAll.items())
|
||||
|
||||
styleOptions = {-1: ""}
|
||||
for key, name in CSI.STYLE.items():
|
||||
if manager.registered_styles.get(key):
|
||||
|
@ -773,6 +786,8 @@ class SelectCardsetAdvancedSearch(MfxDialog):
|
|||
self.size.set(criteria.size)
|
||||
self.type = tkinter.StringVar()
|
||||
self.type.set(criteria.type)
|
||||
self.subtype = tkinter.StringVar()
|
||||
self.subtype.set(criteria.subtype)
|
||||
self.style = tkinter.StringVar()
|
||||
self.style.set(criteria.style)
|
||||
self.date = tkinter.StringVar()
|
||||
|
@ -804,15 +819,34 @@ class SelectCardsetAdvancedSearch(MfxDialog):
|
|||
typeValues = list(criteria.typeOptions.keys())
|
||||
typeValues.sort()
|
||||
|
||||
self.typeValues = criteria.typeOptions
|
||||
|
||||
labelType = tkinter.Label(top_frame, text="Type:", anchor="w")
|
||||
labelType.grid(row=row, column=0, columnspan=1, sticky='ew',
|
||||
padx=1, pady=1)
|
||||
textType = PysolCombo(top_frame, values=typeValues,
|
||||
textvariable=self.type, state='readonly')
|
||||
textvariable=self.type, state='readonly',
|
||||
selectcommand=self.updateSubtypes)
|
||||
textType.grid(row=row, column=1, columnspan=4, sticky='ew',
|
||||
padx=1, pady=1)
|
||||
row += 1
|
||||
|
||||
subtypeValues = list(criteria.subtypeOptions.keys())
|
||||
subtypeValues.sort()
|
||||
|
||||
labelSubtype = tkinter.Label(top_frame, text="Subtype:",
|
||||
anchor="w")
|
||||
labelSubtype.grid(row=row, column=0, columnspan=1, sticky='ew',
|
||||
padx=1, pady=1)
|
||||
textSubtype = PysolCombo(top_frame, values=subtypeValues,
|
||||
textvariable=self.subtype,
|
||||
state='readonly')
|
||||
textSubtype.grid(row=row, column=1, columnspan=4, sticky='ew',
|
||||
padx=1, pady=1)
|
||||
self.subtypeSelect = textSubtype
|
||||
self.updateSubtypes()
|
||||
row += 1
|
||||
|
||||
styleValues = list(criteria.styleOptions.keys())
|
||||
styleValues.sort()
|
||||
|
||||
|
@ -855,6 +889,23 @@ class SelectCardsetAdvancedSearch(MfxDialog):
|
|||
# focus = text_w
|
||||
self.mainloop(focus, kw.timeout)
|
||||
|
||||
def updateSubtypes(self, *args):
|
||||
subtypeOptions = {-1: ""}
|
||||
key = self.typeValues[self.type.get()]
|
||||
if key in CSI.SUBTYPE_NAME:
|
||||
subtypeOptions.update(CSI.SUBTYPE_NAME[key])
|
||||
self.subtypeSelect['state'] = 'readonly'
|
||||
subtypeOptions = dict((v, k) for k, v in
|
||||
subtypeOptions.items())
|
||||
subtypeOptionsK = list(subtypeOptions.keys())
|
||||
subtypeOptionsK.sort()
|
||||
self.subtypeSelect['values'] = subtypeOptionsK
|
||||
if self.subtype.get() not in subtypeOptionsK:
|
||||
self.subtype.set("")
|
||||
else:
|
||||
self.subtypeSelect['state'] = 'disabled'
|
||||
self.subtype.set("")
|
||||
|
||||
def initKw(self, kw):
|
||||
kw = KwStruct(kw,
|
||||
strings=(_("&OK"), _("&Cancel")), default=0,
|
||||
|
|
|
@ -541,6 +541,11 @@ class SelectGameDialogWithPreview(SelectGameDialog):
|
|||
self.criteria.categoryOptions[self.criteria.category]
|
||||
!= game.category):
|
||||
continue
|
||||
if (self.criteria.subcategory != "" and
|
||||
self.criteria.
|
||||
subcategoryOptionsAll[self.criteria.subcategory]
|
||||
!= game.subcategory):
|
||||
continue
|
||||
if (self.criteria.type != ""
|
||||
and self.criteria.typeOptions[self.criteria.type]
|
||||
!= game.si.game_type):
|
||||
|
@ -669,6 +674,7 @@ class SelectGameDialogWithPreview(SelectGameDialog):
|
|||
|
||||
self.criteria.usealt = d.usealt.get()
|
||||
self.criteria.category = d.category.get()
|
||||
self.criteria.subcategory = d.subcategory.get()
|
||||
self.criteria.type = d.type.get()
|
||||
self.criteria.skill = d.skill.get()
|
||||
self.criteria.decks = d.decks.get()
|
||||
|
@ -862,6 +868,7 @@ class SearchCriteria:
|
|||
self.name = ""
|
||||
self.usealt = True
|
||||
self.category = ""
|
||||
self.subcategory = ""
|
||||
self.type = ""
|
||||
self.skill = ""
|
||||
self.decks = ""
|
||||
|
@ -888,11 +895,25 @@ class SearchCriteria:
|
|||
del categoryOptions[7] # Navagraha Ganjifa is unused.
|
||||
self.categoryOptions = dict((v, k) for k, v in categoryOptions.items())
|
||||
|
||||
self.subcategoryOptions = {"": -1}
|
||||
|
||||
subcategoryOptionsAll = {"": -1}
|
||||
for t in CSI.SUBTYPE_NAME.values():
|
||||
subcategoryOptionsAll.update(t)
|
||||
self.subcategoryOptionsAll = dict((v, k) for k, v in
|
||||
subcategoryOptionsAll.items())
|
||||
|
||||
typeOptions = {-1: ""}
|
||||
typeOptions.update(GI.TYPE_NAMES)
|
||||
del typeOptions[29] # Simple games type is unused.
|
||||
self.typeOptions = dict((v, k) for k, v in typeOptions.items())
|
||||
|
||||
self.deckOptions = {"": 0,
|
||||
"1 deck games": 1,
|
||||
"2 deck games": 2,
|
||||
"3 deck games": 3,
|
||||
"4 deck games": 4}
|
||||
|
||||
skillOptions = {-1: ""}
|
||||
skillOptions.update(GI.SKILL_LEVELS)
|
||||
self.skillOptions = dict((v, k) for k, v in skillOptions.items())
|
||||
|
@ -935,6 +956,8 @@ class SelectGameAdvancedSearch(MfxDialog):
|
|||
self.usealt.set(criteria.usealt)
|
||||
self.category = tkinter.StringVar()
|
||||
self.category.set(criteria.category)
|
||||
self.subcategory = tkinter.StringVar()
|
||||
self.subcategory.set(criteria.subcategory)
|
||||
self.type = tkinter.StringVar()
|
||||
self.type.set(criteria.type)
|
||||
self.skill = tkinter.StringVar()
|
||||
|
@ -974,6 +997,7 @@ class SelectGameAdvancedSearch(MfxDialog):
|
|||
self.relaxed.set(criteria.relaxed)
|
||||
self.original = tkinter.BooleanVar()
|
||||
self.original.set(criteria.original)
|
||||
|
||||
#
|
||||
row = 0
|
||||
|
||||
|
@ -995,15 +1019,34 @@ class SelectGameAdvancedSearch(MfxDialog):
|
|||
categoryValues = list(criteria.categoryOptions.keys())
|
||||
categoryValues.sort()
|
||||
|
||||
self.categoryValues = criteria.categoryOptions
|
||||
|
||||
labelCategory = tkinter.Label(top_frame, text="Category:", anchor="w")
|
||||
labelCategory.grid(row=row, column=0, columnspan=1, sticky='ew',
|
||||
padx=1, pady=1)
|
||||
textCategory = PysolCombo(top_frame, values=categoryValues,
|
||||
textvariable=self.category, state='readonly')
|
||||
textvariable=self.category, state='readonly',
|
||||
selectcommand=self.updateSubcategories)
|
||||
textCategory.grid(row=row, column=1, columnspan=4, sticky='ew',
|
||||
padx=1, pady=1)
|
||||
row += 1
|
||||
|
||||
subcategoryValues = list(criteria.subcategoryOptions.keys())
|
||||
subcategoryValues.sort()
|
||||
|
||||
labelSubcategory = tkinter.Label(top_frame, text="Subcategory:",
|
||||
anchor="w")
|
||||
labelSubcategory.grid(row=row, column=0, columnspan=1, sticky='ew',
|
||||
padx=1, pady=1)
|
||||
textSubcategory = PysolCombo(top_frame, values=subcategoryValues,
|
||||
textvariable=self.subcategory,
|
||||
state='readonly')
|
||||
textSubcategory.grid(row=row, column=1, columnspan=4, sticky='ew',
|
||||
padx=1, pady=1)
|
||||
self.subcategorySelect = textSubcategory
|
||||
self.updateSubcategories()
|
||||
row += 1
|
||||
|
||||
typeValues = list(criteria.typeOptions.keys())
|
||||
typeValues.sort()
|
||||
|
||||
|
@ -1178,6 +1221,23 @@ class SelectGameAdvancedSearch(MfxDialog):
|
|||
# focus = text_w
|
||||
self.mainloop(focus, kw.timeout)
|
||||
|
||||
def updateSubcategories(self, *args):
|
||||
subcategoryOptions = {-1: ""}
|
||||
key = self.categoryValues[self.category.get()]
|
||||
if key in CSI.SUBTYPE_NAME:
|
||||
subcategoryOptions.update(CSI.SUBTYPE_NAME[key])
|
||||
self.subcategorySelect['state'] = 'readonly'
|
||||
subcategoryOptions = dict((v, k) for k, v in
|
||||
subcategoryOptions.items())
|
||||
subcategoryOptionsK = list(subcategoryOptions.keys())
|
||||
subcategoryOptionsK.sort()
|
||||
self.subcategorySelect['values'] = subcategoryOptionsK
|
||||
if self.subcategory.get() not in subcategoryOptionsK:
|
||||
self.subcategory.set("")
|
||||
else:
|
||||
self.subcategorySelect['state'] = 'disabled'
|
||||
self.subcategory.set("")
|
||||
|
||||
def initKw(self, kw):
|
||||
kw = KwStruct(kw,
|
||||
strings=(_("&OK"), _("&Cancel")), default=0,
|
||||
|
|
Loading…
Add table
Reference in a new issue