gajim: * fixed a bug (when we try to remove a jid from roster wi...

2009-07-20 Thread Anaƫl Verrier
changeset d771ec6ea227 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=d771ec6ea227
description: * fixed a bug (when we try to remove a jid from roster window)

diffstat:

 src/common/connection_handlers.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (14 lines):

diff -r 9efe9be81c74 -r d771ec6ea227 src/common/connection_handlers.py
--- a/src/common/connection_handlers.py Sun Jul 19 23:45:03 2009 +0200
+++ b/src/common/connection_handlers.py Mon Jul 20 20:09:39 2009 +0200
@@ -2577,8 +2577,8 @@
if received_from_server:
for contact in gajim.contacts.iter_contacts(self.name):
if not contact.is_groupchat() and contact.jid 
not in roster:
-   self.dispatch('ROSTER_INFO', (self.name,
-   (contact.jid, None, None, None, 
(
+   self.dispatch('ROSTER_INFO', 
(contact.jid, None, None, None,
+   ()))
for jid in roster:
self.dispatch('ROSTER_INFO', (jid, 
roster[jid]['name'],
roster[jid]['subscription'], 
roster[jid]['ask'],
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: prevent traceback when we remove contacts in iter_contact...

2009-07-20 Thread Yann Leboulanger
changeset c08280b346b5 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=c08280b346b5
description: prevent traceback when we remove contacts in iter_contacts() loop.

diffstat:

 src/common/contacts.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (14 lines):

diff -r d771ec6ea227 -r c08280b346b5 src/common/contacts.py
--- a/src/common/contacts.pyMon Jul 20 20:09:39 2009 +0200
+++ b/src/common/contacts.pyMon Jul 20 23:47:59 2009 +0200
@@ -291,8 +291,8 @@
 
def iter_contacts(self, account):
if account in self._contacts:
-   for jid in self._contacts[account]:
-   for contact in self._contacts[account][jid]:
+   for jid in self._contacts[account].keys():
+   for contact in 
self._contacts[account][jid].keys():
yield contact
 
def get_contact_from_full_jid(self, account, fjid):
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: stupid me, calling .keys() on a dict ...

2009-07-20 Thread Yann Leboulanger
changeset 65e55d533cbc in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=65e55d533cbc
description: stupid me, calling .keys() on a dict ...

diffstat:

 src/common/contacts.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r c08280b346b5 -r 65e55d533cbc src/common/contacts.py
--- a/src/common/contacts.pyMon Jul 20 23:47:59 2009 +0200
+++ b/src/common/contacts.pyMon Jul 20 23:51:17 2009 +0200
@@ -292,7 +292,7 @@
def iter_contacts(self, account):
if account in self._contacts:
for jid in self._contacts[account].keys():
-   for contact in 
self._contacts[account][jid].keys():
+   for contact in self._contacts[account][jid]:
yield contact
 
def get_contact_from_full_jid(self, account, fjid):
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: copy list before iterating on it in case we modify it.

2009-07-20 Thread Yann Leboulanger
changeset 44fb9b10259e in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=44fb9b10259e
description: copy list before iterating on it in case we modify it.

diffstat:

 src/common/contacts.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 65e55d533cbc -r 44fb9b10259e src/common/contacts.py
--- a/src/common/contacts.pyMon Jul 20 23:51:17 2009 +0200
+++ b/src/common/contacts.pyTue Jul 21 00:13:55 2009 +0200
@@ -292,7 +292,7 @@
def iter_contacts(self, account):
if account in self._contacts:
for jid in self._contacts[account].keys():
-   for contact in self._contacts[account][jid]:
+   for contact in self._contacts[account][jid][:]:
yield contact
 
def get_contact_from_full_jid(self, account, fjid):
___
Commits mailing list
Commits@gajim.org
http://lists.gajim.org/cgi-bin/listinfo/commits


gajim: fix using change nick button in groupchats

2009-07-20 Thread Yann Leboulanger
changeset 7f7118c375a1 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=7f7118c375a1
description: fix using change nick button in groupchats

diffstat:

 src/dialogs.py   |  32 
 src/gajim.py |  10 --
 src/groupchat_control.py |  11 ---
 3 files changed, 32 insertions(+), 21 deletions(-)

diffs (119 lines):

diff -r 44fb9b10259e -r 7f7118c375a1 src/dialogs.py
--- a/src/dialogs.pyTue Jul 21 00:13:55 2009 +0200
+++ b/src/dialogs.pyTue Jul 21 00:30:43 2009 +0200
@@ -1639,9 +1639,10 @@
self.input_entry.set_text(input_str)
self.input_entry.select_region(0, -1) # select all
 
-   self.checkbutton = gtk.CheckButton(checktext)
-   self.vbox.pack_start(self.checkbutton, expand=False, fill=True)
-   self.checkbutton.show()
+   if checktext:
+   self.checkbutton = gtk.CheckButton(checktext)
+   self.vbox.pack_start(self.checkbutton, expand=False, 
fill=True)
+   self.checkbutton.show()
 
def on_okbutton_clicked(self, widget):
user_input = self.get_text()
@@ -1659,16 +1660,18 @@
 
def is_checked(self):
''' Get active state of the checkbutton '''
-   return self.checkbutton.get_active()
+   try:
+   return self.checkbutton.get_active()
+   except Exception:
+   # There is no checkbutton
+   return False
 
 class ChangeNickDialog(InputDialogCheck):
'''Class for changing room nickname in case of conflict'''
-   def __init__(self, account, room_jid):
-   title = _('Unable to join group chat')
-   check_text = _('Always use this nickname when there is a 
conflict')
+   def __init__(self, account, room_jid, title, prompt, check_text=None):
InputDialogCheck.__init__(self, title, '', checktext=check_text,
input_str='', is_modal=True, ok_handler=None, 
cancel_handler=None)
-   self.room_queue = [(account, room_jid)]
+   self.room_queue = [(account, room_jid, prompt)]
self.check_next()
 
def on_input_dialog_delete_event(self, widget, event):
@@ -1686,10 +1689,7 @@
self.check_next()
return
label = self.xml.get_widget('label')
-   prompt = _('Your desired nickname in group chat %s is in use or 
'
-   'registered by another occupant.\nPlease specify 
another nickname '
-   'below:') % self.room_jid
-   label.set_markup(prompt)
+   label.set_markup(self.prompt)
self.set_entry(self.gc_control.nick + \
gajim.config.get('gc_proposed_nick_char'))
 
@@ -1699,7 +1699,7 @@
self.dialog.destroy()
del gajim.interface.instances['change_nick_dialog']
return
-   self.account, self.room_jid = self.room_queue.pop(0)
+   self.account, self.room_jid, self.prompt = 
self.room_queue.pop(0)
self.setup_dialog()
 
if gajim.new_room_nick is not None and not gajim.gc_connected[
@@ -1743,9 +1743,9 @@
self.gc_control.new_nick = ''
self.check_next()
 
-   def add_room(self, account, room_jid):
-   if (account, room_jid) not in self.room_queue:
-   self.room_queue.append((account, room_jid))
+   def add_room(self, account, room_jid, pompt):
+   if (account, room_jid, prompt) not in self.room_queue:
+   self.room_queue.append((account, room_jid, prompt))
 
 class InputTextDialog(CommonInputDialog):
'''Class for multilines Input dialog (more place than InputDialog)'''
diff -r 44fb9b10259e -r 7f7118c375a1 src/gajim.py
--- a/src/gajim.py  Tue Jul 21 00:13:55 2009 +0200
+++ b/src/gajim.py  Tue Jul 21 00:30:43 2009 +0200
@@ -506,11 +506,17 @@
def handle_event_ask_new_nick(self, account, data):
#('ASK_NEW_NICK', account, (room_jid,))
room_jid = data[0]
+   title = _('Unable to join group chat')
+   prompt = _('Your desired nickname in group chat %s is in use or 
'
+   'registered by another occupant.\nPlease specify 
another nickname '
+   'below:') % room_jid
+   check_text = _('Always use this nickname when there is a 
conflict')
if 'change_nick_dialog' in self.instances:
-   self.instances['change_nick_dialog'].add_room(account, 
room_jid)
+   self.instances['change_nick_dialog'].add_room(account, 
room_jid,
+   prompt)