ability to send a file to the resource we want from roster context menu. see #3446
This commit is contained in:
parent
bdb7502dc3
commit
338eed59ef
|
@ -1964,7 +1964,8 @@ class RosterWindow:
|
||||||
jid += '/' + contact.resource
|
jid += '/' + contact.resource
|
||||||
dialogs.SingleMessageWindow(account, jid, 'send')
|
dialogs.SingleMessageWindow(account, jid, 'send')
|
||||||
|
|
||||||
def on_send_file_menuitem_activate(self, widget, account, contact):
|
def on_send_file_menuitem_activate(self, widget, contact, account,
|
||||||
|
resource=None):
|
||||||
gajim.interface.instances['file_transfers'].show_file_send_request(
|
gajim.interface.instances['file_transfers'].show_file_send_request(
|
||||||
account, contact)
|
account, contact)
|
||||||
|
|
||||||
|
@ -2036,7 +2037,7 @@ class RosterWindow:
|
||||||
|
|
||||||
if contact.resource:
|
if contact.resource:
|
||||||
send_file_menuitem.connect('activate',
|
send_file_menuitem.connect('activate',
|
||||||
self.on_send_file_menuitem_activate, account, contact)
|
self.on_send_file_menuitem_activate, contact, account)
|
||||||
else: # if we do no have resource we cannot do much
|
else: # if we do no have resource we cannot do much
|
||||||
send_file_menuitem.set_sensitive(False)
|
send_file_menuitem.set_sensitive(False)
|
||||||
|
|
||||||
|
@ -2233,6 +2234,8 @@ class RosterWindow:
|
||||||
|
|
||||||
start_chat_menuitem.set_submenu(resources_submenu(
|
start_chat_menuitem.set_submenu(resources_submenu(
|
||||||
self.on_open_chat_window))
|
self.on_open_chat_window))
|
||||||
|
send_file_menuitem.set_submenu(resources_submenu(
|
||||||
|
self.on_send_file_menuitem_activate))
|
||||||
execute_command_menuitem.set_submenu(resources_submenu(
|
execute_command_menuitem.set_submenu(resources_submenu(
|
||||||
self.on_execute_command))
|
self.on_execute_command))
|
||||||
invite_to_new_room_menuitem.set_submenu(resources_submenu(
|
invite_to_new_room_menuitem.set_submenu(resources_submenu(
|
||||||
|
@ -2265,11 +2268,11 @@ class RosterWindow:
|
||||||
our_jid_other_resource)
|
our_jid_other_resource)
|
||||||
invite_to_submenu.append(menuitem)
|
invite_to_submenu.append(menuitem)
|
||||||
|
|
||||||
if contact.resource:
|
if contact.resource:
|
||||||
send_file_menuitem.connect('activate',
|
send_file_menuitem.connect('activate',
|
||||||
self.on_send_file_menuitem_activate, account, contact)
|
self.on_send_file_menuitem_activate, contact, account)
|
||||||
else: # if we do not have resource we cannot send file
|
else: # if we do not have resource we cannot send file
|
||||||
send_file_menuitem.set_sensitive(False)
|
send_file_menuitem.set_sensitive(False)
|
||||||
|
|
||||||
send_single_message_menuitem.connect('activate',
|
send_single_message_menuitem.connect('activate',
|
||||||
self.on_send_single_message_menuitem_activate, account, contact)
|
self.on_send_single_message_menuitem_activate, account, contact)
|
||||||
|
|
Loading…
Reference in New Issue