From d7c48d27d8f9800009f75425d4292ac26d0707a8 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Tue, 6 Nov 2018 12:56:52 +0000 Subject: [PATCH] [Label] Fix mnemonic labels Remove the icons to simplify code since ImageMenuItem is deprecated. --- .../deluge/plugins/label/gtkui/sidebar_menu.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/deluge/plugins/Label/deluge/plugins/label/gtkui/sidebar_menu.py b/deluge/plugins/Label/deluge/plugins/label/gtkui/sidebar_menu.py index 1fb9ce39c..34358db6e 100644 --- a/deluge/plugins/Label/deluge/plugins/label/gtkui/sidebar_menu.py +++ b/deluge/plugins/Label/deluge/plugins/label/gtkui/sidebar_menu.py @@ -43,9 +43,9 @@ class LabelSidebarMenu(object): sep = Gtk.SeparatorMenuItem() self.items.append(sep) self.menu.prepend(sep) - self._add_item('options', _('Label _Options'), Gtk.STOCK_PREFERENCES) - self._add_item('remove', _('_Remove Label'), Gtk.STOCK_REMOVE) - self._add_item('add', _('_Add Label'), Gtk.STOCK_ADD) + self._add_item('options', _('Label _Options')) + self._add_item('remove', _('_Remove Label')) + self._add_item('add', _('_Add Label')) self.menu.show_all() # dialogs: @@ -54,13 +54,12 @@ class LabelSidebarMenu(object): # hooks: self.menu.connect('show', self.on_show, None) - def _add_item(self, item_id, label, stock): - """I hate glade. + def _add_item(self, item_id, label): + """ id is automatically-added as self.item_ """ + item = Gtk.MenuItem.new_with_mnemonic(label) func = getattr(self, 'on_%s' % item_id) - item = Gtk.ImageMenuItem(stock) - item.get_children()[0].set_label(label) item.connect('activate', func) self.menu.prepend(item) setattr(self, 'item_%s' % item_id, item)