merge changes from gramps20

svn: r5482
This commit is contained in:
Alex Roitman
2005-12-06 06:38:09 +00:00
parent e0ff843bb4
commit 2f962b5f96
202 changed files with 112821 additions and 41664 deletions

View File

@@ -27,34 +27,46 @@ present, we default to no spell checking.
"""
#### FIXME: Uncomment after 2.0.6 is released.
import GrampsKeys
## success = False
## try:
## import gtk
## import gtkspell
## import locale
from gettext import gettext as _
## text_view = gtk.TextView()
## spell = gtkspell.Spell(text_view)
## lang = locale.getlocale()[0]
## spell.set_language(lang)
## success = True
#-----------------------------------------------------------
#
# Attempt to instantiate a gtkspell instance to check for
# any errors. If it succeeds, set a success flag so that we
# know to use the spelling check in the future
#
#------------------------------------------------------------
## except ImportError, msg:
## print "Spell.py:", msg
## except RuntimeError,msg:
## print "Spell.py:", msg
## except SystemError,msg:
## print "Spell.py:", msg
success = False
try:
import gtk
import gtkspell
import locale
if False:
class Spell:
def __init__(self,obj):
lang = locale.getlocale()[0]
gtkspell.Spell(gtk.TextView()).set_language(lang)
success = True
except ImportError, msg:
print _("Spelling checker is not installed")
except RuntimeError,msg:
print "Spell.py: ", msg
except SystemError,msg:
msg = _("Spelling checker is not available for %s") % lang
print "Spell.py: %s" % msg
#-----------------------------------------------------------
#
# Spell - if the initial test succeeded, attach a gtkspell
# instance to the passed TextView instance
#
#------------------------------------------------------------
class Spell:
def __init__(self,obj):
if success and GrampsKeys.get_spellcheck():
self.spell = gtkspell.Spell(obj)
lang = locale.getlocale()[0]
self.spell.set_language(lang)
else:
class Spell:
def __init__(self,obj):
pass