=?UTF-8?q?Don=E2=80=99t=20use=20positional=20arguments=20?= =?UTF-8?q?with=20*MenuItem=20inits.?=
Avoid DepreciationWarning for ImageMenuItem, CheckMenuItemi, and MenuItem. Fix #7858 Signed-off-by: Matěj Cepl <mcepl@redhat.com> --- src/chat_control.py | 8 +++---- src/conversation_textview.py | 5 ++-- src/groupchat_control.py | 4 ++-- src/gui_interface.py | 2 +- src/gui_menu_builder.py | 15 +++++++----- src/roster_window.py | 56 +++++++++++++++++++++++++++----------------- src/statusicon.py | 13 ++++++---- 7 files changed, 61 insertions(+), 42 deletions(-)
This commit is contained in:
parent
b7d4570017
commit
eb6fa81854
|
@ -1083,7 +1083,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
|
||||||
active_tags = self.msg_textview.get_active_tags()
|
active_tags = self.msg_textview.get_active_tags()
|
||||||
|
|
||||||
for menuitem in menuitems:
|
for menuitem in menuitems:
|
||||||
item = Gtk.CheckMenuItem(menuitem[0])
|
item = Gtk.CheckMenuItem.new_with_label(menuitem[0])
|
||||||
if menuitem[1] in active_tags:
|
if menuitem[1] in active_tags:
|
||||||
item.set_active(True)
|
item.set_active(True)
|
||||||
else:
|
else:
|
||||||
|
@ -1095,13 +1095,13 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
|
||||||
item = Gtk.SeparatorMenuItem.new() # separator
|
item = Gtk.SeparatorMenuItem.new() # separator
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
item = Gtk.ImageMenuItem(_('Color'))
|
item = Gtk.ImageMenuItem.new_with_label(_('Color'))
|
||||||
icon = Gtk.Image.new_from_stock(Gtk.STOCK_SELECT_COLOR, Gtk.IconSize.MENU)
|
icon = Gtk.Image.new_from_stock(Gtk.STOCK_SELECT_COLOR, Gtk.IconSize.MENU)
|
||||||
item.set_image(icon)
|
item.set_image(icon)
|
||||||
item.connect('activate', self.on_color_menuitem_activale)
|
item.connect('activate', self.on_color_menuitem_activale)
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
item = Gtk.ImageMenuItem(_('Font'))
|
item = Gtk.ImageMenuItem.new_with_label(_('Font'))
|
||||||
icon = Gtk.Image.new_from_stock(Gtk.STOCK_SELECT_FONT, Gtk.IconSize.MENU)
|
icon = Gtk.Image.new_from_stock(Gtk.STOCK_SELECT_FONT, Gtk.IconSize.MENU)
|
||||||
item.set_image(icon)
|
item.set_image(icon)
|
||||||
item.connect('activate', self.on_font_menuitem_activale)
|
item.connect('activate', self.on_font_menuitem_activale)
|
||||||
|
@ -1110,7 +1110,7 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
|
||||||
item = Gtk.SeparatorMenuItem.new() # separator
|
item = Gtk.SeparatorMenuItem.new() # separator
|
||||||
menu.append(item)
|
menu.append(item)
|
||||||
|
|
||||||
item = Gtk.ImageMenuItem(_('Clear formating'))
|
item = Gtk.ImageMenuItem.new_with_label(_('Clear formating'))
|
||||||
icon = Gtk.Image.new_from_stock(Gtk.STOCK_CLEAR, Gtk.IconSize.MENU)
|
icon = Gtk.Image.new_from_stock(Gtk.STOCK_CLEAR, Gtk.IconSize.MENU)
|
||||||
item.set_image(icon)
|
item.set_image(icon)
|
||||||
item.connect('activate', self.msg_textview.clear_tags)
|
item.connect('activate', self.msg_textview.clear_tags)
|
||||||
|
|
|
@ -816,7 +816,7 @@ class ConversationTextview(GObject.GObject):
|
||||||
else:
|
else:
|
||||||
if dict_link.find('%s') == -1:
|
if dict_link.find('%s') == -1:
|
||||||
# we must have %s in the url if not WIKTIONARY
|
# we must have %s in the url if not WIKTIONARY
|
||||||
item = Gtk.MenuItem(_(
|
item = Gtk.MenuItem.new_with_label(_(
|
||||||
'Dictionary URL is missing an "%s" and it is not WIKTIONARY'))
|
'Dictionary URL is missing an "%s" and it is not WIKTIONARY'))
|
||||||
item.set_property('sensitive', False)
|
item.set_property('sensitive', False)
|
||||||
else:
|
else:
|
||||||
|
@ -830,7 +830,8 @@ class ConversationTextview(GObject.GObject):
|
||||||
search_link = gajim.config.get('search_engine')
|
search_link = gajim.config.get('search_engine')
|
||||||
if search_link.find('%s') == -1:
|
if search_link.find('%s') == -1:
|
||||||
# we must have %s in the url
|
# we must have %s in the url
|
||||||
item = Gtk.MenuItem(_('Web Search URL is missing an "%s"'))
|
item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('Web Search URL is missing an "%s"'))
|
||||||
item.set_property('sensitive', False)
|
item.set_property('sensitive', False)
|
||||||
else:
|
else:
|
||||||
item = Gtk.MenuItem.new_with_mnemonic(_('Web _Search for it'))
|
item = Gtk.MenuItem.new_with_mnemonic(_('Web _Search for it'))
|
||||||
|
|
|
@ -586,14 +586,14 @@ class GroupchatControl(ChatControlBase):
|
||||||
item = Gtk.SeparatorMenuItem.new()
|
item = Gtk.SeparatorMenuItem.new()
|
||||||
menu.prepend(item)
|
menu.prepend(item)
|
||||||
|
|
||||||
item = Gtk.MenuItem(_('Insert Nickname'))
|
item = Gtk.MenuItem.new_with_label(_('Insert Nickname'))
|
||||||
menu.prepend(item)
|
menu.prepend(item)
|
||||||
submenu = Gtk.Menu()
|
submenu = Gtk.Menu()
|
||||||
item.set_submenu(submenu)
|
item.set_submenu(submenu)
|
||||||
|
|
||||||
for nick in sorted(gajim.contacts.get_nick_list(self.account,
|
for nick in sorted(gajim.contacts.get_nick_list(self.account,
|
||||||
self.room_jid)):
|
self.room_jid)):
|
||||||
item = Gtk.MenuItem(nick, use_underline=False)
|
item = Gtk.MenuItem.new_with_label(nick, use_underline=False)
|
||||||
submenu.append(item)
|
submenu.append(item)
|
||||||
id_ = item.connect('activate', self.append_nick_in_msg_textview,
|
id_ = item.connect('activate', self.append_nick_in_msg_textview,
|
||||||
nick)
|
nick)
|
||||||
|
|
|
@ -1948,7 +1948,7 @@ class Interface:
|
||||||
size = int(round(math.sqrt(len(self.emoticons_images))))
|
size = int(round(math.sqrt(len(self.emoticons_images))))
|
||||||
for image in self.emoticons_images:
|
for image in self.emoticons_images:
|
||||||
# In Gtk 3.6, Gtk.MenuItem() doesn't contain a label child
|
# In Gtk 3.6, Gtk.MenuItem() doesn't contain a label child
|
||||||
item = Gtk.MenuItem('q')
|
item = Gtk.MenuItem.new_with_label('q')
|
||||||
img = Gtk.Image()
|
img = Gtk.Image()
|
||||||
if isinstance(image[1], GdkPixbuf.PixbufAnimation):
|
if isinstance(image[1], GdkPixbuf.PixbufAnimation):
|
||||||
img.set_from_animation(image[1])
|
img.set_from_animation(image[1])
|
||||||
|
|
|
@ -44,7 +44,8 @@ def build_resources_submenu(contacts, account, action, room_jid=None,
|
||||||
for c in contacts:
|
for c in contacts:
|
||||||
# icon MUST be different instance for every item
|
# icon MUST be different instance for every item
|
||||||
state_images = gtkgui_helpers.load_iconset(path)
|
state_images = gtkgui_helpers.load_iconset(path)
|
||||||
item = Gtk.ImageMenuItem('%s (%s)' % (c.resource, str(c.priority)))
|
item = Gtk.ImageMenuItem.new_with_label(
|
||||||
|
'%s (%s)' % (c.resource, str(c.priority)))
|
||||||
icon_name = helpers.get_icon_name_to_show(c, account)
|
icon_name = helpers.get_icon_name_to_show(c, account)
|
||||||
icon = state_images[icon_name]
|
icon = state_images[icon_name]
|
||||||
item.set_image(icon)
|
item.set_image(icon)
|
||||||
|
@ -154,7 +155,7 @@ show_bookmarked=False, force_resource=False):
|
||||||
item = Gtk.SeparatorMenuItem.new() # separator
|
item = Gtk.SeparatorMenuItem.new() # separator
|
||||||
invite_to_submenu.append(item)
|
invite_to_submenu.append(item)
|
||||||
for (room_jid, account) in rooms:
|
for (room_jid, account) in rooms:
|
||||||
menuitem = Gtk.ImageMenuItem(room_jid.split('@')[0])
|
menuitem = Gtk.ImageMenuItem.new_with_label(room_jid.split('@')[0])
|
||||||
muc_active_icon = gtkgui_helpers.load_icon('muc_active')
|
muc_active_icon = gtkgui_helpers.load_icon('muc_active')
|
||||||
menuitem.set_image(muc_active_icon)
|
menuitem.set_image(muc_active_icon)
|
||||||
if len(contact_list) > 1: # several resources
|
if len(contact_list) > 1: # several resources
|
||||||
|
@ -190,7 +191,7 @@ show_bookmarked=False, force_resource=False):
|
||||||
item = Gtk.SeparatorMenuItem.new() # separator
|
item = Gtk.SeparatorMenuItem.new() # separator
|
||||||
invite_to_submenu.append(item)
|
invite_to_submenu.append(item)
|
||||||
for (room_jid, account) in rooms2:
|
for (room_jid, account) in rooms2:
|
||||||
menuitem = Gtk.ImageMenuItem(room_jid.split('@')[0])
|
menuitem = Gtk.ImageMenuItem.new_with_label(room_jid.split('@')[0])
|
||||||
muc_inactive_icon = gtkgui_helpers.load_icon('muc_inactive')
|
muc_inactive_icon = gtkgui_helpers.load_icon('muc_inactive')
|
||||||
menuitem.set_image(muc_inactive_icon)
|
menuitem.set_image(muc_inactive_icon)
|
||||||
if len(contact_list) > 1: # several resources
|
if len(contact_list) > 1: # several resources
|
||||||
|
@ -473,9 +474,10 @@ control=None, gc_contact=None, is_anonymous=True):
|
||||||
for s in ('online', 'chat', 'away', 'xa', 'dnd', 'offline'):
|
for s in ('online', 'chat', 'away', 'xa', 'dnd', 'offline'):
|
||||||
# icon MUST be different instance for every item
|
# icon MUST be different instance for every item
|
||||||
state_images = gtkgui_helpers.load_iconset(path)
|
state_images = gtkgui_helpers.load_iconset(path)
|
||||||
status_menuitem = Gtk.ImageMenuItem(helpers.get_uf_show(s))
|
status_menuitem = Gtk.ImageMenuItem.new_with_label(
|
||||||
|
helpers.get_uf_show(s))
|
||||||
status_menuitem.connect('activate', roster.on_send_custom_status,
|
status_menuitem.connect('activate', roster.on_send_custom_status,
|
||||||
[(contact, account)], s)
|
[(contact, account)], s)
|
||||||
icon = state_images[s]
|
icon = state_images[s]
|
||||||
status_menuitem.set_image(icon)
|
status_menuitem.set_image(icon)
|
||||||
status_menuitems.append(status_menuitem)
|
status_menuitems.append(status_menuitem)
|
||||||
|
@ -619,7 +621,8 @@ def get_transport_menu(contact, account):
|
||||||
for s in ('online', 'chat', 'away', 'xa', 'dnd', 'offline'):
|
for s in ('online', 'chat', 'away', 'xa', 'dnd', 'offline'):
|
||||||
# icon MUST be different instance for every item
|
# icon MUST be different instance for every item
|
||||||
state_images = gtkgui_helpers.load_iconset(path)
|
state_images = gtkgui_helpers.load_iconset(path)
|
||||||
status_menuitem = Gtk.ImageMenuItem(helpers.get_uf_show(s))
|
status_menuitem = Gtk.ImageMenuItem.new_with_label(
|
||||||
|
helpers.get_uf_show(s))
|
||||||
status_menuitem.connect('activate', roster.on_send_custom_status,
|
status_menuitem.connect('activate', roster.on_send_custom_status,
|
||||||
[(contact, account)], s)
|
[(contact, account)], s)
|
||||||
icon = state_images[s]
|
icon = state_images[s]
|
||||||
|
|
|
@ -4850,7 +4850,7 @@ class RosterWindow:
|
||||||
# c_dest is None if jid_dest doesn't belong to account
|
# c_dest is None if jid_dest doesn't belong to account
|
||||||
return
|
return
|
||||||
menu = Gtk.Menu()
|
menu = Gtk.Menu()
|
||||||
item = Gtk.MenuItem(_('Send %s to %s') % (
|
item = Gtk.MenuItem.new_with_label(_('Send %s to %s') % (
|
||||||
c_source.get_shown_name(), c_dest.get_shown_name()))
|
c_source.get_shown_name(), c_dest.get_shown_name()))
|
||||||
item.set_use_underline(False)
|
item.set_use_underline(False)
|
||||||
item.connect('activate', self.on_drop_rosterx, account_source,
|
item.connect('activate', self.on_drop_rosterx, account_source,
|
||||||
|
@ -4862,11 +4862,13 @@ class RosterWindow:
|
||||||
source_family = gajim.contacts.get_metacontacts_family(
|
source_family = gajim.contacts.get_metacontacts_family(
|
||||||
account_source, c_source.jid)
|
account_source, c_source.jid)
|
||||||
if dest_family == source_family and dest_family:
|
if dest_family == source_family and dest_family:
|
||||||
item = Gtk.MenuItem(_('Make %s first contact') % (
|
item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('Make %s first contact') % (
|
||||||
c_source.get_shown_name()))
|
c_source.get_shown_name()))
|
||||||
item.set_use_underline(False)
|
item.set_use_underline(False)
|
||||||
else:
|
else:
|
||||||
item = Gtk.MenuItem(_('Make %s and %s metacontacts') % (
|
item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('Make %s and %s metacontacts') % (
|
||||||
c_source.get_shown_name(), c_dest.get_shown_name()))
|
c_source.get_shown_name(), c_dest.get_shown_name()))
|
||||||
item.set_use_underline(False)
|
item.set_use_underline(False)
|
||||||
|
|
||||||
|
@ -5333,7 +5335,8 @@ class RosterWindow:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# new chat
|
# new chat
|
||||||
new_chat_item = Gtk.MenuItem(_('using account %s') % account)
|
new_chat_item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('using account %s') % account)
|
||||||
new_chat_item.set_use_underline(False)
|
new_chat_item.set_use_underline(False)
|
||||||
new_chat_sub_menu.append(new_chat_item)
|
new_chat_sub_menu.append(new_chat_item)
|
||||||
new_chat_item.connect('activate',
|
new_chat_item.connect('activate',
|
||||||
|
@ -5387,8 +5390,8 @@ class RosterWindow:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# single message
|
# single message
|
||||||
single_message_item = Gtk.MenuItem(_('using account %s') % \
|
single_message_item = Gtk.MenuItem.new_with_label(
|
||||||
account)
|
_('using account %s') % account)
|
||||||
single_message_item.set_use_underline(False)
|
single_message_item.set_use_underline(False)
|
||||||
single_message_sub_menu.append(single_message_item)
|
single_message_sub_menu.append(single_message_item)
|
||||||
single_message_item.connect('activate',
|
single_message_item.connect('activate',
|
||||||
|
@ -5397,7 +5400,8 @@ class RosterWindow:
|
||||||
# join gc
|
# join gc
|
||||||
if gajim.connections[account].private_storage_supported:
|
if gajim.connections[account].private_storage_supported:
|
||||||
connected_accounts_with_private_storage += 1
|
connected_accounts_with_private_storage += 1
|
||||||
gc_item = Gtk.MenuItem(_('using account %s') % account)
|
gc_item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('using account %s') % account)
|
||||||
gc_item.set_use_underline(False)
|
gc_item.set_use_underline(False)
|
||||||
gc_sub_menu.append(gc_item)
|
gc_sub_menu.append(gc_item)
|
||||||
gc_menuitem_menu = Gtk.Menu()
|
gc_menuitem_menu = Gtk.Menu()
|
||||||
|
@ -5405,13 +5409,15 @@ class RosterWindow:
|
||||||
gc_item.set_submenu(gc_menuitem_menu)
|
gc_item.set_submenu(gc_menuitem_menu)
|
||||||
|
|
||||||
# add
|
# add
|
||||||
add_item = Gtk.MenuItem(_('to %s account') % account)
|
add_item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('to %s account') % account)
|
||||||
add_item.set_use_underline(False)
|
add_item.set_use_underline(False)
|
||||||
add_sub_menu.append(add_item)
|
add_sub_menu.append(add_item)
|
||||||
add_item.connect('activate', self.on_add_new_contact, account)
|
add_item.connect('activate', self.on_add_new_contact, account)
|
||||||
|
|
||||||
# disco
|
# disco
|
||||||
disco_item = Gtk.MenuItem(_('using %s account') % account)
|
disco_item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('using %s account') % account)
|
||||||
disco_item.set_use_underline(False)
|
disco_item.set_use_underline(False)
|
||||||
disco_sub_menu.append(disco_item)
|
disco_sub_menu.append(disco_item)
|
||||||
disco_item.connect('activate',
|
disco_item.connect('activate',
|
||||||
|
@ -5470,7 +5476,8 @@ class RosterWindow:
|
||||||
profile_avatar_sub_menu = Gtk.Menu()
|
profile_avatar_sub_menu = Gtk.Menu()
|
||||||
for account in connected_accounts_with_vcard:
|
for account in connected_accounts_with_vcard:
|
||||||
# profile, avatar
|
# profile, avatar
|
||||||
profile_avatar_item = Gtk.MenuItem(_('of account %s') % account)
|
profile_avatar_item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('of account %s') % account)
|
||||||
profile_avatar_item.set_use_underline(False)
|
profile_avatar_item.set_use_underline(False)
|
||||||
profile_avatar_sub_menu.append(profile_avatar_item)
|
profile_avatar_sub_menu.append(profile_avatar_item)
|
||||||
profile_avatar_item.connect('activate',
|
profile_avatar_item.connect('activate',
|
||||||
|
@ -5511,7 +5518,8 @@ class RosterWindow:
|
||||||
accounts.append(account)
|
accounts.append(account)
|
||||||
accounts.sort()
|
accounts.sort()
|
||||||
for account in accounts:
|
for account in accounts:
|
||||||
advanced_item = Gtk.MenuItem(_('for account %s') % account)
|
advanced_item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('for account %s') % account)
|
||||||
advanced_item.set_use_underline(False)
|
advanced_item.set_use_underline(False)
|
||||||
advanced_sub_menu.append(advanced_item)
|
advanced_sub_menu.append(advanced_item)
|
||||||
advanced_menuitem_menu = \
|
advanced_menuitem_menu = \
|
||||||
|
@ -5594,7 +5602,7 @@ class RosterWindow:
|
||||||
pep_submenu = Gtk.Menu()
|
pep_submenu = Gtk.Menu()
|
||||||
pep_menuitem.set_submenu(pep_submenu)
|
pep_menuitem.set_submenu(pep_submenu)
|
||||||
def add_item(label, opt_name, func):
|
def add_item(label, opt_name, func):
|
||||||
item = Gtk.CheckMenuItem(label)
|
item = Gtk.CheckMenuItem.new_with_label(label)
|
||||||
pep_submenu.append(item)
|
pep_submenu.append(item)
|
||||||
if not dbus_support.supported:
|
if not dbus_support.supported:
|
||||||
item.set_sensitive(False)
|
item.set_sensitive(False)
|
||||||
|
@ -5609,7 +5617,8 @@ class RosterWindow:
|
||||||
add_item(_('Publish Location'), 'publish_location',
|
add_item(_('Publish Location'), 'publish_location',
|
||||||
self.on_publish_location_toggled)
|
self.on_publish_location_toggled)
|
||||||
|
|
||||||
pep_config = Gtk.ImageMenuItem(_('Configure Services...'))
|
pep_config = Gtk.ImageMenuItem.new_with_label(
|
||||||
|
_('Configure Services...'))
|
||||||
item = Gtk.SeparatorMenuItem.new()
|
item = Gtk.SeparatorMenuItem.new()
|
||||||
pep_submenu.append(item)
|
pep_submenu.append(item)
|
||||||
pep_config.set_sensitive(True)
|
pep_config.set_sensitive(True)
|
||||||
|
@ -5718,7 +5727,7 @@ class RosterWindow:
|
||||||
accounts.sort()
|
accounts.sort()
|
||||||
for account in accounts:
|
for account in accounts:
|
||||||
state_images = gtkgui_helpers.load_iconset(path)
|
state_images = gtkgui_helpers.load_iconset(path)
|
||||||
item = Gtk.ImageMenuItem(account)
|
item = Gtk.ImageMenuItem.new_with_label(account)
|
||||||
show = gajim.SHOW_LIST[gajim.connections[account].connected]
|
show = gajim.SHOW_LIST[gajim.connections[account].connected]
|
||||||
icon = state_images[show]
|
icon = state_images[show]
|
||||||
item.set_image(icon)
|
item.set_image(icon)
|
||||||
|
@ -5780,11 +5789,11 @@ class RosterWindow:
|
||||||
send_group_message_item.set_submenu(send_group_message_submenu)
|
send_group_message_item.set_submenu(send_group_message_submenu)
|
||||||
menu.append(send_group_message_item)
|
menu.append(send_group_message_item)
|
||||||
|
|
||||||
group_message_to_all_item = Gtk.MenuItem.new_with_mnemonic(_(
|
group_message_to_all_item = Gtk.MenuItem.new_with_label(_(
|
||||||
'To all users'))
|
'To all users'))
|
||||||
send_group_message_submenu.append(group_message_to_all_item)
|
send_group_message_submenu.append(group_message_to_all_item)
|
||||||
|
|
||||||
group_message_to_all_online_item = Gtk.MenuItem.new_with_mnemonic(
|
group_message_to_all_online_item = Gtk.MenuItem.new_with_label(
|
||||||
_('To all online users'))
|
_('To all online users'))
|
||||||
send_group_message_submenu.append(group_message_to_all_online_item)
|
send_group_message_submenu.append(group_message_to_all_online_item)
|
||||||
|
|
||||||
|
@ -5825,7 +5834,8 @@ class RosterWindow:
|
||||||
for s in ('online', 'chat', 'away', 'xa', 'dnd', 'offline'):
|
for s in ('online', 'chat', 'away', 'xa', 'dnd', 'offline'):
|
||||||
# icon MUST be different instance for every item
|
# icon MUST be different instance for every item
|
||||||
state_images = gtkgui_helpers.load_iconset(path)
|
state_images = gtkgui_helpers.load_iconset(path)
|
||||||
status_menuitem = Gtk.ImageMenuItem(helpers.get_uf_show(s))
|
status_menuitem = Gtk.ImageMenuItem.new_with_label(
|
||||||
|
helpers.get_uf_show(s))
|
||||||
status_menuitem.connect('activate', self.on_send_custom_status,
|
status_menuitem.connect('activate', self.on_send_custom_status,
|
||||||
list_, s, group)
|
list_, s, group)
|
||||||
icon = state_images[s]
|
icon = state_images[s]
|
||||||
|
@ -5867,8 +5877,8 @@ class RosterWindow:
|
||||||
|
|
||||||
if is_blocked and gajim.connections[account].\
|
if is_blocked and gajim.connections[account].\
|
||||||
privacy_rules_supported:
|
privacy_rules_supported:
|
||||||
unblock_menuitem = Gtk.ImageMenuItem.new_with_mnemonic(_(
|
unblock_menuitem = Gtk.ImageMenuItem.new_with_mnemonic(
|
||||||
'_Unblock'))
|
_('_Unblock'))
|
||||||
icon = Gtk.Image.new_from_stock(Gtk.STOCK_STOP,
|
icon = Gtk.Image.new_from_stock(Gtk.STOCK_STOP,
|
||||||
Gtk.IconSize.MENU)
|
Gtk.IconSize.MENU)
|
||||||
unblock_menuitem.set_image(icon)
|
unblock_menuitem.set_image(icon)
|
||||||
|
@ -5876,7 +5886,8 @@ class RosterWindow:
|
||||||
group)
|
group)
|
||||||
menu.append(unblock_menuitem)
|
menu.append(unblock_menuitem)
|
||||||
else:
|
else:
|
||||||
block_menuitem = Gtk.ImageMenuItem.new_with_mnemonic(_('_Block'))
|
block_menuitem = Gtk.ImageMenuItem.new_with_mnemonic(
|
||||||
|
_('_Block'))
|
||||||
icon = Gtk.Image.new_from_stock(Gtk.STOCK_STOP,
|
icon = Gtk.Image.new_from_stock(Gtk.STOCK_STOP,
|
||||||
Gtk.IconSize.MENU)
|
Gtk.IconSize.MENU)
|
||||||
block_menuitem.set_image(icon)
|
block_menuitem.set_image(icon)
|
||||||
|
@ -6003,7 +6014,8 @@ class RosterWindow:
|
||||||
|
|
||||||
# Block
|
# Block
|
||||||
if is_blocked and privacy_rules_supported:
|
if is_blocked and privacy_rules_supported:
|
||||||
unblock_menuitem = Gtk.ImageMenuItem.new_with_mnemonic(_('_Unblock'))
|
unblock_menuitem = Gtk.ImageMenuItem.new_with_mnemonic(
|
||||||
|
_('_Unblock'))
|
||||||
icon = Gtk.Image.new_from_stock(Gtk.STOCK_STOP, Gtk.IconSize.MENU)
|
icon = Gtk.Image.new_from_stock(Gtk.STOCK_STOP, Gtk.IconSize.MENU)
|
||||||
unblock_menuitem.set_image(icon)
|
unblock_menuitem.set_image(icon)
|
||||||
unblock_menuitem.connect('activate', self.on_unblock, list_)
|
unblock_menuitem.connect('activate', self.on_unblock, list_)
|
||||||
|
@ -6203,7 +6215,7 @@ class RosterWindow:
|
||||||
|
|
||||||
for bookmark in gajim.connections[account].bookmarks:
|
for bookmark in gajim.connections[account].bookmarks:
|
||||||
# Do not use underline.
|
# Do not use underline.
|
||||||
item = Gtk.MenuItem(bookmark['name'])
|
item = Gtk.MenuItem.new_with_label(bookmark['name'])
|
||||||
item.set_use_underline(False)
|
item.set_use_underline(False)
|
||||||
item.connect('activate', self.on_bookmark_menuitem_activate,
|
item.connect('activate', self.on_bookmark_menuitem_activate,
|
||||||
account, bookmark)
|
account, bookmark)
|
||||||
|
|
|
@ -274,7 +274,8 @@ class StatusIcon:
|
||||||
for account in accounts_list:
|
for account in accounts_list:
|
||||||
if gajim.account_is_connected(account):
|
if gajim.account_is_connected(account):
|
||||||
# for chat_with
|
# for chat_with
|
||||||
item = Gtk.MenuItem(_('using account %s') % account)
|
item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('using account %s') % account)
|
||||||
account_menu_for_chat_with.append(item)
|
account_menu_for_chat_with.append(item)
|
||||||
item.connect('activate', self.on_new_chat, account)
|
item.connect('activate', self.on_new_chat, account)
|
||||||
|
|
||||||
|
@ -321,14 +322,15 @@ class StatusIcon:
|
||||||
if gajim.connections[account].private_storage_supported:
|
if gajim.connections[account].private_storage_supported:
|
||||||
connected_accounts_with_private_storage += 1
|
connected_accounts_with_private_storage += 1
|
||||||
# for single message
|
# for single message
|
||||||
item = Gtk.MenuItem(_('using account %s') % account)
|
item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('using account %s') % account)
|
||||||
item.connect('activate',
|
item.connect('activate',
|
||||||
self.on_single_message_menuitem_activate, account)
|
self.on_single_message_menuitem_activate, account)
|
||||||
account_menu_for_single_message.append(item)
|
account_menu_for_single_message.append(item)
|
||||||
|
|
||||||
# join gc
|
# join gc
|
||||||
gc_item = Gtk.MenuItem(_('using account %s') % account,
|
gc_item = Gtk.MenuItem.new_with_label(
|
||||||
use_underline=False)
|
_('using account %s') % account, use_underline=False)
|
||||||
gc_sub_menu.append(gc_item)
|
gc_sub_menu.append(gc_item)
|
||||||
gc_menuitem_menu = Gtk.Menu()
|
gc_menuitem_menu = Gtk.Menu()
|
||||||
gajim.interface.roster.add_bookmarks_list(gc_menuitem_menu,
|
gajim.interface.roster.add_bookmarks_list(gc_menuitem_menu,
|
||||||
|
@ -364,7 +366,8 @@ class StatusIcon:
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
if self.added_hide_menuitem is False:
|
if self.added_hide_menuitem is False:
|
||||||
self.systray_context_menu.prepend(Gtk.SeparatorMenuItem.new())
|
self.systray_context_menu.prepend(Gtk.SeparatorMenuItem.new())
|
||||||
item = Gtk.MenuItem(_('Hide this menu'))
|
item = Gtk.MenuItem.new_with_label(
|
||||||
|
_('Hide this menu'))
|
||||||
self.systray_context_menu.prepend(item)
|
self.systray_context_menu.prepend(item)
|
||||||
self.added_hide_menuitem = True
|
self.added_hide_menuitem = True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue