From 1c32931f49a8562bb539e53e6b15964c08566d8a Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 5 Feb 2011 16:38:37 -0800 Subject: [PATCH 1/6] Don't use hardcoded 'black' as text colour for non-money stats in the stat viewers. Use the theme default instead. --- pyfpdb/GuiRingPlayerStats.py | 2 +- pyfpdb/GuiTourneyPlayerStats.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/GuiRingPlayerStats.py b/pyfpdb/GuiRingPlayerStats.py index f061322e..9a64eac6 100644 --- a/pyfpdb/GuiRingPlayerStats.py +++ b/pyfpdb/GuiRingPlayerStats.py @@ -339,7 +339,7 @@ class GuiRingPlayerStats (GuiPlayerStats.GuiPlayerStats): #end def createStatsTable def reset_style_render_func(self, treeviewcolumn, cell, model, iter): - cell.set_property('foreground', 'black') + cell.set_property('foreground', None) #end def reset_style_render_func def ledger_style_render_func(self, tvcol, cell, model, iter): diff --git a/pyfpdb/GuiTourneyPlayerStats.py b/pyfpdb/GuiTourneyPlayerStats.py index 0b830547..672b4eb7 100644 --- a/pyfpdb/GuiTourneyPlayerStats.py +++ b/pyfpdb/GuiTourneyPlayerStats.py @@ -434,7 +434,7 @@ class GuiTourneyPlayerStats (GuiPlayerStats.GuiPlayerStats): #end def refreshStats def reset_style_render_func(self, treeviewcolumn, cell, model, iter): - cell.set_property('foreground', 'black') + cell.set_property('foreground', None) #end def reset_style_render_func def sortCols(self, col, nums): From e2374c60ce28ae1efa31399caa07e882526093f5 Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 6 Feb 2011 13:52:41 +0800 Subject: [PATCH 2/6] GuiPrefs: Fix L10n. Appears to have been missed during the transition --- pyfpdb/GuiPrefs.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pyfpdb/GuiPrefs.py b/pyfpdb/GuiPrefs.py index 6c8c6210..166a2500 100755 --- a/pyfpdb/GuiPrefs.py +++ b/pyfpdb/GuiPrefs.py @@ -15,6 +15,9 @@ #along with this program. If not, see . #In the "official" distribution you can find the license in agpl-3.0.txt. +import L10n +_ = L10n.get_translation() + import xml.dom.minidom from xml.dom.minidom import Node @@ -23,18 +26,6 @@ pygtk.require('2.0') import gtk import gobject -import locale -lang=locale.getdefaultlocale()[0][0:2] -if lang=="en": - def _(string): return string -else: - import gettext - try: - trans = gettext.translation("fpdb", localedir="locale", languages=[lang]) - trans.install() - except IOError: - def _(string): return string - import Configuration rewrite = { 'general' : 'General', 'supported_databases' : 'Databases' From c7e289819cb236b21f3f083b564c8073fd5a54a6 Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 6 Feb 2011 14:03:11 +0800 Subject: [PATCH 3/6] GuiPositionalStats: Fix L10n. Appears to have been missed or reverted since the transition --- pyfpdb/GuiPositionalStats.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/pyfpdb/GuiPositionalStats.py b/pyfpdb/GuiPositionalStats.py index 06d28883..fc7ab83c 100644 --- a/pyfpdb/GuiPositionalStats.py +++ b/pyfpdb/GuiPositionalStats.py @@ -15,6 +15,9 @@ #along with this program. If not, see . #In the "official" distribution you can find the license in agpl-3.0.txt. +import L10n +_ = L10n.get_translation() + import threading import pygtk pygtk.require('2.0') @@ -22,18 +25,6 @@ import gtk import os from time import time, strftime -import locale -lang=locale.getdefaultlocale()[0][0:2] -if lang=="en": - def _(string): return string -else: - import gettext - try: - trans = gettext.translation("fpdb", localedir="locale", languages=[lang]) - trans.install() - except IOError: - def _(string): return string - import fpdb_import import Database import Filters From 1f413483f4a55161240dbac4e26feccf930454c0 Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 6 Feb 2011 15:57:32 +0800 Subject: [PATCH 4/6] HUD_main: Fix L10n. Appears to have been missed or reverted since the transition --- pyfpdb/HUD_main.pyw | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/pyfpdb/HUD_main.pyw b/pyfpdb/HUD_main.pyw index 4a8cbc0d..fbbab1ee 100755 --- a/pyfpdb/HUD_main.pyw +++ b/pyfpdb/HUD_main.pyw @@ -23,6 +23,9 @@ Main for FreePokerTools HUD. """ +import L10n +_ = L10n.get_translation() + # Standard Library modules import sys import os @@ -51,21 +54,6 @@ elif sys.platform == 'darwin': else: # This is bad--figure out the values for the various windows flavors import WinTables as Tables -import locale -lang = locale.getdefaultlocale()[0][0:2] -print "lang:", lang -if lang == "en": - def _(string): - return string -else: - import gettext - try: - trans = gettext.translation("fpdb", localedir="locale", languages=[lang]) - trans.install() - except IOError: - def _(string): - return string - # get config and set up logger c = Configuration.Config(file=options.config, dbname=options.dbname) log = Configuration.get_logger("logging.conf", "hud", log_dir=c.dir_log, log_file='HUD-log.txt') From 83b7e849e37e91e3d279eac4f8833b9a3d5becff Mon Sep 17 00:00:00 2001 From: Chris Moore Date: Sat, 5 Feb 2011 22:51:08 -0800 Subject: [PATCH 5/6] 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'. --- pyfpdb/Filters.py | 49 +++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/pyfpdb/Filters.py b/pyfpdb/Filters.py index a4660eb2..c1349367 100644 --- a/pyfpdb/Filters.py +++ b/pyfpdb/Filters.py @@ -420,12 +420,15 @@ class Filters(threading.Thread): self.limits[limit] = w.get_active() 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')): + # turning a leaf limit on with 'None' checked turns 'None' off if self.limits[limit]: if self.cbNoLimits is not None: self.cbNoLimits.set_active(False) + # turning a leaf limit off with 'All' checked turns 'All' off else: if self.cbAllLimits is not None: self.cbAllLimits.set_active(False) + # turning off a leaf limit turns off the corresponding fl. nl, or pl if not self.limits[limit]: if limit.isdigit(): if self.cbFL is not None: @@ -438,24 +441,28 @@ class Filters(threading.Thread): self.cbPL.set_active(False) elif limit == "all": if self.limits[limit]: - #for cb in self.cbLimits.values(): - # cb.set_active(True) - if self.cbFL is not None: - self.cbFL.set_active(True) - if self.cbNL is not None: - self.cbNL.set_active(True) - if self.cbPL is not None: - self.cbPL.set_active(True) + if self.num_limit_types == 1: + for cb in self.cbLimits.values(): + cb.set_active(True) + else: + if self.cbFL is not None: + self.cbFL.set_active(True) + if self.cbNL is not None: + self.cbNL.set_active(True) + if self.cbPL is not None: + self.cbPL.set_active(True) elif limit == "none": if self.limits[limit]: - for cb in self.cbLimits.values(): - cb.set_active(False) - if self.cbNL is not None: - self.cbNL.set_active(False) - if self.cbFL is not None: - self.cbFL.set_active(False) - if self.cbPL is not None: - self.cbPL.set_active(False) + if self.num_limit_types == 1: + for cb in self.cbLimits.values(): + cb.set_active(False) + else: + if self.cbNL is not None: + self.cbNL.set_active(False) + if self.cbFL is not None: + self.cbFL.set_active(False) + if self.cbPL is not None: + self.cbPL.set_active(False) elif limit == "fl": if not self.limits[limit]: # only toggle all fl limits off if they are all currently on @@ -765,11 +772,11 @@ class Filters(threading.Thread): dest = vbox3 # for ring/tour buttons if "LimitType" in display and display["LimitType"] == True: - 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: + self.num_limit_types = 0 + 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['nl']: self.num_limit_types = self.num_limit_types + 1 + if self.num_limit_types > 1: if self.found['fl']: hbox = gtk.HBox(False, 0) vbox3.pack_start(hbox, False, False, 0) From 44a3392334b8fd6d9ede8084c19075cdfacde8ea Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Thu, 7 Apr 2011 00:04:48 +0200 Subject: [PATCH 6/6] spell portuguese correctly.. --- packaging/gentoo/current.ebuild | 2 +- packaging/gentoo/fpdb-9999.ebuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/gentoo/current.ebuild b/packaging/gentoo/current.ebuild index 76c2c86d..859b731b 100644 --- a/packaging/gentoo/current.ebuild +++ b/packaging/gentoo/current.ebuild @@ -64,7 +64,7 @@ src_install() { fi if use linguas_pt; then - msgfmt pyfpdb/locale/fpdb-pt_BR.po -o pyfpdb/locale/pt.mo || die "failed to create Portugese mo file" + msgfmt pyfpdb/locale/fpdb-pt_BR.po -o pyfpdb/locale/pt.mo || die "failed to create Portuguese mo file" fi if use linguas_ru; then diff --git a/packaging/gentoo/fpdb-9999.ebuild b/packaging/gentoo/fpdb-9999.ebuild index d5596f92..abf46541 100644 --- a/packaging/gentoo/fpdb-9999.ebuild +++ b/packaging/gentoo/fpdb-9999.ebuild @@ -67,7 +67,7 @@ src_install() { fi if use linguas_pt; then - msgfmt pyfpdb/locale/fpdb-pt_BR.po -o pyfpdb/locale/pt.mo || die "failed to create Portugese mo file" + msgfmt pyfpdb/locale/fpdb-pt_BR.po -o pyfpdb/locale/pt.mo || die "failed to create Portuguese mo file" fi if use linguas_ru; then