[ocrfeeder] Abstracted the GTKActions sensitiveness setting



commit 0df28bf62005e62350b4e21ca2a654e4293a777a
Author: Joaquim Rocha <jrocha igalia com>
Date:   Thu Jun 24 16:55:36 2010 +0200

    Abstracted the GTKActions sensitiveness setting

 studio/widgetPresenter.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/studio/widgetPresenter.py b/studio/widgetPresenter.py
index 664a916..bc4b00d 100644
--- a/studio/widgetPresenter.py
+++ b/studio/widgetPresenter.py
@@ -206,17 +206,19 @@ class MainWindow:
                    'DeletePage', 'SaveProject', 'SaveProjectAs',
                    'OCRFeederDetection', 'EditPage', 'ClearProject',
                    'AppendProject', 'ZoomFit']
-        for gtkaction in [self.action_group.get_action(action) for action in actions]:
-            gtkaction.set_sensitive(has_images)
+        self.__setActionsSensitiveness(actions, has_images)
 
     def setHasSelectedBoxes(self, has_selected_boxes = True):
         if not self.action_group:
             return
         actions = ['RecognizeAreas']
+        self.__setActionsSensitiveness(actions, has_selected_boxes)
+
+    def __setActionsSensitiveness(self, actions, set_sensitive):
         for gtkaction in [self.action_group.get_action(action) \
                           for action in actions]:
-            gtkaction.set_sensitive(has_selected_boxes)
-        
+            gtkaction.set_sensitive(set_sensitive)
+
 class BoxEditor(gtk.ScrolledWindow):
     
     def __init__(self, image_width = 0, image_height = 0, pixbuf = 0, x = 0, y = 0, width = 0, height = 0, ocr_engines_list = []):



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