Skip to content

Commit

Permalink
Add option to clear filters
Browse files Browse the repository at this point in the history
  • Loading branch information
joeraz committed Nov 16, 2024
1 parent 8cbac32 commit d7d9bb3
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 14 deletions.
Binary file added data/images/buttons/bluecurve/clear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/images/buttons/remix/clear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 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-11-10 18:26-0500\n"
"PO-Revision-Date: 2024-11-16 11:21-0500\n"
"Last-Translator: H. Schaekel <[email protected]>\n"
"Language-Team: German\n"
"Language: de\n"
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 4 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-11-10 18:25-0500\n"
"PO-Revision-Date: 2024-11-16 11:21-0500\n"
"Last-Translator: Eric Rausch <[email protected]>\n"
"Language-Team: French\n"
"Language: fr\n"
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 4 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-11-10 18:25-0500\n"
"PO-Revision-Date: 2024-11-16 11:21-0500\n"
"Last-Translator: Giuliano Colla <[email protected]>\n"
"Language-Team: Italiano <[email protected]>\n"
"Language: it\n"
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 4 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-11-10 18:25-0500\n"
"PO-Revision-Date: 2024-11-16 11:22-0500\n"
"Last-Translator: Jerzy Trzeciak <[email protected]>\n"
"Language-Team: Polish <[email protected]>\n"
"Language: pl\n"
Expand Down Expand Up @@ -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"
Expand Down
5 changes: 4 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-11-10 18:26-0500\n"
"PO-Revision-Date: 2024-11-16 11:23-0500\n"
"Last-Translator: Matheus Knack <[email protected]>\n"
"Language-Team: \n"
"Language: pt_BR\n"
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions po/pysol.pot
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ msgstr ""
msgid "&Cancel"
msgstr ""

msgid "C&lear"
msgstr ""

#: pysollib/actions.py:311
msgid "Select random game"
msgstr ""
Expand Down
5 changes: 4 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-11-10 18:24-0500\n"
"PO-Revision-Date: 2024-11-16 11:23-0500\n"
"Last-Translator: Skomoroh <[email protected]>\n"
"Language-Team: Russian <[email protected]>\n"
"Language: ru\n"
Expand Down Expand Up @@ -117,6 +117,9 @@ msgstr "&Следующий номер"
msgid "&Cancel"
msgstr "От&мена"

msgid "C&lear"
msgstr ""

#: pysollib/actions.py:311
msgid "Select random game"
msgstr "Выбор случайной игры"
Expand Down
1 change: 1 addition & 0 deletions pysollib/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
13 changes: 10 additions & 3 deletions pysollib/tile/selectcardset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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):
Expand All @@ -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)
11 changes: 9 additions & 2 deletions pysollib/tile/selectgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)

Expand All @@ -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)
10 changes: 8 additions & 2 deletions pysollib/tile/selecttile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion pysollib/tile/tkwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit d7d9bb3

Please sign in to comment.