From d7d9bb3ea6e425132e3e827aa5983b6dae72bc91 Mon Sep 17 00:00:00 2001 From: Joe R Date: Sat, 16 Nov 2024 11:40:32 -0500 Subject: [PATCH] Add option to clear filters --- data/images/buttons/bluecurve/clear.png | Bin 0 -> 829 bytes data/images/buttons/remix/clear.png | Bin 0 -> 398 bytes po/de_pysol.po | 5 ++++- po/fr_pysol.po | 5 ++++- po/it_pysol.po | 5 ++++- po/pl_pysol.po | 5 ++++- po/pt_BR_pysol.po | 5 ++++- po/pysol.pot | 3 +++ po/ru_pysol.po | 5 ++++- pysollib/app.py | 1 + pysollib/tile/selectcardset.py | 13 ++++++++++--- pysollib/tile/selectgame.py | 11 +++++++++-- pysollib/tile/selecttile.py | 10 ++++++++-- pysollib/tile/tkwidget.py | 2 +- 14 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 data/images/buttons/bluecurve/clear.png create mode 100644 data/images/buttons/remix/clear.png diff --git a/data/images/buttons/bluecurve/clear.png b/data/images/buttons/bluecurve/clear.png new file mode 100644 index 0000000000000000000000000000000000000000..7673e62c686f93c2922641138f994f37ad17550a GIT binary patch literal 829 zcmV-D1H$}?P) zvf7Ivu)?rAQQw%eB9p8iOGW zmu4#-UXx5FgT^_HK}nLsScghHj^D4FwB-KEZ^hrkUjt*z_(Uw=(3 zUL~6gO5?Csg^5XXA+}wGm_Iaz+SA6J^ zwjFL-a6)B0A9e872L^_|)_3Tb$EE_|{1tb;^R~hF_vz`~t~@?VYweqEZ+evo`7CEf zXl`QNYW5!VDEe^XVqlJJF0ZbxUOZl7e#>l~O`FZG9FqBwvMA?%qr93ghgq@7X*^I0 zE7lOw-=

