[ocrfeeder] Remove the image stroke color option from Preferences
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ocrfeeder] Remove the image stroke color option from Preferences
- Date: Thu, 1 Jul 2010 07:20:16 +0000 (UTC)
commit cbd488b79ba2ed3f7b00c20f0e59371c8785e3fc
Author: Joaquim Rocha <jrocha igalia com>
Date: Wed Jun 30 09:53:55 2010 +0200
Remove the image stroke color option from Preferences
Remove that control as it was not being totally honored and make the
text stroke color become the general boxes' stroke color.
studio/configuration.py | 17 +++++------------
studio/widgetModeler.py | 25 +++++++++----------------
studio/widgetPresenter.py | 19 +++++++------------
3 files changed, 21 insertions(+), 40 deletions(-)
---
diff --git a/studio/configuration.py b/studio/configuration.py
index 6c0771d..a239ea7 100644
--- a/studio/configuration.py
+++ b/studio/configuration.py
@@ -257,9 +257,8 @@ class ConfigurationManager:
DEFAULTS = {'temporary_dir': '/tmp',
'text_fill': '94, 156, 235, 150',
- 'text_stroke': '94, 156, 235, 250',
+ 'boxes_stroke': '94, 156, 235, 250',
'image_fill': '0, 183, 0, 150',
- 'image_stroke': '94, 156, 235, 250',
'window_size': 'auto',
'unpaper': '/usr/bin/unpaper',
'favorite_engine': 'ocrad'
@@ -321,27 +320,21 @@ class ConfigurationManager:
def setTextFill(self, color):
self.text_fill = self.__getColorString(color)
- def setTextStroke(self, color):
- self.text_stroke = self.__getColorString(color)
+ def setBoxesStroke(self, color):
+ self.boxes_stroke = self.__getColorString(color)
def setImageFill(self, color):
self.image_fill = self.__getColorString(color)
- def setImageStroke(self, color):
- self.image_stroke = self.__getColorString(color)
-
def getTextFill(self):
return eval(self.text_fill)
- def getTextStroke(self):
- return eval(self.text_stroke)
+ def getBoxesStroke(self):
+ return eval(self.boxes_stroke)
def getImageFill(self):
return eval(self.image_fill)
- def getImageStroke(self):
- return eval(self.image_stroke)
-
def setWindowSize(self, window_size):
self.window_size = window_size
diff --git a/studio/widgetModeler.py b/studio/widgetModeler.py
index 6ad0c7d..31d4f6c 100644
--- a/studio/widgetModeler.py
+++ b/studio/widgetModeler.py
@@ -164,9 +164,8 @@ class ImageReviewer:
self.main_window = main_window
self.path_to_image = path_to_image
self.text_box_fill_color = (94, 156, 235, 150)
- self.text_box_stroke_color = (94, 156, 235, 250)
+ self.box_stroke_color = (94, 156, 235, 250)
self.image_box_fill_color = (0, 183, 0, 150)
- self.image_box_stroke_color = (94, 156, 235, 250)
self.selectable_boxes_area = SelectableBoxesArea(self.path_to_image)
self.selectable_boxes_area.connect('selected_box', self.selectedBox)
self.selectable_boxes_area.connect('removed_box', self.removedBox)
@@ -201,16 +200,13 @@ class ImageReviewer:
self.text_box_fill_color = color
self.selectable_boxes_area.setAreaFillRgba(self.text_box_fill_color)
- def setTextStrokeColor(self, color):
- self.text_box_stroke_color = color
- self.selectable_boxes_area.setAreaStrokeRgba(self.text_box_stroke_color)
+ def setBoxesStrokeColor(self, color):
+ self.box_stroke_color = color
+ self.selectable_boxes_area.setAreaStrokeRgba(self.box_stroke_color)
def setImageFillColor(self, color):
self.image_box_fill_color = color
- def setImageStrokeColor(self, color):
- self.image_box_stroke_color = color
-
def addBoxEditor(self, box):
editor = Editor(box, self.image_pixbuf, self.ocr_engines, self)
self.editor_list.append(editor)
@@ -265,11 +261,11 @@ class ImageReviewer:
def applyTextColors(self):
self.selectable_boxes_area.fill_color_rgba = self.text_box_fill_color
- self.selectable_boxes_area.stroke_color_rgba = self.text_box_stroke_color
+ self.selectable_boxes_area.stroke_color_rgba = self.box_stroke_color
def applyImageColors(self):
self.selectable_boxes_area.fill_color_rgba = self.image_box_fill_color
- self.selectable_boxes_area.stroke_color_rgba = self.image_box_stroke_color
+ self.selectable_boxes_area.stroke_color_rgba = self.box_stroke_color
def addNewEditorsToAllBoxes(self):
self.editor_list = []
@@ -378,9 +374,8 @@ class ImageReviewer_Controler:
image_reviewer = ImageReviewer(self.main_window, image, self.ocr_engines)
image_reviewer.selectable_boxes_area.connect('changed_zoom', self.__setZoomStatus)
image_reviewer.setTextFillColor(self.configuration_manager.getTextFill())
- image_reviewer.setTextStrokeColor(self.configuration_manager.getTextStroke())
+ image_reviewer.setBoxesStrokeColor(self.configuration_manager.getBoxesStroke())
image_reviewer.setImageFillColor(self.configuration_manager.getImageFill())
- image_reviewer.setImageStrokeColor(self.configuration_manager.getImageStroke())
self.image_reviewer_dict[pixbuf] = image_reviewer
self.addImageReviewer(image_reviewer.reviewer_area)
return image_reviewer
@@ -620,9 +615,8 @@ class ImageReviewer_Controler:
def updateFromConfiguration(self):
for reviewer in self.image_reviewer_dict.values():
reviewer.setTextFillColor(self.configuration_manager.getTextFill())
- reviewer.setTextStrokeColor(self.configuration_manager.getTextStroke())
+ reviewer.setBoxesStrokeColor(self.configuration_manager.getBoxesStroke())
reviewer.setImageFillColor(self.configuration_manager.getImageFill())
- reviewer.setImageStrokeColor(self.configuration_manager.getImageStroke())
reviewer.updateBoxesColors()
def zoomIn(self, zoom_value = 0.05):
@@ -721,11 +715,10 @@ class Editor:
def updateBoxColor(self, type = None):
type = type or self.data_box.getType()
+ stroke_color = graphics.rgbaToInteger(self.reviewer.box_stroke_color)
fill_color = graphics.rgbaToInteger(self.reviewer.image_box_fill_color)
- stroke_color = graphics.rgbaToInteger(self.reviewer.image_box_stroke_color)
if type == TEXT_TYPE:
fill_color = graphics.rgbaToInteger(self.reviewer.text_box_fill_color)
- stroke_color = graphics.rgbaToInteger(self.reviewer.text_box_stroke_color)
self.box.set_property('fill-color-rgba', fill_color)
self.box.set_property('stroke-color-rgba', stroke_color)
diff --git a/studio/widgetPresenter.py b/studio/widgetPresenter.py
index 902b8a4..4101673 100644
--- a/studio/widgetPresenter.py
+++ b/studio/widgetPresenter.py
@@ -1027,9 +1027,9 @@ class PreferencesDialog(gtk.Dialog):
self.configuration_manager.setTemporaryDir(self.__getTemporaryDir())
self.configuration_manager.setWindowSize(self.__getWindowSize())
self.configuration_manager.setTextFill(self.__getColor(self.text_fill_color))
- self.configuration_manager.setTextStroke(self.__getColor(self.text_stroke_color))
+ self.configuration_manager.setBoxesStroke(
+ self.__getColor(self.boxes_stroke_color))
self.configuration_manager.setImageFill(self.__getColor(self.image_fill_color))
- self.configuration_manager.setImageStroke(self.__getColor(self.image_stroke_color))
self.configuration_manager.setUnpaper(self.unpaper_entry.get_text())
index = self.engines_combo.get_active()
if index != -1:
@@ -1069,26 +1069,21 @@ class PreferencesDialog(gtk.Dialog):
def __makeColors(self):
colors_frame = PlainFrame(_('Select boxes\' colors'))
self.text_fill_color = self.__getColorButton(self.configuration_manager.text_fill)
- self.text_stroke_color = self.__getColorButton(self.configuration_manager.text_stroke)
+ self.boxes_stroke_color = self.__getColorButton(self.configuration_manager.boxes_stroke)
self.image_fill_color = self.__getColorButton(self.configuration_manager.image_fill)
- self.image_stroke_color = self.__getColorButton(self.configuration_manager.image_stroke)
text_fill_color_box = gtk.HBox(spacing = 10)
text_fill_color_box.pack_start(self.text_fill_color, False)
text_fill_color_box.pack_start(gtk.Label(_('Text fill color')), False)
- text_stroke_color_box = gtk.HBox(spacing = 10)
- text_stroke_color_box.pack_start(self.text_stroke_color, False)
- text_stroke_color_box.pack_start(gtk.Label(_('Text stroke color')), False)
+ boxes_stroke_color_box = gtk.HBox(spacing = 10)
+ boxes_stroke_color_box.pack_start(self.boxes_stroke_color, False)
+ boxes_stroke_color_box.pack_start(gtk.Label(_('Areas stroke color')), False)
image_fill_color_box = gtk.HBox(spacing = 10)
image_fill_color_box.pack_start(self.image_fill_color, False)
image_fill_color_box.pack_start(gtk.Label(_('Image fill color')), False)
- image_stroke_color_box = gtk.HBox(spacing = 10)
- image_stroke_color_box.pack_start(self.image_stroke_color, False)
- image_stroke_color_box.pack_start(gtk.Label(_('Image stroke color')), False)
colors_box = gtk.VBox()
colors_box.pack_start(text_fill_color_box, False)
- colors_box.pack_start(text_stroke_color_box, False)
+ colors_box.pack_start(boxes_stroke_color_box, False)
colors_box.pack_start(image_fill_color_box, False)
- colors_box.pack_start(image_stroke_color_box, False)
colors_frame.add(colors_box)
return colors_frame
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]