don't open twice the same subscription request dialog. see #6762
This commit is contained in:
parent
11442f8153
commit
be942a0270
|
@ -6,6 +6,7 @@
|
||||||
<property name="border_width">12</property>
|
<property name="border_width">12</property>
|
||||||
<property name="title" translatable="yes">Subscription Request</property>
|
<property name="title" translatable="yes">Subscription Request</property>
|
||||||
<property name="type_hint">dialog</property>
|
<property name="type_hint">dialog</property>
|
||||||
|
<signal name="destroy" handler="on_subscription_request_window_destroy"/>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkVBox" id="vbox10">
|
<object class="GtkVBox" id="vbox10">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
|
|
@ -2040,7 +2040,7 @@ class AccountsWindow:
|
||||||
gajim.interface.msg_win_mgr.change_account_name(old_name, new_name)
|
gajim.interface.msg_win_mgr.change_account_name(old_name, new_name)
|
||||||
# upgrade account variable in opened windows
|
# upgrade account variable in opened windows
|
||||||
for kind in ('infos', 'disco', 'gc_config', 'search',
|
for kind in ('infos', 'disco', 'gc_config', 'search',
|
||||||
'online_dialog'):
|
'online_dialog', 'sub_request'):
|
||||||
for j in gajim.interface.instances[new_name][kind]:
|
for j in gajim.interface.instances[new_name][kind]:
|
||||||
gajim.interface.instances[new_name][kind][j].account = \
|
gajim.interface.instances[new_name][kind][j].account = \
|
||||||
new_name
|
new_name
|
||||||
|
@ -2477,7 +2477,8 @@ class AccountsWindow:
|
||||||
self.init_account_gpg()
|
self.init_account_gpg()
|
||||||
# update variables
|
# update variables
|
||||||
gajim.interface.instances[account] = {'infos': {},
|
gajim.interface.instances[account] = {'infos': {},
|
||||||
'disco': {}, 'gc_config': {}, 'search': {}, 'online_dialog': {}}
|
'disco': {}, 'gc_config': {}, 'search': {}, 'online_dialog': {},
|
||||||
|
'sub_request': {}}
|
||||||
gajim.interface.minimized_controls[account] = {}
|
gajim.interface.minimized_controls[account] = {}
|
||||||
gajim.connections[account].connected = 0
|
gajim.connections[account].connected = 0
|
||||||
gajim.groups[account] = {}
|
gajim.groups[account] = {}
|
||||||
|
@ -3926,7 +3927,8 @@ class AccountCreationWizardWindow:
|
||||||
|
|
||||||
# update variables
|
# update variables
|
||||||
gajim.interface.instances[self.account] = {'infos': {}, 'disco': {},
|
gajim.interface.instances[self.account] = {'infos': {}, 'disco': {},
|
||||||
'gc_config': {}, 'search': {}, 'online_dialog': {}}
|
'gc_config': {}, 'search': {}, 'online_dialog': {},
|
||||||
|
'sub_request': {}}
|
||||||
gajim.interface.minimized_controls[self.account] = {}
|
gajim.interface.minimized_controls[self.account] = {}
|
||||||
gajim.connections[self.account].connected = 0
|
gajim.connections[self.account].connected = 0
|
||||||
gajim.connections[self.account].keepalives = gajim.config.get_per(
|
gajim.connections[self.account].keepalives = gajim.config.get_per(
|
||||||
|
|
|
@ -2165,6 +2165,14 @@ class SubscriptionRequestWindow:
|
||||||
xml.connect_signals(self)
|
xml.connect_signals(self)
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
|
||||||
|
def on_subscription_request_window_destroy(self, widget):
|
||||||
|
"""
|
||||||
|
Close window
|
||||||
|
"""
|
||||||
|
if self.jid in gajim.interface.instances[self.account]['sub_request']:
|
||||||
|
# remove us from open windows
|
||||||
|
del gajim.interface.instances[self.account]['sub_request'][self.jid]
|
||||||
|
|
||||||
def prepare_popup_menu(self):
|
def prepare_popup_menu(self):
|
||||||
xml = gtkgui_helpers.get_gtk_builder('subscription_request_popup_menu.ui')
|
xml = gtkgui_helpers.get_gtk_builder('subscription_request_popup_menu.ui')
|
||||||
menu = xml.get_object('subscription_request_popup_menu')
|
menu = xml.get_object('subscription_request_popup_menu')
|
||||||
|
|
|
@ -478,7 +478,10 @@ class Interface:
|
||||||
#('SUBSCRIBE', account, (jid, text, user_nick)) user_nick is JEP-0172
|
#('SUBSCRIBE', account, (jid, text, user_nick)) user_nick is JEP-0172
|
||||||
account = obj.conn.name
|
account = obj.conn.name
|
||||||
if helpers.allow_popup_window(account) or not self.systray_enabled:
|
if helpers.allow_popup_window(account) or not self.systray_enabled:
|
||||||
dialogs.SubscriptionRequestWindow(obj.jid, obj.status, account,
|
if obj.jid in self.instances[account]['sub_request']:
|
||||||
|
self.instances[account]['sub_request'][obj.jid].window.destroy()
|
||||||
|
self.instances[account]['sub_request'][obj.jid] = \
|
||||||
|
dialogs.SubscriptionRequestWindow(obj.jid, obj.status, account,
|
||||||
obj.user_nick)
|
obj.user_nick)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -2700,7 +2703,7 @@ class Interface:
|
||||||
|
|
||||||
for a in gajim.connections:
|
for a in gajim.connections:
|
||||||
self.instances[a] = {'infos': {}, 'disco': {}, 'gc_config': {},
|
self.instances[a] = {'infos': {}, 'disco': {}, 'gc_config': {},
|
||||||
'search': {}, 'online_dialog': {}}
|
'search': {}, 'online_dialog': {}, 'sub_request': {}}
|
||||||
# online_dialog contains all dialogs that have a meaning only when
|
# online_dialog contains all dialogs that have a meaning only when
|
||||||
# we are not disconnected
|
# we are not disconnected
|
||||||
self.minimized_controls[a] = {}
|
self.minimized_controls[a] = {}
|
||||||
|
|
|
@ -21,7 +21,7 @@ class MockConnection(Mock, ConnectionHandlersBase):
|
||||||
self.sessions = {}
|
self.sessions = {}
|
||||||
|
|
||||||
gajim.interface.instances[account] = {'infos': {}, 'disco': {},
|
gajim.interface.instances[account] = {'infos': {}, 'disco': {},
|
||||||
'gc_config': {}, 'search': {}}
|
'gc_config': {}, 'search': {}, 'sub_request': {}}
|
||||||
gajim.interface.minimized_controls[account] = {}
|
gajim.interface.minimized_controls[account] = {}
|
||||||
gajim.contacts.add_account(account)
|
gajim.contacts.add_account(account)
|
||||||
gajim.groups[account] = {}
|
gajim.groups[account] = {}
|
||||||
|
|
Loading…
Reference in New Issue