Author: asterix
Date: 2007-06-29 10:19:13 +0200 (Fri, 29 Jun 2007)
New Revision: 8341
Modified:
trunk/src/dialogs.py
trunk/src/gajim.py
Log:
make the ask password for groupchat window async and entry visibility to False. fixes #3265
Modified: trunk/src/dialogs.py
===================================================================
--- trunk/src/dialogs.py 2007-06-29 04:12:08 UTC (rev 8340)
+++ trunk/src/dialogs.py 2007-06-29 08:19:13 UTC (rev 8341)
@@ -1073,6 +1073,7 @@
def on_okbutton_clicked(self, widget):
user_input = self.input_entry.get_text().decode('utf-8')
+ self.cancel_handler = None
self.dialog.destroy()
if isinstance(self.ok_handler, tuple):
self.ok_handler[0](user_input, *self.ok_handler[1:])
Modified: trunk/src/gajim.py
===================================================================
--- trunk/src/gajim.py 2007-06-29 04:12:08 UTC (rev 8340)
+++ trunk/src/gajim.py 2007-06-29 08:19:13 UTC (rev 8341)
@@ -1219,15 +1219,12 @@
#('GC_PASSWORD_REQUIRED', account, (room_jid, nick))
room_jid = array[0]
nick = array[1]
- dlg = dialogs.InputDialog(_('Password Required'),
- _('A Password is required to join the room %s. Please type it') % \
- room_jid, is_modal = True)
- response = dlg.get_response()
- if response == gtk.RESPONSE_OK:
- password = dlg.input_entry.get_text()
- gajim.connections[account].join_gc(nick, room_jid, password)
- gajim.gc_passwords[room_jid] = password
- else:
+
+ def on_ok(text):
+ gajim.connections[account].join_gc(nick, room_jid, text)
+ gajim.gc_passwords[room_jid] = text
+
+ def on_cancel():
# get and destroy window
if room_jid in gajim.interface.minimized_controls[account]:
self.roster.on_disconnect(None, room_jid, account)
@@ -1236,6 +1233,11 @@
ctrl = win.get_control(room_jid, account)
win.remove_tab(ctrl, 3)
+ dlg = dialogs.InputDialog(_('Password Required'),
+ _('A Password is required to join the room %s. Please type it') % \
+ room_jid, is_modal=False, ok_handler=on_ok, cancel_handler=on_cancel)
+ dlg.input_entry.set_visibility(False)
+
def handle_event_gc_invitation(self, account, array):
#('GC_INVITATION', (room_jid, jid_from, reason, password))
jid = gajim.get_jid_without_resource(array[1])