def spellcheck(self):
global spell_support
spell_error = False
if self.posix and spell_support:
if self.config.get('gtkspell', False, section='spell') == True:
if self.config.get('notes', True, section='spell') is True and self.config.get('lang', section='spell') != '':
try:
self.notes_spell = gtkspell.Spell(self.widgets['add']['notes'], self.config.get('lang', section='spell'))
except:
spell_error = True
if self.config.get('plot', True, section='spell') is True and self.config.get('lang', section='spell') != '':
try:
self.plot_spell = gtkspell.Spell(self.widgets['add']['plot'], self.config.get('lang', section='spell'))
except:
spell_error = True
if spell_error:
log.info('Dictionary not available. Spell check will be disabled.')
if not self.config.get('notified', False, section='spell'):
gutils.info(_("Dictionary not available. Spellcheck will be disabled. \n" + \
"Please install the aspell-%s package or adjust the spellchecker preferences.") % self.config.get('lang', section='spell'), \
self.widgets['preferences']['window'])
self.config.set('notified', True, section='spell')
self.config.save()
else:
log.info('Spellchecker is not available')
评论列表
文章目录