make the ask password for groupchat window async and entry visibility to False. fixes #3265

This commit is contained in:
Yann Leboulanger 2007-06-29 08:19:13 +00:00
parent c8d808d956
commit fd2be16f24
2 changed files with 12 additions and 9 deletions

View File

@ -1073,6 +1073,7 @@ class InputDialog:
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:])

View File

@ -1219,15 +1219,12 @@ class Interface:
#('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 @@ class Interface:
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])