miss out fl/pl/nl checkbox if no relevant hands
This commit is contained in:
		
							parent
							
								
									02e1a71592
								
							
						
					
					
						commit
						d78d69e9f4
					
				|  | @ -66,6 +66,7 @@ class RingFilters(Filters.Filters): | ||||||
|         # Outer Packing box |         # Outer Packing box | ||||||
|         self.mainVBox = gtk.VBox(False, 0) |         self.mainVBox = gtk.VBox(False, 0) | ||||||
| 
 | 
 | ||||||
|  |         self.found = {'nl':False, 'fl':False, 'pl':False, 'ring':False, 'tour':False} | ||||||
|         self.label = {} |         self.label = {} | ||||||
|         self.callback = {} |         self.callback = {} | ||||||
| 
 | 
 | ||||||
|  | @ -364,7 +365,7 @@ class RingFilters(Filters.Filters): | ||||||
|     #end def __set_game_select |     #end def __set_game_select | ||||||
| 
 | 
 | ||||||
|     def __set_limit_select(self, w, limit): |     def __set_limit_select(self, w, limit): | ||||||
|         #print 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')): | ||||||
|  | @ -488,7 +489,7 @@ class RingFilters(Filters.Filters): | ||||||
|             if self.limits[limit]: |             if self.limits[limit]: | ||||||
|                 self.type = "ring" |                 self.type = "ring" | ||||||
|                 for cb in self.cbLimits.values(): |                 for cb in self.cbLimits.values(): | ||||||
|                     #print "cb label: ", cb.children()[0].get_text() |                     print "ring: cb label: ", cb.children()[0].get_text() | ||||||
|                     if self.types[cb.get_children()[0].get_text()] == 'tour': |                     if self.types[cb.get_children()[0].get_text()] == 'tour': | ||||||
|                         cb.set_active(False) |                         cb.set_active(False) | ||||||
|         elif limit == "tour": |         elif limit == "tour": | ||||||
|  | @ -627,7 +628,7 @@ class RingFilters(Filters.Filters): | ||||||
|         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() | ||||||
|         found = {'nl':False, 'fl':False, 'pl':False, 'ring':False, 'tour':False} |         self.found = {'nl':False, 'fl':False, 'pl':False, 'ring':False, 'tour':False} | ||||||
| 
 | 
 | ||||||
|         if len(result) >= 1: |         if len(result) >= 1: | ||||||
|             hbox = gtk.HBox(True, 0) |             hbox = gtk.HBox(True, 0) | ||||||
|  | @ -648,16 +649,16 @@ class RingFilters(Filters.Filters): | ||||||
|                 if True:  #line[0] == 'ring': |                 if True:  #line[0] == 'ring': | ||||||
|                     if line[1] == 'fl': |                     if line[1] == 'fl': | ||||||
|                         name = str(line[2]) |                         name = str(line[2]) | ||||||
|                         found['fl'] = True |                         self.found['fl'] = True | ||||||
|                     elif line[1] == 'pl': |                     elif line[1] == 'pl': | ||||||
|                         name = str(line[2])+line[1] |                         name = str(line[2])+line[1] | ||||||
|                         found['pl'] = True |                         self.found['pl'] = True | ||||||
|                     else: |                     else: | ||||||
|                         name = str(line[2])+line[1] |                         name = str(line[2])+line[1] | ||||||
|                         found['nl'] = True |                         self.found['nl'] = True | ||||||
|                     self.cbLimits[name] = self.createLimitLine(hbox, name, name) |                     self.cbLimits[name] = self.createLimitLine(hbox, name, name) | ||||||
|                     self.types[name] = line[0] |                     self.types[name] = line[0] | ||||||
|                 found[line[0]] = True      # type is ring/tour |                 self.found[line[0]] = True      # type is ring/tour | ||||||
|                 self.type = line[0]        # if only one type, set it now |                 self.type = line[0]        # if only one type, set it now | ||||||
|             if "LimitSep" in display and display["LimitSep"] == True and len(result) >= 2: |             if "LimitSep" in display and display["LimitSep"] == True and len(result) >= 2: | ||||||
|                 hbox = gtk.HBox(True, 0) |                 hbox = gtk.HBox(True, 0) | ||||||
|  | @ -675,15 +676,21 @@ class RingFilters(Filters.Filters): | ||||||
|                 self.cbNoLimits = self.createLimitLine(hbox, 'none', self.filterText['limitsnone']) |                 self.cbNoLimits = self.createLimitLine(hbox, 'none', self.filterText['limitsnone']) | ||||||
| 
 | 
 | ||||||
|                 dest = vbox3  # for ring/tour buttons |                 dest = vbox3  # for ring/tour buttons | ||||||
|                 if "LimitType" in display and display["LimitType"] == True and found['nl'] and found['fl']: |                 if "LimitType" in display and display["LimitType"] == True: | ||||||
|                     #if found['fl']: |                     num_limit_types = 0 | ||||||
|  |                     if self.found['fl']:  num_limit_types = num_limit_types + 1 | ||||||
|  |                     if self.found['pl']:  num_limit_types = num_limit_types + 1 | ||||||
|  |                     if self.found['nl']:  num_limit_types = num_limit_types + 1 | ||||||
|  |                     if num_limit_types > 1: | ||||||
|  |                        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) | ||||||
|                            self.cbFL = self.createLimitLine(hbox, 'fl', self.filterText['limitsFL']) |                            self.cbFL = self.createLimitLine(hbox, 'fl', self.filterText['limitsFL']) | ||||||
|                     #if found['nl']: |                        if self.found['nl']: | ||||||
|                            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.cbNL = self.createLimitLine(hbox, 'nl', self.filterText['limitsNL']) |                            self.cbNL = self.createLimitLine(hbox, 'nl', self.filterText['limitsNL']) | ||||||
|  |                        if self.found['pl']: | ||||||
|                            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']) | ||||||
|  | @ -692,7 +699,7 @@ class RingFilters(Filters.Filters): | ||||||
|             print "INFO: No games returned from database" |             print "INFO: No games returned from database" | ||||||
|             log.info("No games returned from database") |             log.info("No games returned from database") | ||||||
| 
 | 
 | ||||||
|         if "Type" in display and display["Type"] == True and found['ring'] and found['tour']: |         if "Type" in display and display["Type"] == True and self.found['ring'] and self.found['tour']: | ||||||
|             rb1 = gtk.RadioButton(None, self.filterText['ring']) |             rb1 = gtk.RadioButton(None, self.filterText['ring']) | ||||||
|             rb1.connect('clicked', self.__set_limit_select, 'ring') |             rb1.connect('clicked', self.__set_limit_select, 'ring') | ||||||
|             rb2 = gtk.RadioButton(rb1, self.filterText['tour']) |             rb2 = gtk.RadioButton(rb1, self.filterText['tour']) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user