[ocrfeeder/master-wip: 2/5] Warn when no OCR engines are found on startup
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ocrfeeder/master-wip: 2/5] Warn when no OCR engines are found on startup
- Date: Fri, 1 Aug 2014 09:49:54 +0000 (UTC)
commit 94790fe131d787b8ddbf39a370b1cc1d917d5580
Author: Joaquim Rocha <me joaquimrocha com>
Date: Wed Jul 30 23:56:35 2014 +0200
Warn when no OCR engines are found on startup
src/ocrfeeder/studio/studioBuilder.py | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/ocrfeeder/studio/studioBuilder.py b/src/ocrfeeder/studio/studioBuilder.py
index 0baaf59..7198068 100644
--- a/src/ocrfeeder/studio/studioBuilder.py
+++ b/src/ocrfeeder/studio/studioBuilder.py
@@ -156,6 +156,9 @@ class Studio:
self._last_images_dir = ''
+ if not self.ocr_engines:
+ self.warnNoOCREngines()
+
def run(self):
Gdk.threads_init()
Gtk.main()
@@ -381,6 +384,26 @@ class Studio:
self.source_images_controler.updateOcrEngines(ocr_engines)
ocr_dialog.destroy()
+ def warnNoOCREngines(self):
+ lib.debug('No OCR engines found')
+ dialog = Gtk.MessageDialog(self.main_window.window,
+ Gtk.DialogFlags.MODAL |
+ Gtk.DialogFlags.DESTROY_WITH_PARENT,
+ Gtk.MessageType.INFO)
+ dialog.set_title(_('No OCR engines available'))
+ dialog.set_markup(_('No OCR engines were found in the system.\n'
+ 'Please make sure you have OCR engines installed '
+ 'and available.'))
+ dialog.add_buttons(_('_Ignore'),
+ Gtk.ResponseType.CANCEL,
+ _('_Open OCR Engines Manager Dialog'),
+ Gtk.ResponseType.OK)
+
+ response = dialog.run()
+ dialog.destroy()
+ if response == Gtk.ResponseType.OK:
+ self.ocrEngines()
+
def enginesTool(self, widget = None):
pass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]