[ocrfeeder] Add menu to select all areas



commit 8440833e1175edc145d9b1e489a910b57ab955f5
Author: Joaquim Rocha <jrocha igalia com>
Date:   Mon Jun 28 11:49:57 2010 +0200

    Add menu to select all areas

 studio/studioBuilder.py   |    1 +
 studio/widgetModeler.py   |    4 ++++
 studio/widgetPresenter.py |    8 +++++++-
 3 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/studio/studioBuilder.py b/studio/studioBuilder.py
index d81bdf8..585254c 100644
--- a/studio/studioBuilder.py
+++ b/studio/studioBuilder.py
@@ -98,6 +98,7 @@ class Studio:
                                  'recognize_areas': self.source_images_controler.recognizeSelectedAreas,
                                  'select_next_area': self.source_images_controler.selectNextArea,
                                  'select_previous_area': self.source_images_controler.selectPreviousArea,
+                                 'select_all_areas': self.source_images_controler.selectAllAreas,
                                  }
         
         self.main_window.setHeader(menubar_callback_dict, toolbar_callback_dict)
diff --git a/studio/widgetModeler.py b/studio/widgetModeler.py
index 34493a8..6ad0c7d 100644
--- a/studio/widgetModeler.py
+++ b/studio/widgetModeler.py
@@ -649,6 +649,10 @@ class ImageReviewer_Controler:
         current_reviewer = self.__getCurrentReviewer()
         current_reviewer.selectable_boxes_area.selectNextArea()
 
+    def selectAllAreas(self, widget):
+        current_reviewer = self.__getCurrentReviewer()
+        current_reviewer.selectable_boxes_area.selectAllAreas()
+
 class Editor:
     
     def __init__(self, box, pixbuf, ocr_engines, reviewer):
diff --git a/studio/widgetPresenter.py b/studio/widgetPresenter.py
index 4d86e9b..b894e27 100644
--- a/studio/widgetPresenter.py
+++ b/studio/widgetPresenter.py
@@ -74,6 +74,7 @@ class MainWindow:
         <menu action="Document">
             <menuitem action="OCRFeederDetection"/>
             <menuitem action="RecognizeAreas"/>
+            <menuitem action="SelectAllAreas"/>
             <menuitem action="SelectPreviousArea"/>
             <menuitem action="SelectNextArea"/>
         </menu>
@@ -162,6 +163,10 @@ class MainWindow:
                                   ('About', gtk.STOCK_ABOUT, _('_About'), None, _('About this application'), menu_items['about']),
                                   ('OCRFeederDetection', None, _('_Recognize Document'), None, _("Automatic Detection and Recognition"), tool_items['detection']),
                                   ('RecognizeAreas', None, _('Recognize Selected _Areas'), None, _("Recognize Selected Areas"), menu_items['recognize_areas']),
+                                  ('SelectAllAreas', None,
+                                   _('Select All _Areas'), '<control>a',
+                                   _("Select all content areas"),
+                                   menu_items['select_all_areas']),
                                   ('SelectPreviousArea', gtk.STOCK_GO_BACK,
                                    _('Select _Previous Area'), None,
                                    _("Select the previous area from the content areas"),
@@ -218,7 +223,8 @@ class MainWindow:
         self.__setActionsSensitiveness(actions, has_selected_boxes)
 
     def setHasContentBoxes(self, has_content_boxes=True):
-        actions = ['SelectNextArea', 'SelectPreviousArea']
+        actions = ['SelectNextArea', 'SelectPreviousArea',
+                   'SelectAllAreas']
         self.__setActionsSensitiveness(actions, has_content_boxes)
 
     def __setActionsSensitiveness(self, actions, set_sensitive):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]