[ocrfeeder] Add the "delete selected areas" action
- From: Joaquim Manuel Pereira Rocha <jrocha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ocrfeeder] Add the "delete selected areas" action
- Date: Thu, 8 Jul 2010 16:08:18 +0000 (UTC)
commit 38a0d16d00ef435b2247e8a62e21f253cd660d10
Author: Joaquim Rocha <jrocha igalia com>
Date: Thu Jul 8 18:05:03 2010 +0200
Add the "delete selected areas" action
studioBuilder.Studio: Add the delete_selected_areas callback.
widgetModeler.ImageReviewer_Controller: Add the deleteSelectedAreas
function that wrap's the SelectableBoxesArea's one.
widgetPresenter.MainWindow: Add the DeleteSelectedAreas action and
respective menu item.
studio/studioBuilder.py | 1 +
studio/widgetModeler.py | 4 ++++
studio/widgetPresenter.py | 7 ++++++-
3 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/studio/studioBuilder.py b/studio/studioBuilder.py
index 6c2cbb5..f092667 100644
--- a/studio/studioBuilder.py
+++ b/studio/studioBuilder.py
@@ -100,6 +100,7 @@ class Studio:
'select_next_area': self.source_images_controler.selectNextArea,
'select_previous_area': self.source_images_controler.selectPreviousArea,
'select_all_areas': self.source_images_controler.selectAllAreas,
+ 'delete_selected_areas': self.source_images_controler.deleteSelectedAreas,
}
self.main_window.setHeader(menubar_callback_dict, toolbar_callback_dict)
diff --git a/studio/widgetModeler.py b/studio/widgetModeler.py
index 51dc92e..c27f288 100644
--- a/studio/widgetModeler.py
+++ b/studio/widgetModeler.py
@@ -676,6 +676,10 @@ class ImageReviewer_Controler:
current_reviewer = self.__getCurrentReviewer()
current_reviewer.selectable_boxes_area.selectAllAreas()
+ def deleteSelectedAreas(self, widget):
+ current_reviewer = self.__getCurrentReviewer()
+ current_reviewer.selectable_boxes_area.deleteSelectedAreas()
+
class Editor:
def __init__(self, box, pixbuf, ocr_engines, reviewer):
diff --git a/studio/widgetPresenter.py b/studio/widgetPresenter.py
index c9ed144..a42e10a 100644
--- a/studio/widgetPresenter.py
+++ b/studio/widgetPresenter.py
@@ -79,6 +79,7 @@ class MainWindow:
<menuitem action="SelectAllAreas"/>
<menuitem action="SelectPreviousArea"/>
<menuitem action="SelectNextArea"/>
+ <menuitem action="DeleteSelectedAreas"/>
</menu>
<menu action="Tools">
<menuitem action="OCREngines"/>
@@ -178,6 +179,10 @@ class MainWindow:
_('Select _Next Area'), '<control><shift>n',
_("Select the next area from the content areas"),
menu_items['select_next_area']),
+ ('DeleteSelectedAreas', gtk.STOCK_DELETE,
+ _('Delete Selected Areas'), '<control><shift>Delete',
+ _("Deletes all the currently selected content areas"),
+ menu_items['delete_selected_areas']),
('GenerateODT', None, _('_Generate ODT'), None, _("Export to ODT"), tool_items['export_to_odt']),
])
ui_manager.insert_action_group(action_group, 0)
@@ -222,7 +227,7 @@ class MainWindow:
def setHasSelectedBoxes(self, has_selected_boxes = True):
if not self.action_group:
return
- actions = ['RecognizeAreas']
+ actions = ['RecognizeAreas', 'DeleteSelectedAreas']
self.__setActionsSensitiveness(actions, has_selected_boxes)
def setHasContentBoxes(self, has_content_boxes=True):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]