Changeset 2661

Show
Ignore:
Timestamp:
07/31/05 23:16:20 (3 years ago)
Author:
dkirov
Message:

fixed "Pan Taduesz; Ksiega I" problem

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/dialogs.py

    r2659 r2661  
    624624                        status = status.strip() 
    625625                        if status != '': 
     626                                status = self.strip_text(status, 50) 
    626627                                str_status += ' - ' + status 
    627628                return gtkgui_helpers.escape_for_pango_markup(str_status) 
    628                  
     629         
     630        # "Pan Taduesz; Ksiega I" problem, reported by koorek 
     631        def strip_text(self, text, max_length): 
     632                text = text.strip() 
     633                if len(text) > max_length: 
     634                                text = text[:max_length - 3] + '...' 
     635                return text 
     636         
    629637        def add_status_row(self, file_path, show, str_status): 
    630638                ''' appends a new row with status icon to the table ''' 
     
    701709                        file_path = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '16x16') 
    702710                        for acct in accounts: 
     711                                mesage = gtkgui_helpers.escape_for_pango_markup(acct['message']) 
     712                                mesage = self.strip_text(mesage, 50) 
    703713                                self.add_status_row(file_path, acct['show'], '<span weight="bold">' +  
    704714                                        gtkgui_helpers.escape_for_pango_markup(acct['name']) + '</span>'  
    705                                         + ' - ' + gtkgui_helpers.escape_for_pango_markup(acct['message'])) 
     715                                        + ' - ' + mesage) 
    706716                                         
    707717                elif len(accounts) == 1: