Author: js Date: 2008-10-24 19:28:36 +0200 (Fri, 24 Oct 2008) New Revision: 10573
Added: branches/osx_newbuildsys/TODO.pep branches/osx_newbuildsys/data/activities/default/talking/on_video_phone.png Removed: branches/osx_newbuildsys/TODO.pep branches/osx_newbuildsys/data/activities/default/talking/on_the_video_phone.png Modified: branches/osx_newbuildsys/README.html branches/osx_newbuildsys/data/activities/default/doing_chores/buying_groceries.png branches/osx_newbuildsys/data/activities/default/doing_chores/running_an_errand.png branches/osx_newbuildsys/data/activities/default/drinking/category.png branches/osx_newbuildsys/data/activities/default/eating/having_dinner.png branches/osx_newbuildsys/data/activities/default/exercising/working_out.png branches/osx_newbuildsys/data/activities/default/grooming/at_the_spa.png branches/osx_newbuildsys/data/activities/default/grooming/taking_a_shower.png branches/osx_newbuildsys/data/activities/default/inactive/day_off.png branches/osx_newbuildsys/data/activities/default/inactive/on_vacation.png branches/osx_newbuildsys/data/activities/default/inactive/scheduled_holiday.png branches/osx_newbuildsys/data/activities/default/inactive/sleeping.png branches/osx_newbuildsys/data/activities/default/traveling/cycling.png branches/osx_newbuildsys/data/activities/default/traveling/driving.png branches/osx_newbuildsys/data/activities/default/traveling/walking.png branches/osx_newbuildsys/src/chat_control.py branches/osx_newbuildsys/src/common/commands.py branches/osx_newbuildsys/src/common/connection_handlers.py branches/osx_newbuildsys/src/common/pep.py branches/osx_newbuildsys/src/common/xmpp/transports_nb.py branches/osx_newbuildsys/src/dialogs.py branches/osx_newbuildsys/src/gajim.py branches/osx_newbuildsys/src/gtkgui_helpers.py branches/osx_newbuildsys/src/roster_window.py Log: Merge trunk r10572.
Modified: branches/osx_newbuildsys/README.html =================================================================== --- branches/osx_newbuildsys/README.html 2008-10-24 17:24:10 UTC (rev 10572) +++ branches/osx_newbuildsys/README.html 2008-10-24 17:28:36 UTC (rev 10573) @@ -142,7 +142,7 @@ <br/> <br/> <br/> -(C) 2003-2006<br/> +(C) 2003-2008<br/> The Gajim Team<br/> http://gajim.org<br/> <br/>
Deleted: branches/osx_newbuildsys/TODO.pep =================================================================== --- branches/osx_newbuildsys/TODO.pep 2008-10-24 17:24:10 UTC (rev 10572) +++ branches/osx_newbuildsys/TODO.pep 2008-10-24 17:28:36 UTC (rev 10573) @@ -1,13 +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 - -Mood/Activity use cases -• on connection of an account set them to None -• on disconnection of an account set them to None -• on explicit set publish them
Copied: branches/osx_newbuildsys/TODO.pep (from rev 10572, trunk/TODO.pep) =================================================================== --- branches/osx_newbuildsys/TODO.pep (rev 0) +++ branches/osx_newbuildsys/TODO.pep 2008-10-24 17:28:36 UTC (rev 10573) @@ -0,0 +1,8 @@ +• 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
Modified: branches/osx_newbuildsys/data/activities/default/doing_chores/buying_groceries.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/doing_chores/running_an_errand.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/drinking/category.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/eating/having_dinner.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/exercising/working_out.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/grooming/at_the_spa.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/grooming/taking_a_shower.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/inactive/day_off.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/inactive/on_vacation.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/inactive/scheduled_holiday.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/inactive/sleeping.png =================================================================== (Binary files differ)
Deleted: branches/osx_newbuildsys/data/activities/default/talking/on_the_video_phone.png =================================================================== (Binary files differ)
Added: branches/osx_newbuildsys/data/activities/default/talking/on_video_phone.png =================================================================== (Binary files differ)
Property changes on: branches/osx_newbuildsys/data/activities/default/talking/on_video_phone.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream
Modified: branches/osx_newbuildsys/data/activities/default/traveling/cycling.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/traveling/driving.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/data/activities/default/traveling/walking.png =================================================================== (Binary files differ)
Modified: branches/osx_newbuildsys/src/chat_control.py =================================================================== --- branches/osx_newbuildsys/src/chat_control.py 2008-10-24 17:24:10 UTC (rev 10572) +++ branches/osx_newbuildsys/src/chat_control.py 2008-10-24 17:28:36 UTC (rev 10573) @@ -1239,12 +1239,15 @@
if activity is not None: if activity in ACTIVITIES: - self._activity_image.set_from_pixbuf( - gtkgui_helpers.load_activity_icon(activity).get_pixbuf()) # Translate standard activities if subactivity in ACTIVITIES[activity]: - subactivity = ACTIVITIES[activity] \ - [subactivity] + self._activity_image.set_from_pixbuf( + gtkgui_helpers.load_activity_icon(activity, subactivity). \ + get_pixbuf()) + subactivity = ACTIVITIES[activity][subactivity] + else: + self._activity_image.set_from_pixbuf( + gtkgui_helpers.load_activity_icon(activity).get_pixbuf()) activity = ACTIVITIES[activity]['category'] else: self._activity_image.set_from_pixbuf(
Modified: branches/osx_newbuildsys/src/common/commands.py =================================================================== --- branches/osx_newbuildsys/src/common/commands.py 2008-10-24 17:24:10 UTC (rev 10572) +++ branches/osx_newbuildsys/src/common/commands.py 2008-10-24 17:28:36 UTC (rev 10573) @@ -97,7 +97,7 @@ var = 'presence-type', label = 'Type of presence:', options = [ - (u'free-for-chat', _('Free for chat')), + (u'chat', _('Free for chat')), (u'online', _('Online')), (u'away', _('Away')), (u'xa', _('Extended away')), @@ -128,7 +128,7 @@ try: presencetype = form['presence-type'].value if not presencetype in \ - ('free-for-chat', 'online', 'away', 'xa', 'dnd', 'offline'): + ('chat', 'online', 'away', 'xa', 'dnd', 'offline'): self.badRequest(request) return False except Exception: # KeyError if there's no presence-type field in form or
Modified: branches/osx_newbuildsys/src/common/connection_handlers.py =================================================================== --- branches/osx_newbuildsys/src/common/connection_handlers.py 2008-10-24 17:24:10 UTC (rev 10572) +++ branches/osx_newbuildsys/src/common/connection_handlers.py 2008-10-24 17:28:36 UTC (rev 10573) @@ -1837,6 +1837,12 @@ subject=subject) except exceptions.PysqliteOperationalError, e: self.dispatch('ERROR', (_('Disk Write Error'), str(e))) + except exceptions.DatabaseMalformed: + pritext = _('Database Error') + sectext = _('The database file (%s) cannot be read. Try to repair ' + 'it (see http://trac.gajim.org/wiki/DatabaseBackup) or remove ' + 'it (all history will be lost).') % common.logger.LOG_DB_PATH + self.dispatch('ERROR', (pritext, sectext)) self.dispatch('MSGERROR', (frm, msg.getErrorCode(), error_msg, msgtxt, tim, session))
@@ -1877,6 +1883,12 @@ gajim.logger.write('gc_msg', frm, msgtxt, tim=tim) except exceptions.PysqliteOperationalError, e: self.dispatch('ERROR', (_('Disk Write Error'), str(e))) + except exceptions.DatabaseMalformed: + pritext = _('Database Error') + sectext = _('The database file (%s) cannot be read. Try to repair ' + 'it (see http://trac.gajim.org/wiki/DatabaseBackup) or remove ' + 'it (all history will be lost).') % common.logger.LOG_DB_PATH + self.dispatch('ERROR', (pritext, sectext))
def dispatch_invite_message(self, invite, frm): item = invite.getTag('invite') @@ -2059,6 +2071,13 @@ gajim.logger.write('gcstatus', who, st, show) except exceptions.PysqliteOperationalError, e: self.dispatch('ERROR', (_('Disk Write Error'), str(e))) + except exceptions.DatabaseMalformed: + pritext = _('Database Error') + sectext = _('The database file (%s) cannot be read. Try to ' + 'repair it (see http://trac.gajim.org/wiki/DatabaseBackup)' + ' or remove it (all history will be lost).') % \ + common.logger.LOG_DB_PATH + self.dispatch('ERROR', (pritext, sectext)) if avatar_sha or avatar_sha == '': if avatar_sha == '': # contact has no avatar @@ -2178,6 +2197,13 @@ gajim.logger.write('status', jid_stripped, status, show) except exceptions.PysqliteOperationalError, e: self.dispatch('ERROR', (_('Disk Write Error'), str(e))) + except exceptions.DatabaseMalformed: + pritext = _('Database Error') + sectext = _('The database file (%s) cannot be read. Try to ' + 'repair it (see http://trac.gajim.org/wiki/DatabaseBackup) ' + 'or remove it (all history will be lost).') % \ + common.logger.LOG_DB_PATH + self.dispatch('ERROR', (pritext, sectext)) our_jid = gajim.get_jid_from_account(self.name) if jid_stripped == our_jid and resource == self.server_resource: # We got our own presence
Modified: branches/osx_newbuildsys/src/common/pep.py =================================================================== --- branches/osx_newbuildsys/src/common/pep.py 2008-10-24 17:24:10 UTC (rev 10572) +++ branches/osx_newbuildsys/src/common/pep.py 2008-10-24 17:28:36 UTC (rev 10573) @@ -332,7 +332,7 @@ del acc.activity['text'] if activity is not None: acc.activity['activity'] = activity - if subactivity is not None: + if subactivity is not None and subactivity != 'other': acc.activity['subactivity'] = subactivity if text is not None: acc.activity['text'] = text @@ -355,7 +355,7 @@ del contact.activity['text'] if activity is not None: contact.activity['activity'] = activity - if subactivity is not None: + if subactivity is not None and subactivity != 'other': contact.activity['subactivity'] = subactivity if text is not None: contact.activity['text'] = text
Modified: branches/osx_newbuildsys/src/common/xmpp/transports_nb.py =================================================================== --- branches/osx_newbuildsys/src/common/xmpp/transports_nb.py 2008-10-24 17:24:10 UTC (rev 10572) +++ branches/osx_newbuildsys/src/common/xmpp/transports_nb.py 2008-10-24 17:28:36 UTC (rev 10573) @@ -472,7 +472,12 @@ return
if received is None: - if errnum != 0: + if self.state == 0 and errnum == errno.ECONNREFUSED: + # We tried to connect to a port that did't listen. + log.error("Connection to %s refused: %s [%d]", self.getName(), errtxt, errnum) + self.pollend(retry=True) + return + elif errnum != 0: self.DEBUG(errtxt, 'error') log.error("Connection to %s lost: %s [%d]", self.getName(), errtxt, errnum) self._owner.disconnected() @@ -565,6 +570,8 @@ return self.fd = self._sock.fileno() self.idlequeue.plug_idle(self, True, False) + self._send = self._sock.send + self._recv = self._sock.recv self.set_timeout(CONNECT_TIMEOUT_SECONDS) self._do_connect()
@@ -591,8 +598,6 @@ self._owner.Connection=self self.state = 1
- self._send = self._sock.send - self._recv = self._sock.recv self._plug_idle() if self.on_connect: self.on_connect()
Modified: branches/osx_newbuildsys/src/dialogs.py =================================================================== --- branches/osx_newbuildsys/src/dialogs.py 2008-10-24 17:24:10 UTC (rev 10572) +++ branches/osx_newbuildsys/src/dialogs.py 2008-10-24 17:28:36 UTC (rev 10573) @@ -320,9 +320,9 @@
class ChangeActivityDialog: - PAGELIST = ['working', 'eating', 'exercising', 'relaxing', 'talking', - 'doing_chores', 'inactive', 'traveling', 'having_appointment', - 'drinking', 'grooming'] + PAGELIST = ['doing_chores', 'drinking', 'eating', 'exercising', 'grooming', + 'having_appointment', 'inactive', 'relaxing', 'talking', 'traveling', + 'working']
def __init__(self, account): self.account = account @@ -1586,7 +1586,7 @@
def on_cancelbutton_clicked(self, widget): self.dialog.destroy() - if not cancel_handler: + if not self.cancel_handler: return if isinstance(self.cancel_handler, tuple): self.cancel_handler[0](*self.cancel_handler[1:])
Modified: branches/osx_newbuildsys/src/gajim.py =================================================================== --- branches/osx_newbuildsys/src/gajim.py 2008-10-24 17:24:10 UTC (rev 10572) +++ branches/osx_newbuildsys/src/gajim.py 2008-10-24 17:28:36 UTC (rev 10573) @@ -175,7 +175,7 @@ from common import gajim except exceptions.DatabaseMalformed: pritext = _('Database Error') - sectext = _('The database file (%s) cannot be read. Try to repair it or remove it (all history will be lost).') % common.logger.LOG_DB_PATH + sectext = _('The database file (%s) cannot be read. Try to repair it (see http://trac.gajim.org/wiki/DatabaseBackup) or remove it (all history will be lost).') % common.logger.LOG_DB_PATH else: from common import dbus_support if dbus_support.supported: @@ -2607,12 +2607,11 @@ _('You cannot join a group chat while you are invisible')) return
- minimized_control_exists = False - if room_jid in gajim.interface.minimized_controls[account]: - minimized_control_exists = True + minimized_control = gajim.interface.minimized_controls[account].get( + room_jid, None)
- if not minimized_control_exists and \ - not self.msg_win_mgr.has_window(room_jid, account): + if minimized_control is None and not self.msg_win_mgr.has_window(room_jid, + account): # Join new groupchat if minimize: contact = gajim.contacts.create_contact(jid=room_jid, name=nick) @@ -2621,12 +2620,14 @@ self.roster.add_groupchat(room_jid, account) else: self.new_room(room_jid, nick, account, is_continued=is_continued) - elif not minimized_control_exists: + elif minimized_control is None: # We are already in that groupchat gc_control = self.msg_win_mgr.get_gc_control(room_jid, account) + gc_control.nick = nick gc_control.parent_win.set_active_tab(gc_control) else: # We are already in this groupchat and it is minimized + minimized_control.nick = nick self.roster.add_groupchat(room_jid, account)
# Connect
Modified: branches/osx_newbuildsys/src/gtkgui_helpers.py =================================================================== --- branches/osx_newbuildsys/src/gtkgui_helpers.py 2008-10-24 17:24:10 UTC (rev 10572) +++ branches/osx_newbuildsys/src/gtkgui_helpers.py 2008-10-24 17:28:36 UTC (rev 10573) @@ -904,8 +904,6 @@
def load_activity_icon(category, activity = None): '''load an icon from the activity iconset in 16x16''' - print category - print activity iconset = gajim.config.get('activity_iconset') path = os.path.join(helpers.get_activity_iconset_path(iconset), category, '')
Modified: branches/osx_newbuildsys/src/roster_window.py =================================================================== --- branches/osx_newbuildsys/src/roster_window.py 2008-10-24 17:24:10 UTC (rev 10572) +++ branches/osx_newbuildsys/src/roster_window.py 2008-10-24 17:28:36 UTC (rev 10573) @@ -996,10 +996,19 @@ and 'activity' in gajim.connections[account].activity \ and gajim.connections[account].activity['activity'].strip() \ in ACTIVITIES: - self.model[child_iter][C_ACTIVITY_PIXBUF] = \ - gtkgui_helpers.load_activity_icon( - gajim.connections[account]. \ - activity['activity'].strip()).get_pixbuf() + if 'subactivity' in gajim.connections[account].activity \ + and gajim.connections[account].activity['subactivity'].strip() \ + in ACTIVITIES[gajim.connections[account].activity['activity'].strip()]: + self.model[child_iter][C_ACTIVITY_PIXBUF] = \ + gtkgui_helpers.load_activity_icon( + gajim.connections[account].activity['activity'].strip(), + gajim.connections[account].activity['subactivity'].strip()). \ + get_pixbuf() + else: + self.model[child_iter][C_ACTIVITY_PIXBUF] = \ + gtkgui_helpers.load_activity_icon( + gajim.connections[account].activity['activity'].strip()). \ + get_pixbuf() elif gajim.config.get('show_activity_in_roster') \ and 'activity' in gajim.connections[account].activity: self.model[child_iter][C_ACTIVITY_PIXBUF] = \ @@ -1247,8 +1256,15 @@ contact = gajim.contacts.get_contact(account, jid) if 'activity' in contact.activity \ and contact.activity['activity'].strip() in ACTIVITIES: - pixbuf = gtkgui_helpers.load_activity_icon( - contact.activity['activity'].strip()).get_pixbuf() + if 'subactivity' in contact.activity \ + and contact.activity['subactivity'].strip() in \ + ACTIVITIES[contact.activity['activity'].strip()]: + pixbuf = gtkgui_helpers.load_activity_icon( + contact.activity['activity'].strip(), + contact.activity['subactivity'].strip()).get_pixbuf() + else: + pixbuf = gtkgui_helpers.load_activity_icon( + contact.activity['activity'].strip()).get_pixbuf() elif 'activity' in contact.activity: pixbuf = gtkgui_helpers.load_activity_icon( 'unknown').get_pixbuf() @@ -2074,9 +2090,9 @@ for jid in gajim.contacts.get_jid_list(account): lcontact = gajim.contacts.get_contacts(account, jid) ctrl = gajim.interface.msg_win_mgr.get_gc_control(jid, account) - for contact in lcontact: - if (contact.show != 'offline' or contact.is_transport()) and not ctrl: - self.chg_contact_status(contact, 'offline', '', account) + for contact in [c for c in lcontact if ((c.show != 'offline' or \ + c.is_transport()) and not ctrl)]: + self.chg_contact_status(contact, 'offline', '', account) self.actions_menu_needs_rebuild = True self.update_status_combobox() # Force the rebuild now since the on_activates on the menu itself does