changeset cb42499016b1 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=cb42499016b1
description: Merge changes from default branch to osx_newbuildsys branch.

diffstat:

 TODO.pep                          |   8 --------
 src/common/connection_handlers.py |   4 ++--
 src/common/contacts.py            |   4 ++--
 src/dialogs.py                    |  32 ++++++++++++++++----------------
 src/gajim.py                      |  10 ++++++++--
 src/groupchat_control.py          |  11 ++++++++---
 src/music_track_listener.py       |  14 ++++++++++----
 7 files changed, 46 insertions(+), 37 deletions(-)

diffs (183 lines):

diff -r b765732974a5 -r cb42499016b1 TODO.pep
--- a/TODO.pep  Sun Jul 19 21:56:34 2009 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-• configure access model when changing it in the combobox
-• PEP in status change
-
-Tune use cases:
-• on disconnection of an account set Tune to None
-
-Tooltips use cases:
-• Show PEP in GC tooltips
diff -r b765732974a5 -r cb42499016b1 src/common/connection_handlers.py
--- a/src/common/connection_handlers.py Sun Jul 19 21:56:34 2009 +0200
+++ b/src/common/connection_handlers.py Wed Jul 22 00:15: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'],
diff -r b765732974a5 -r cb42499016b1 src/common/contacts.py
--- a/src/common/contacts.py    Sun Jul 19 21:56:34 2009 +0200
+++ b/src/common/contacts.py    Wed Jul 22 00:15:39 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][:]:
                                        yield contact
 
        def get_contact_from_full_jid(self, account, fjid):
diff -r b765732974a5 -r cb42499016b1 src/dialogs.py
--- a/src/dialogs.py    Sun Jul 19 21:56:34 2009 +0200
+++ b/src/dialogs.py    Wed Jul 22 00:15:39 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 b765732974a5 -r cb42499016b1 src/gajim.py
--- a/src/gajim.py      Sun Jul 19 21:56:34 2009 +0200
+++ b/src/gajim.py      Wed Jul 22 00:15:39 2009 +0200
@@ -531,11 +531,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)
                else:
                        self.instances['change_nick_dialog'] = 
dialogs.ChangeNickDialog(
-                               account, room_jid)
+                               account, room_jid, title, prompt)
 
        def handle_event_http_auth(self, account, data):
                #('HTTP_AUTH', account, (method, url, transaction_id, iq_obj, 
msg))
diff -r b765732974a5 -r cb42499016b1 src/groupchat_control.py
--- a/src/groupchat_control.py  Sun Jul 19 21:56:34 2009 +0200
+++ b/src/groupchat_control.py  Wed Jul 22 00:15:39 2009 +0200
@@ -1939,9 +1939,14 @@
                        ok_handler=on_ok)
 
        def _on_change_nick_menuitem_activate(self, widget):
-               title = _('Changing Nickname')
-               prompt = _('Please specify the new nickname you want to use:')
-               self.show_change_nick_input_dialog(title, prompt)
+               if 'change_nick_dialog' in gajim.interface.instances:
+                       
gajim.interface.instances['change_nick_dialog'].present()
+               else:
+                       title = _('Changing Nickname')
+                       prompt = _('Please specify the new nickname you want to 
use:')
+                       gajim.interface.instances['change_nick_dialog'] = \
+                               dialogs.ChangeNickDialog(self.account, 
self.room_jid, title,
+                               prompt)
 
        def _on_configure_room_menuitem_activate(self, widget):
                c = gajim.contacts.get_gc_contact(self.account, self.room_jid, 
self.nick)
diff -r b765732974a5 -r cb42499016b1 src/music_track_listener.py
--- a/src/music_track_listener.py       Sun Jul 19 21:56:34 2009 +0200
+++ b/src/music_track_listener.py       Wed Jul 22 00:15:39 2009 +0200
@@ -130,10 +130,16 @@
                return info
 
        def _mpris_playing_changed_cb(self, playing):
-               if playing[0] == 0:
-                       self.emit('music-track-changed', 
self._last_playing_music)
-               else:
-                       self.emit('music-track-changed', None)
+               if type(playing) is dbus.Struct:
+                       if playing[0]:
+                               self.emit('music-track-changed', None)
+                       else:
+                               self.emit('music-track-changed', 
self._last_playing_music)
+               else: # Workaround for e.g. Audacious
+                       if playing:
+                               self.emit('music-track-changed', None)
+                       else:
+                               self.emit('music-track-changed', 
self._last_playing_music)
 
        def _mpris_music_track_change_cb(self, arg):
                self._last_playing_music = self._mpris_properties_extract(arg)
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to