[ocrfeeder/introspection] Remove popup menu in the pages area



commit d496c79cc06d8c17769195ca476fc9fd37db7481
Author: Joaquim Rocha <me joaquimrocha com>
Date:   Sun Jul 20 20:48:20 2014 +0200

    Remove popup menu in the pages area
    
    This removal is in order to prevent an error which seems to be
    caused by some bug in the GI. It should be better investigated in
    the future.

 src/ocrfeeder/studio/pagesiconview.py   |    8 --------
 src/ocrfeeder/studio/widgetModeler.py   |    2 +-
 src/ocrfeeder/studio/widgetPresenter.py |   13 -------------
 3 files changed, 1 insertions(+), 22 deletions(-)
---
diff --git a/src/ocrfeeder/studio/pagesiconview.py b/src/ocrfeeder/studio/pagesiconview.py
index b6563d2..8f2c278 100644
--- a/src/ocrfeeder/studio/pagesiconview.py
+++ b/src/ocrfeeder/studio/pagesiconview.py
@@ -91,14 +91,6 @@ class PagesIconView(Gtk.IconView):
         self.pack_start(text_renderer, False)
         self.add_attribute(text_renderer, 'text', 0)
         area = self.get_area()
-        self.connect('button-press-event', self.pressedRightButton)
-
-    def pressedRightButton(self, target, event):
-        if event.button == 3:
-            selected_items = self.get_selected_items()
-            if selected_items:
-                menu = getPopupMenu([(Gtk.STOCK_DELETE, _('Delete'), self.delete_current_page_function)])
-                menu.popup(None, None, None, event.button, event.time)
 
     def getSelectedPageData(self):
         selected_items = self.get_selected_items()
diff --git a/src/ocrfeeder/studio/widgetModeler.py b/src/ocrfeeder/studio/widgetModeler.py
index 6c0b52e..d875f71 100644
--- a/src/ocrfeeder/studio/widgetModeler.py
+++ b/src/ocrfeeder/studio/widgetModeler.py
@@ -31,7 +31,7 @@ from ocrfeeder.util.configuration import ConfigurationManager
 from ocrfeeder.util import constants
 from ocrfeeder.util.asyncworker import AsyncItem
 from widgetPresenter import BoxEditor, PagesToExportDialog, FileDialog, \
-    PageSizeDialog, getPopupMenu, WarningDialog, UnpaperDialog, \
+    PageSizeDialog, WarningDialog, UnpaperDialog, \
     QueuedEventsProgressDialog, SpellCheckerDialog
 import gettext
 from gi.repository import Gtk, GObject, Gdk, GdkPixbuf, Pango
diff --git a/src/ocrfeeder/studio/widgetPresenter.py b/src/ocrfeeder/studio/widgetPresenter.py
index 30d4818..47e738e 100644
--- a/src/ocrfeeder/studio/widgetPresenter.py
+++ b/src/ocrfeeder/studio/widgetPresenter.py
@@ -1990,19 +1990,6 @@ class CustomAboutDialog(Gtk.AboutDialog):
         self.set_translator_credits(_('translator-credits'))
         self.set_icon_from_file(WINDOW_ICON)
 
-def getPopupMenu(menus_info):
-    menu = Gtk.Menu()
-    for menu_info in menus_info:
-        image, name, callback = menu_info
-        if image:
-            menu_item = Gtk.ImageMenuItem(image, name)
-        else:
-            menu_item = Gtk.MenuItem(name)
-        menu.append(menu_item)
-        menu_item.connect("activate", callback)
-        menu_item.show()
-    return menu
-
 class ScannerChooserDialog(Gtk.Dialog):
 
     def __init__(self, parent, devices):


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