mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-10 18:36:34 +00:00
[Label] Fix mnemonic labels
Remove the icons to simplify code since ImageMenuItem is deprecated.
This commit is contained in:
parent
1bc766213c
commit
d7c48d27d8
@ -43,9 +43,9 @@ class LabelSidebarMenu(object):
|
|||||||
sep = Gtk.SeparatorMenuItem()
|
sep = Gtk.SeparatorMenuItem()
|
||||||
self.items.append(sep)
|
self.items.append(sep)
|
||||||
self.menu.prepend(sep)
|
self.menu.prepend(sep)
|
||||||
self._add_item('options', _('Label _Options'), Gtk.STOCK_PREFERENCES)
|
self._add_item('options', _('Label _Options'))
|
||||||
self._add_item('remove', _('_Remove Label'), Gtk.STOCK_REMOVE)
|
self._add_item('remove', _('_Remove Label'))
|
||||||
self._add_item('add', _('_Add Label'), Gtk.STOCK_ADD)
|
self._add_item('add', _('_Add Label'))
|
||||||
|
|
||||||
self.menu.show_all()
|
self.menu.show_all()
|
||||||
# dialogs:
|
# dialogs:
|
||||||
@ -54,13 +54,12 @@ class LabelSidebarMenu(object):
|
|||||||
# hooks:
|
# hooks:
|
||||||
self.menu.connect('show', self.on_show, None)
|
self.menu.connect('show', self.on_show, None)
|
||||||
|
|
||||||
def _add_item(self, item_id, label, stock):
|
def _add_item(self, item_id, label):
|
||||||
"""I hate glade.
|
"""
|
||||||
id is automatically-added as self.item_<id>
|
id is automatically-added as self.item_<id>
|
||||||
"""
|
"""
|
||||||
|
item = Gtk.MenuItem.new_with_mnemonic(label)
|
||||||
func = getattr(self, 'on_%s' % item_id)
|
func = getattr(self, 'on_%s' % item_id)
|
||||||
item = Gtk.ImageMenuItem(stock)
|
|
||||||
item.get_children()[0].set_label(label)
|
|
||||||
item.connect('activate', func)
|
item.connect('activate', func)
|
||||||
self.menu.prepend(item)
|
self.menu.prepend(item)
|
||||||
setattr(self, 'item_%s' % item_id, item)
|
setattr(self, 'item_%s' % item_id, item)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user