diff --git a/gajim/data/gui/subscription_request_window.ui b/gajim/data/gui/subscription_request_window.ui index 6a84a2df4507485c0cedd5c73a5ca2341beef4b2..8ac1a2c946ff824eb1767b7c6f37da712c586f7e 100644 --- a/gajim/data/gui/subscription_request_window.ui +++ b/gajim/data/gui/subscription_request_window.ui @@ -91,7 +91,7 @@ <property name="tooltip_text" translatable="yes">Contact Information</property> <property name="valign">center</property> <property name="image">image2</property> - <signal name="clicked" handler="on_contact_info_button_clicked" swapped="no"/> + <signal name="clicked" handler="_on_contact_info_clicked" swapped="no"/> </object> <packing> <property name="left_attach">0</property> @@ -106,7 +106,7 @@ <property name="tooltip_text" translatable="yes">Start Chat</property> <property name="valign">center</property> <property name="image">image1</property> - <signal name="clicked" handler="on_start_chat_button_clicked" swapped="no"/> + <signal name="clicked" handler="_on_start_chat_clicked" swapped="no"/> </object> <packing> <property name="left_attach">0</property> @@ -152,7 +152,7 @@ <property name="receives_default">False</property> <property name="tooltip_text" translatable="yes">Deny authorization from contact so the contact cannot know if you are connected</property> <property name="use_underline">True</property> - <signal name="clicked" handler="on_deny_button_clicked" swapped="no"/> + <signal name="clicked" handler="_on_deny_clicked" swapped="no"/> </object> <packing> <property name="expand">False</property> @@ -170,7 +170,7 @@ <property name="receives_default">False</property> <property name="tooltip_text" translatable="yes">Authorize contact so the contact can know if you are connected</property> <property name="use_underline">True</property> - <signal name="clicked" handler="on_authorize_button_clicked" swapped="no"/> + <signal name="clicked" handler="_on_authorize_clicked" swapped="no"/> <style> <class name="suggested-action"/> </style> diff --git a/gajim/gtk/subscription_request.py b/gajim/gtk/subscription_request.py index 367f5bf78c1e1c50d695cca87dc458acddd32aa5..6b7d23a2ed2c61b7070100b9e5c3077c2b8ba8a7 100644 --- a/gajim/gtk/subscription_request.py +++ b/gajim/gtk/subscription_request.py @@ -52,41 +52,45 @@ def __init__(self, account, jid, text, user_nick=None): self._ui.connect_signals(self) self.show_all() - def on_authorize_button_clicked(self, widget): + def _on_authorize_clicked(self, _widget): """ Accept the request """ - app.connections[self.account].get_module('Presence').subscribed(self.jid) + con = app.connections[self.account] + con.get_module('Presence').subscribed(self.jid) self.destroy() contact = app.contacts.get_contact(self.account, self.jid) if not contact or _('Not in contact list') in contact.groups: AddNewContactWindow(self.account, self.jid, self.user_nick) - def on_contact_info_button_clicked(self, widget): + def _on_contact_info_clicked(self, _widget): """ Ask for vCard """ - if self.jid in app.interface.instances[self.account]['infos']: - app.interface.instances[self.account]['infos'][self.jid].window.present() + open_windows = app.interface.instances[self.account]['infos'] + if self.jid in open_windows: + open_windows[self.jid].window.present() else: - contact = app.contacts.create_contact(jid=self.jid, account=self.account) + contact = app.contacts.create_contact(jid=self.jid, + account=self.account) app.interface.instances[self.account]['infos'][self.jid] = \ vcard.VcardWindow(contact, self.account) # Remove xmpp page app.interface.instances[self.account]['infos'][self.jid].xml.\ get_object('information_notebook').remove_page(0) - def on_start_chat_button_clicked(self, widget): + def _on_start_chat_clicked(self, _widget): """ Open chat """ app.interface.new_chat_from_jid(self.account, self.jid) - def on_deny_button_clicked(self, widget): + def _on_deny_clicked(self, _widget): """ Refuse the request """ - app.connections[self.account].get_module('Presence').unsubscribed(self.jid) + con = app.connections[self.account] + con.get_module('Presence').unsubscribed(self.jid) contact = app.contacts.get_contact(self.account, self.jid) if contact and _('Not in contact list') in contact.get_shown_groups(): app.interface.roster.remove_contact(self.jid, self.account)