Changeset 65921b53b7ed…
Parent f62bc272bec9…
by
Changes to 4 files · Browse files at 65921b53b7ed Showing diff from parent f62bc272bec9 Diff from another changeset...
@@ -292,7 +292,7 @@ self.text.connect('populate-popup', self.msg_add_to_popup)
self.text.modify_font(pango.FontDescription(self.fontcomment))
scroller.add(self.text)
- gtklib.addspellcheck(self.text)
+ gtklib.addspellcheck(self.text, self.repo.ui)
self.vpaned = gtk.VPaned()
self.vpaned.add1(vbox)
|
@@ -319,10 +319,13 @@ return fname
return None
-def addspellcheck(textview):
+def addspellcheck(textview, ui=None):
+ lang = None
+ if ui:
+ lang = ui.config('tortoisehg', 'spellcheck', None)
try:
import gtkspell
- gtkspell.Spell(textview)
+ gtkspell.Spell(textview, lang)
except ImportError:
pass
else:
@@ -364,3 +367,11 @@ menu.append(item)
item.show()
textview.connect('populate-popup', langmenu)
+
+def hasspellcheck():
+ try:
+ import gtkspell
+ gtkspell.Spell
+ return True
+ except ImportError:
+ return False
|
@@ -178,7 +178,6 @@ self.descview.set_editable(True)
self.descview.modify_font(pango.FontDescription('Monospace'))
self.descbuffer = self.descview.get_buffer()
- gtklib.addspellcheck(self.descview)
scrolledwindow = gtk.ScrolledWindow()
scrolledwindow.set_shadow_type(gtk.SHADOW_ETCHED_IN)
scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
@@ -231,6 +230,7 @@ ' the effects of the entire patch series. When emailing'
' a bundle, these fields make up the message subject and body.')
)
+ gtklib.addspellcheck(self.descview, self.repo.ui)
fill_history(history, self._tolist, 'email.to')
fill_history(history, self._cclist, 'email.cc')
fill_history(history, self._fromlist, 'email.from')
|
@@ -557,9 +557,18 @@ self.tooltips = gtk.Tooltips()
self.history = settings.Settings('thgconfig')
+ # add spell ckeck entry if spell check is supported
+ tortoise_info = _tortoise_info
+ if gtklib.hasspellcheck():
+ tortoise_info += ((
+ _('Spell Check Language'), 'tortoisehg.spellcheck', [],
+ _('Default language for spell check. '
+ 'System language is used if not specified. '
+ 'Examples: en, en_GB, en_US')),)
+
# create pages for each section of configuration file
self.tortoise_frame = self.add_page(notebook, 'TortoiseHG')
- self.fill_frame(self.tortoise_frame, _tortoise_info)
+ self.fill_frame(self.tortoise_frame, tortoise_info)
self.commit_frame = self.add_page(notebook, _('Commit'))
self.fill_frame(self.commit_frame, _commit_info)
|
Loading...