Merge branch 'master' of git://git.assembla.com/fpdb-gimick
This commit is contained in:
commit
f6351cef53
|
@ -57,7 +57,7 @@ class Filters(threading.Thread):
|
||||||
,'groupstitle':_('Grouping:'), 'posnshow':_('Show Position Stats')
|
,'groupstitle':_('Grouping:'), 'posnshow':_('Show Position Stats')
|
||||||
,'datestitle':_('Date:')
|
,'datestitle':_('Date:')
|
||||||
,'groupsall':_('All Players')
|
,'groupsall':_('All Players')
|
||||||
,'limitsFL':'FL', 'limitsNL':'NL', 'limitsPL':'PL', 'ring':_('Ring'), 'tour':_('Tourney')
|
,'limitsFL':'FL', 'limitsNL':'NL', 'limitsPL':'PL', 'limitsCN':'CAP', 'ring':_('Ring'), 'tour':_('Tourney')
|
||||||
}
|
}
|
||||||
|
|
||||||
gen = self.conf.get_general_params()
|
gen = self.conf.get_general_params()
|
||||||
|
@ -79,7 +79,7 @@ class Filters(threading.Thread):
|
||||||
self.sw.show()
|
self.sw.show()
|
||||||
print _("DEBUG: New packing box created!")
|
print _("DEBUG: New packing box created!")
|
||||||
|
|
||||||
self.found = {'nl':False, 'fl':False, 'pl':False, 'ring':False, 'tour':False}
|
self.found = {'nl':False, 'fl':False, 'pl':False, 'cn':False, 'ring':False, 'tour':False}
|
||||||
self.label = {}
|
self.label = {}
|
||||||
self.callback = {}
|
self.callback = {}
|
||||||
|
|
||||||
|
@ -154,9 +154,11 @@ class Filters(threading.Thread):
|
||||||
self.cbFL = None
|
self.cbFL = None
|
||||||
self.cbNL = None
|
self.cbNL = None
|
||||||
self.cbPL = None
|
self.cbPL = None
|
||||||
|
self.cbCN = None
|
||||||
self.rb = {} # radio buttons for ring/tour
|
self.rb = {} # radio buttons for ring/tour
|
||||||
self.type = None # ring/tour
|
self.type = None # ring/tour
|
||||||
self.types = {} # list of all ring/tour values
|
self.types = {} # list of all ring/tour values
|
||||||
|
self.num_limit_types = 0
|
||||||
|
|
||||||
self.num_limit_types = 0
|
self.num_limit_types = 0
|
||||||
self.fillLimitsFrame(vbox, self.display)
|
self.fillLimitsFrame(vbox, self.display)
|
||||||
|
@ -430,7 +432,7 @@ class Filters(threading.Thread):
|
||||||
#print "__set_limit_select: limit =", limit, w.get_active()
|
#print "__set_limit_select: limit =", limit, w.get_active()
|
||||||
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' or limit[-2:] == 'cn')):
|
||||||
# turning a leaf limit on with 'None' checked turns 'None' off
|
# 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:
|
||||||
|
@ -439,7 +441,7 @@ class Filters(threading.Thread):
|
||||||
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
|
# turning off a leaf limit turns off the corresponding fl. nl, cn 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:
|
||||||
|
@ -447,6 +449,9 @@ class Filters(threading.Thread):
|
||||||
elif (len(limit) > 2 and (limit[-2:] == 'nl')):
|
elif (len(limit) > 2 and (limit[-2:] == 'nl')):
|
||||||
if self.cbNL is not None:
|
if self.cbNL is not None:
|
||||||
self.cbNL.set_active(False)
|
self.cbNL.set_active(False)
|
||||||
|
elif (len(limit) > 2 and (limit[-2:] == 'cn')):
|
||||||
|
if self.cbCN is not None:
|
||||||
|
self.cbCN.set_active(False)
|
||||||
else:
|
else:
|
||||||
if self.cbPL is not None:
|
if self.cbPL is not None:
|
||||||
self.cbPL.set_active(False)
|
self.cbPL.set_active(False)
|
||||||
|
@ -462,18 +467,26 @@ class Filters(threading.Thread):
|
||||||
self.cbNL.set_active(True)
|
self.cbNL.set_active(True)
|
||||||
if self.cbPL is not None:
|
if self.cbPL is not None:
|
||||||
self.cbPL.set_active(True)
|
self.cbPL.set_active(True)
|
||||||
|
if self.cbCN is not None:
|
||||||
|
self.cbCN.set_active(True)
|
||||||
elif limit == "none":
|
elif limit == "none":
|
||||||
if self.limits[limit]:
|
if self.limits[limit]:
|
||||||
if self.num_limit_types == 1:
|
if self.num_limit_types > 1:
|
||||||
for cb in self.cbLimits.values():
|
|
||||||
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:
|
||||||
self.cbFL.set_active(False)
|
self.cbFL.set_active(False)
|
||||||
if self.cbPL is not None:
|
if self.cbPL is not None:
|
||||||
self.cbPL.set_active(False)
|
self.cbPL.set_active(False)
|
||||||
|
if self.cbCN is not None:
|
||||||
|
self.cbCN.set_active(False)
|
||||||
|
#
|
||||||
|
# Finally, clean-up all individual limit checkboxes
|
||||||
|
# needed because the overall limit checkbox may
|
||||||
|
# not be set, or num_limit_types == 1
|
||||||
|
#
|
||||||
|
for cb in self.cbLimits.values():
|
||||||
|
cb.set_active(False)
|
||||||
elif limit == "fl":
|
elif limit == "fl":
|
||||||
if not self.limits[limit]:
|
if not self.limits[limit]:
|
||||||
# only toggle all fl limits off if they are all currently on
|
# only toggle all fl limits off if they are all currently on
|
||||||
|
@ -553,6 +566,29 @@ class Filters(threading.Thread):
|
||||||
elif self.type == 'tour':
|
elif self.type == 'tour':
|
||||||
if 'ring' in self.rb:
|
if 'ring' in self.rb:
|
||||||
self.rb['ring'].set_active(True)
|
self.rb['ring'].set_active(True)
|
||||||
|
elif limit == "cn":
|
||||||
|
if not self.limits[limit]:
|
||||||
|
all_cn_on = True
|
||||||
|
for cb in self.cbLimits.values():
|
||||||
|
t = cb.get_children()[0].get_text()
|
||||||
|
if "cn" in t and len(t) > 2:
|
||||||
|
if not cb.get_active():
|
||||||
|
all_cn_on = False
|
||||||
|
found = {'ring':False, 'tour':False}
|
||||||
|
for cb in self.cbLimits.values():
|
||||||
|
t = cb.get_children()[0].get_text()
|
||||||
|
if "cn" in t and len(t) > 2:
|
||||||
|
if self.limits[limit] or all_cn_on:
|
||||||
|
cb.set_active(self.limits[limit])
|
||||||
|
found[self.types[t]] = True
|
||||||
|
if self.limits[limit]:
|
||||||
|
if not found[self.type]:
|
||||||
|
if self.type == 'ring':
|
||||||
|
if 'tour' in self.rb:
|
||||||
|
self.rb['tour'].set_active(True)
|
||||||
|
elif self.type == 'tour':
|
||||||
|
if 'ring' in self.rb:
|
||||||
|
self.rb['ring'].set_active(True)
|
||||||
elif limit == "ring":
|
elif limit == "ring":
|
||||||
log.debug("set", limit, "to", self.limits[limit])
|
log.debug("set", limit, "to", self.limits[limit])
|
||||||
if self.limits[limit]:
|
if self.limits[limit]:
|
||||||
|
@ -726,15 +762,16 @@ class Filters(threading.Thread):
|
||||||
showb = gtk.Button(label="hide", stock=None, use_underline=True)
|
showb = gtk.Button(label="hide", stock=None, use_underline=True)
|
||||||
showb.set_alignment(xalign=1.0, yalign=0.5)
|
showb.set_alignment(xalign=1.0, yalign=0.5)
|
||||||
showb.connect('clicked', self.__toggle_box, 'limits')
|
showb.connect('clicked', self.__toggle_box, 'limits')
|
||||||
|
top_hbox.pack_start(showb, expand=False, padding=1)
|
||||||
|
|
||||||
vbox1 = gtk.VBox(False, 0)
|
vbox1 = gtk.VBox(False, 15)
|
||||||
vbox.pack_start(vbox1, False, False, 0)
|
vbox.pack_start(vbox1, False, False, 0)
|
||||||
self.boxes['limits'] = vbox1
|
self.boxes['limits'] = vbox1
|
||||||
|
|
||||||
self.cursor.execute(self.sql.query['getCashLimits'])
|
self.cursor.execute(self.sql.query['getCashLimits'])
|
||||||
# selects limitType, bigBlind
|
# selects limitType, bigBlind
|
||||||
result = self.db.cursor.fetchall()
|
result = self.db.cursor.fetchall()
|
||||||
self.found = {'nl':False, 'fl':False, 'pl':False, 'ring':False, 'tour':False}
|
self.found = {'nl':False, 'fl':False, 'pl':False, 'cn':False, 'ring':False, 'tour':False}
|
||||||
|
|
||||||
if len(result) >= 1:
|
if len(result) >= 1:
|
||||||
hbox = gtk.HBox(True, 0)
|
hbox = gtk.HBox(True, 0)
|
||||||
|
@ -759,6 +796,9 @@ class Filters(threading.Thread):
|
||||||
elif line[1] == 'pl':
|
elif line[1] == 'pl':
|
||||||
name = str(line[2])+line[1]
|
name = str(line[2])+line[1]
|
||||||
self.found['pl'] = True
|
self.found['pl'] = True
|
||||||
|
elif line[1] == 'cn':
|
||||||
|
name = str(line[2])+line[1]
|
||||||
|
self.found['cn'] = True
|
||||||
else:
|
else:
|
||||||
name = str(line[2])+line[1]
|
name = str(line[2])+line[1]
|
||||||
self.found['nl'] = True
|
self.found['nl'] = True
|
||||||
|
@ -787,6 +827,7 @@ class Filters(threading.Thread):
|
||||||
if self.found['fl']: self.num_limit_types = self.num_limit_types + 1
|
if self.found['fl']: self.num_limit_types = self.num_limit_types + 1
|
||||||
if self.found['pl']: self.num_limit_types = self.num_limit_types + 1
|
if self.found['pl']: self.num_limit_types = self.num_limit_types + 1
|
||||||
if self.found['nl']: self.num_limit_types = self.num_limit_types + 1
|
if self.found['nl']: self.num_limit_types = self.num_limit_types + 1
|
||||||
|
if self.found['cn']: self.num_limit_types = self.num_limit_types + 1
|
||||||
if self.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)
|
||||||
|
@ -800,6 +841,10 @@ class Filters(threading.Thread):
|
||||||
hbox = gtk.HBox(False, 0)
|
hbox = gtk.HBox(False, 0)
|
||||||
vbox3.pack_start(hbox, False, False, 0)
|
vbox3.pack_start(hbox, False, False, 0)
|
||||||
self.cbPL = self.createLimitLine(hbox, 'pl', self.filterText['limitsPL'])
|
self.cbPL = self.createLimitLine(hbox, 'pl', self.filterText['limitsPL'])
|
||||||
|
if self.found['cn']:
|
||||||
|
hbox = gtk.HBox(False, 0)
|
||||||
|
vbox3.pack_start(hbox, False, False, 0)
|
||||||
|
self.cbCN = self.createLimitLine(hbox, 'cn', self.filterText['limitsCN'])
|
||||||
dest = vbox2 # for ring/tour buttons
|
dest = vbox2 # for ring/tour buttons
|
||||||
else:
|
else:
|
||||||
print _("INFO: No games returned from database")
|
print _("INFO: No games returned from database")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user