Changeset 8722 for branches/gajim_0.11.1

Show
Ignore:
Timestamp:
09/04/07 23:47:12 (15 months ago)
Author:
asterix
Message:

catch traceback and show error message when we try to change our nickname with not allowed chars

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11.1/src/groupchat_control.py

    r8712 r8722  
    10931093                        if len(message_array) and message_array[0] != self.nick: 
    10941094                                nick = message_array[0] 
    1095                                 nick = helpers.parse_resource(nick) 
     1095                                try: 
     1096                                        nick = helpers.parse_resource(nick) 
     1097                                except: 
     1098                                        # Invalid Nickname 
     1099                                        dialogs.ErrorDialog(_('Invalid nickname'), 
     1100                                        _('The nickname has not allowed characters.')) 
     1101                                        return True 
    10961102                                gajim.connections[self.account].join_gc(nick, self.room_jid, None) 
    10971103                                self.clear(self.msg_textview) 
     
    13741380                def on_ok(widget): 
    13751381                        nick = instance.input_entry.get_text().decode('utf-8') 
    1376                         nick = helpers.parse_resource(nick) 
     1382                        try: 
     1383                                nick = helpers.parse_resource(nick) 
     1384                        except: 
     1385                                # invalid char 
     1386                                dialogs.ErrorDialog(_('Invalid nickname'), 
     1387                                _('The nickname has not allowed characters.')) 
     1388                                return 
    13771389                        gajim.connections[self.account].join_gc(nick, self.room_jid, None) 
    13781390                instance = dialogs.InputDialog(title, prompt, proposed_nick,