[ocrfeeder/langs: 11/15] Add default language settings to PreferencesDialog
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ocrfeeder/langs: 11/15] Add default language settings to PreferencesDialog
- Date: Tue, 5 Feb 2013 06:25:39 +0000 (UTC)
commit ebaddbcd96000d2e46092b28bd52977da993f981
Author: Joaquim Rocha <jrocha igalia com>
Date: Tue Jan 29 00:42:06 2013 +0100
Add default language settings to PreferencesDialog
src/ocrfeeder/studio/widgetPresenter.py | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/src/ocrfeeder/studio/widgetPresenter.py b/src/ocrfeeder/studio/widgetPresenter.py
index 614e286..9213b08 100644
--- a/src/ocrfeeder/studio/widgetPresenter.py
+++ b/src/ocrfeeder/studio/widgetPresenter.py
@@ -1299,7 +1299,8 @@ class PreferencesDialog(gtk.Dialog):
self.__makeToolsPreferences(self.__makeUnpaper(),
self.__makeEngines(),
self.__makePreProcessorPreferences())
- self.__makeRecognitionPreferences(self.__makeTextPreferences(),
+ self.__makeRecognitionPreferences(self.__makeLanguagePreferences(),
+ self.__makeTextPreferences(),
self.__makeWindowSize(),
self.__makeColumnDetectionPreferences(),
self.__makeBoundsAdjustmentsPreferences())
@@ -1335,6 +1336,7 @@ class PreferencesDialog(gtk.Dialog):
self.__getBoundsAdjustmentSize()
self.configuration_manager.deskew_images_after_addition = \
self.deskew_images.get_active()
+ self.configuration_manager.language = self.language_combo.getLanguage()
if self.configuration_manager.has_unpaper:
self.configuration_manager.unpaper_images_after_addition = \
self.unpaper_images.get_active()
@@ -1657,6 +1659,29 @@ class PreferencesDialog(gtk.Dialog):
unpaper_preferences.save()
unpaper_preferences.destroy()
+ def __makeLanguagePreferences(self):
+ frame = PlainFrame(_('Language'))
+ self.language_combo = LanguagesComboBox(use_icon = False)
+ self.language_combo.setLanguage(self.configuration_manager.language)
+ vbox = gtk.VBox()
+ label = gtk.Label(_('The language may affect how the OCR engines work.\n'
+ 'If an engine is set to support languages but does not '
+ 'support the one chosen, it may result in blank text.\n'
+ 'You can choose "No Language" to prevent this.'))
+ alignment = gtk.Alignment(0, 0, 1, 0)
+ alignment.add(label)
+ vbox.pack_start(alignment, False, False, 12)
+ label = gtk.Label(_('Default _language:'))
+ label.set_use_underline(True)
+ label.set_mnemonic_widget(self.language_combo)
+ hbox = gtk.HBox()
+ hbox.pack_start(label, False, False, 12)
+ self.language_combo.set_size_request(250, -1)
+ hbox.pack_start(self.language_combo, False, True, 12)
+ vbox.pack_start(hbox, False, False, 0)
+ frame.add(vbox)
+ return frame
+
class SystemEnginesDialog(gtk.Dialog):
def __init__(self, engines):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]