*+A#QF7-2$4)4EBVrm{|;7ck`CMHf)_3Y9vK-)ov&f{ z(p8QhXYx$JRW8HO0eYTg%YgT=94n{7__v|k@Y#~(t81>VtM~IyCms5HuTP$#I?Apu zc;XG?*oBvn#ssno&3^%~OkqsjsL-f0@E79C+VtMq#0!H)Lr14DiE|3`GJh$DMQ9XN zs8*OVSv-vScoN6LwS1`JuXz!$)M*29HqK1|olk)Iki)ktzY&UkFGRqYfTtZM z&M!H9*|1tjLmp`I8O4hWb3(reCSjUIvCsOHJa%DLNZSbyQ_(9*slzrP4f!D8K!S{- zbe%L|6{tYy<7C0a#lB$o5};p)Et%-i-^@zLKn7}X7(k1#v5DOV&|YQUGa#OLOdMTt znB|ZSDM~T1UADek3HC_ir?kKzO2tIw=1}6Zg}O`9BMwWmPjrmN-Y5=rq=c@!t*%6= zR++l`Bo1H?1$(EQwuzLGdZ@$lGqIGT@4WKYY}htPWk-dsVXBX26dj6ViaEt=_55(E sy50(DWsb~4-+XU?ngI*>mr1rcKkdoK6HToU%K!iX07*qoM6N<$f{g^Pr2qf` literal 0 HcmV?d00001 diff --git a/po/de_pysol.po b/po/de_pysol.po index 974acb988..44c372d5c 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: 2024-11-10 18:26-0500\n" +"PO-Revision-Date: 2024-11-16 11:21-0500\n" "Last-Translator: H. Schaekel \n" "Language-Team: German\n" "Language: de\n" @@ -111,6 +111,9 @@ msgstr "&Nächste Nummer" msgid "&Cancel" msgstr "&Abbruch" +msgid "C&lear" +msgstr "" + #: pysollib/actions.py:311 msgid "Select random game" msgstr "Zufallsspiel auswählen" diff --git a/po/fr_pysol.po b/po/fr_pysol.po index 57d1a0e94..63a283c66 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: 2024-11-10 18:25-0500\n" +"PO-Revision-Date: 2024-11-16 11:21-0500\n" "Last-Translator: Eric Rausch \n" "Language-Team: French\n" "Language: fr\n" @@ -116,6 +116,9 @@ msgstr "&Numéro suivant" msgid "&Cancel" msgstr "&Annuler" +msgid "C&lear" +msgstr "" + #: pysollib/actions.py:311 msgid "Select random game" msgstr "Jeu au hasard" diff --git a/po/it_pysol.po b/po/it_pysol.po index 05d8d311d..7da3384a7 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: 2024-11-10 18:25-0500\n" +"PO-Revision-Date: 2024-11-16 11:21-0500\n" "Last-Translator: Giuliano Colla \n" "Language-Team: Italiano \n" "Language: it\n" @@ -121,6 +121,9 @@ msgstr "&Numero successivo" msgid "&Cancel" msgstr "&Cancella" +msgid "C&lear" +msgstr "" + #: pysollib/actions.py:311 msgid "Select random game" msgstr "Un gioco a caso" diff --git a/po/pl_pysol.po b/po/pl_pysol.po index 573566d08..08c65861c 100644 --- a/po/pl_pysol.po +++ b/po/pl_pysol.po @@ -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-11-10 18:25-0500\n" +"PO-Revision-Date: 2024-11-16 11:22-0500\n" "Last-Translator: Jerzy Trzeciak \n" "Language-Team: Polish \n" "Language: pl\n" @@ -117,6 +117,9 @@ msgstr "&Następny numer" msgid "&Cancel" msgstr "Anuluj" +msgid "C&lear" +msgstr "" + #: pysollib/actions.py:311 msgid "Select random game" msgstr "Wybierz grę losowo" diff --git a/po/pt_BR_pysol.po b/po/pt_BR_pysol.po index 5f2e17c5a..ecb79f481 100644 --- a/po/pt_BR_pysol.po +++ b/po/pt_BR_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: 2024-11-10 18:26-0500\n" +"PO-Revision-Date: 2024-11-16 11:23-0500\n" "Last-Translator: Matheus Knack \n" "Language-Team: \n" "Language: pt_BR\n" @@ -116,6 +116,9 @@ msgstr "&próximo número" msgid "&Cancel" msgstr "&Cancelar" +msgid "C&lear" +msgstr "" + #: pysollib/actions.py:311 msgid "Select random game" msgstr "Selecionar jogo aleatório" diff --git a/po/pysol.pot b/po/pysol.pot index 3fb795395..e131b204c 100644 --- a/po/pysol.pot +++ b/po/pysol.pot @@ -113,6 +113,9 @@ msgstr "" msgid "&Cancel" msgstr "" +msgid "C&lear" +msgstr "" + #: pysollib/actions.py:311 msgid "Select random game" msgstr "" diff --git a/po/ru_pysol.po b/po/ru_pysol.po index 7976cf9e9..563a2079a 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: 2024-11-10 18:24-0500\n" +"PO-Revision-Date: 2024-11-16 11:23-0500\n" "Last-Translator: Skomoroh \n" "Language-Team: Russian \n" "Language: ru\n" @@ -117,6 +117,9 @@ msgstr "&Следующий номер" msgid "&Cancel" msgstr "От&мена" +msgid "C&lear" +msgstr "" + #: pysollib/actions.py:311 msgid "Select random game" msgstr "Выбор случайной игры" diff --git a/pysollib/app.py b/pysollib/app.py index acad747df..fd704b3d2 100644 --- a/pysollib/app.py +++ b/pysollib/app.py @@ -567,6 +567,7 @@ def loadImages1(self): (_('&Next number'), 'next'), (_('&Play'), 'next'), (_('&Play this game'), 'next'), + (_('C&lear'), 'clear'), (_('&Solid color...'), 'color'), (_('&Save to file'), 'save'), (_('&Statistics...'), 'statistics'), diff --git a/pysollib/tile/selectcardset.py b/pysollib/tile/selectcardset.py index 13ad74fa3..1683cf494 100644 --- a/pysollib/tile/selectcardset.py +++ b/pysollib/tile/selectcardset.py @@ -548,6 +548,10 @@ def advancedSearch(self): d = SelectCardsetAdvancedSearch(self.top, _("Advanced search"), self.criteria, self.manager) if d.status == 0 and d.button == 0: + self.criteria = SearchCriteria(self.manager) + self.performSearch() + + if d.status == 0 and d.button == 1: self.criteria.name = d.name.get() self.list_searchtext.delete(0, "end") @@ -903,11 +907,14 @@ def __init__(self, parent, title, criteria, manager, **kw): top_frame, variable=self.compatible, text=_("Compatible with current game"), anchor="w" ) - compatCheck.grid(row=row, column=0, columnspan=2, sticky='ew', + compatCheck.grid(row=row, column=0, columnspan=5, sticky='ew', padx=1, pady=1) + top_frame.columnconfigure(4, weight=1) + focus = self.createButtons(bottom_frame, kw) # focus = text_w + self.mainloop(focus, kw.timeout) def updateSubtypes(self, *args): @@ -929,7 +936,7 @@ def updateSubtypes(self, *args): def initKw(self, kw): kw = KwStruct(kw, - strings=(_("&OK"), _("&Cancel")), default=0, - padx=10, pady=10, + strings=(_("C&lear"), 'sep', _("&OK"), _("&Cancel")), + default=1, padx=10, pady=10, ) return MfxDialog.initKw(self, kw) diff --git a/pysollib/tile/selectgame.py b/pysollib/tile/selectgame.py index 9975d8253..a3a78c57e 100644 --- a/pysollib/tile/selectgame.py +++ b/pysollib/tile/selectgame.py @@ -676,6 +676,10 @@ def advancedSearch(self): d = SelectGameAdvancedSearch(self.top, _("Advanced search"), self.criteria) if d.status == 0 and d.button == 0: + self.criteria = SearchCriteria() + self.performSearch() + + if d.status == 0 and d.button == 1: self.criteria.name = d.name.get() self.list_searchtext.delete(0, "end") @@ -1227,6 +1231,9 @@ def __init__(self, parent, title, criteria, **kw): padx=1, pady=1) focus = self.createButtons(bottom_frame, kw) + + top_frame.config(width=bottom_frame.winfo_width()) + # focus = text_w self.mainloop(focus, kw.timeout) @@ -1249,7 +1256,7 @@ def updateSubcategories(self, *args): def initKw(self, kw): kw = KwStruct(kw, - strings=(_("&OK"), _("&Cancel")), default=0, - padx=10, pady=10, + strings=(_("C&lear"), 'sep', _("&OK"), _("&Cancel")), + default=1, padx=10, pady=10, ) return MfxDialog.initKw(self, kw) diff --git a/pysollib/tile/selecttile.py b/pysollib/tile/selecttile.py index fca9b27c3..37546ee00 100644 --- a/pysollib/tile/selecttile.py +++ b/pysollib/tile/selecttile.py @@ -344,6 +344,10 @@ def advancedSearch(self): d = SelectTileAdvancedSearch(self.top, _("Advanced search"), self.criteria) if d.status == 0 and d.button == 0: + self.criteria = SearchCriteria() + self.performSearch() + + if d.status == 0 and d.button == 1: self.criteria.name = d.name.get() self.list_searchtext.delete(0, "end") @@ -461,13 +465,15 @@ def __init__(self, parent, title, criteria, **kw): padx=1, pady=1) row += 1 + top_frame.columnconfigure(4, weight=1) + focus = self.createButtons(bottom_frame, kw) # focus = text_w self.mainloop(focus, kw.timeout) def initKw(self, kw): kw = KwStruct(kw, - strings=(_("&OK"), _("&Cancel")), default=0, - padx=10, pady=10, + strings=(_("C&lear"), 'sep', _("&OK"), _("&Cancel")), + default=1, padx=10, pady=10, ) return MfxDialog.initKw(self, kw) diff --git a/pysollib/tile/tkwidget.py b/pysollib/tile/tkwidget.py index c8cb6f3ae..7fb3f8101 100644 --- a/pysollib/tile/tkwidget.py +++ b/pysollib/tile/tkwidget.py @@ -154,7 +154,7 @@ def createFrames(self, kw): separator = ttk.Separator(self._frame) separator.pack(side='bottom', fill='x') top_frame = ttk.Frame(self._frame) - top_frame.pack(side='top', fill='both', expand=1) + top_frame.pack(side='top', fill='both', expand=True) return top_frame, bottom_frame def createBitmaps(self, frame, kw):