keep instances of chat2muc dialogs so garbage collector don't destroy them too early
This commit is contained in:
parent
a2b799f6bf
commit
420246c26a
|
@ -7,6 +7,7 @@
|
|||
<property name="border_width">5</property>
|
||||
<property name="title" translatable="yes">Invite Friends !</property>
|
||||
<signal name="key_press_event" handler="on_chat_to_muc_window_key_press_event"/>
|
||||
<signal name="destroy" handler="on_chat_to_muc_window_destroy"/>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="general_vbox">
|
||||
<property name="visible">True</property>
|
||||
|
|
|
@ -3356,10 +3356,13 @@ class AdvancedNotificationsWindow:
|
|||
self.window.destroy()
|
||||
|
||||
class TransformChatToMUC:
|
||||
# Keep a reference on windows so garbage collector don't restroy them
|
||||
instances = []
|
||||
def __init__(self, account, jids, preselected = None):
|
||||
'''This window is used to trasform a one-to-one chat to a MUC.
|
||||
We do 2 things: first select the server and then make a guests list.'''
|
||||
|
||||
self.instances.append(self)
|
||||
self.account = account
|
||||
self.auto_jids = jids
|
||||
self.preselected_jids = preselected
|
||||
|
@ -3446,6 +3449,9 @@ class TransformChatToMUC:
|
|||
|
||||
self.xml.signal_autoconnect(self)
|
||||
|
||||
def on_chat_to_muc_window_destroy(self, widget):
|
||||
self.instances.remove(self)
|
||||
|
||||
def on_chat_to_muc_window_key_press_event(self, widget, event):
|
||||
if event.keyval == gtk.keysyms.Escape: # ESCAPE
|
||||
self.window.destroy()
|
||||
|
|
Loading…
Reference in New Issue