If you only have games of a single limit type (fixed, pot, or no limit), but of more than one blind size, then you won't see the 'NL', 'PL', 'FL' checkboxes in the Limits: section of the filters. When you check the 'All' checkbox, the individual size checkboxes won't be checked, because the code relies on the 'NL', 'PL', 'FL' checkboxes being there to do it. This fixes the problem.
To reproduce: have only 2 hands in the database, both no limit, one 2nl and one 5nl. Click 'None' then 'All'. The 2nl and 5nl checkboxes will turn off when you click 'None' but not turn back on when you click 'All'.
This commit is contained in:
parent
1c32931f49
commit
83b7e849e3
|
@ -420,12 +420,15 @@ class Filters(threading.Thread):
|
||||||
self.limits[limit] = w.get_active()
|
self.limits[limit] = w.get_active()
|
||||||
log.debug(_("self.limit[%s] set to %s") %(limit, self.limits[limit]))
|
log.debug(_("self.limit[%s] set to %s") %(limit, self.limits[limit]))
|
||||||
if limit.isdigit() or (len(limit) > 2 and (limit[-2:] == 'nl' or limit[-2:] == 'fl' or limit[-2:] == 'pl')):
|
if limit.isdigit() or (len(limit) > 2 and (limit[-2:] == 'nl' or limit[-2:] == 'fl' or limit[-2:] == 'pl')):
|
||||||
|
# turning a leaf limit on with 'None' checked turns 'None' off
|
||||||
if self.limits[limit]:
|
if self.limits[limit]:
|
||||||
if self.cbNoLimits is not None:
|
if self.cbNoLimits is not None:
|
||||||
self.cbNoLimits.set_active(False)
|
self.cbNoLimits.set_active(False)
|
||||||
|
# turning a leaf limit off with 'All' checked turns 'All' off
|
||||||
else:
|
else:
|
||||||
if self.cbAllLimits is not None:
|
if self.cbAllLimits is not None:
|
||||||
self.cbAllLimits.set_active(False)
|
self.cbAllLimits.set_active(False)
|
||||||
|
# turning off a leaf limit turns off the corresponding fl. nl, or pl
|
||||||
if not self.limits[limit]:
|
if not self.limits[limit]:
|
||||||
if limit.isdigit():
|
if limit.isdigit():
|
||||||
if self.cbFL is not None:
|
if self.cbFL is not None:
|
||||||
|
@ -438,8 +441,10 @@ class Filters(threading.Thread):
|
||||||
self.cbPL.set_active(False)
|
self.cbPL.set_active(False)
|
||||||
elif limit == "all":
|
elif limit == "all":
|
||||||
if self.limits[limit]:
|
if self.limits[limit]:
|
||||||
#for cb in self.cbLimits.values():
|
if self.num_limit_types == 1:
|
||||||
# cb.set_active(True)
|
for cb in self.cbLimits.values():
|
||||||
|
cb.set_active(True)
|
||||||
|
else:
|
||||||
if self.cbFL is not None:
|
if self.cbFL is not None:
|
||||||
self.cbFL.set_active(True)
|
self.cbFL.set_active(True)
|
||||||
if self.cbNL is not None:
|
if self.cbNL is not None:
|
||||||
|
@ -448,8 +453,10 @@ class Filters(threading.Thread):
|
||||||
self.cbPL.set_active(True)
|
self.cbPL.set_active(True)
|
||||||
elif limit == "none":
|
elif limit == "none":
|
||||||
if self.limits[limit]:
|
if self.limits[limit]:
|
||||||
|
if self.num_limit_types == 1:
|
||||||
for cb in self.cbLimits.values():
|
for cb in self.cbLimits.values():
|
||||||
cb.set_active(False)
|
cb.set_active(False)
|
||||||
|
else:
|
||||||
if self.cbNL is not None:
|
if self.cbNL is not None:
|
||||||
self.cbNL.set_active(False)
|
self.cbNL.set_active(False)
|
||||||
if self.cbFL is not None:
|
if self.cbFL is not None:
|
||||||
|
@ -765,11 +772,11 @@ class Filters(threading.Thread):
|
||||||
|
|
||||||
dest = vbox3 # for ring/tour buttons
|
dest = vbox3 # for ring/tour buttons
|
||||||
if "LimitType" in display and display["LimitType"] == True:
|
if "LimitType" in display and display["LimitType"] == True:
|
||||||
num_limit_types = 0
|
self.num_limit_types = 0
|
||||||
if self.found['fl']: num_limit_types = num_limit_types + 1
|
if self.found['fl']: self.num_limit_types = self.num_limit_types + 1
|
||||||
if self.found['pl']: num_limit_types = num_limit_types + 1
|
if self.found['pl']: self.num_limit_types = self.num_limit_types + 1
|
||||||
if self.found['nl']: num_limit_types = num_limit_types + 1
|
if self.found['nl']: self.num_limit_types = self.num_limit_types + 1
|
||||||
if num_limit_types > 1:
|
if self.num_limit_types > 1:
|
||||||
if self.found['fl']:
|
if self.found['fl']:
|
||||||
hbox = gtk.HBox(False, 0)
|
hbox = gtk.HBox(False, 0)
|
||||||
vbox3.pack_start(hbox, False, False, 0)
|
vbox3.pack_start(hbox, False, False, 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user