Changeset 2660 for trunk/src/systray.py

Show
Ignore:
Timestamp:
07/31/05 21:32:06 (3 years ago)
Author:
dkirov
Message:

removed useless code

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/systray.py

    r2659 r2660  
    5353                self.new_message_handler_id = None 
    5454                self.t = None 
    55                 #~ self.tip = gtk.Tooltips() 
    5655                self.img_tray = gtk.Image() 
    5756                self.status = 'offline' 
     
    8685                                                nb += jids[jid].nb_unread[jid] 
    8786 
    88                 self.set_tooltip(nb) # update the tooltip 
    89  
    9087        def remove_jid(self, jid, account): 
    9188                l = [account, jid] 
     
    10198                                        if jid != 'tabbed': 
    10299                                                nb += self.plugin.windows[acct][kind][jid].nb_unread[jid] 
    103                  
    104                 self.set_tooltip(nb) # update the tooltip 
    105          
    106         def change_status(self, global_status = None): 
    107                 ''' change the tooltip text and set tray image to 'global_status' ''' 
    108                 text, single, multiline, multilined = 'Gajim', '', '', False 
    109                 if gajim.contacts: 
    110                         for account in gajim.contacts.keys(): 
    111                                 status_idx = gajim.connections[account].connected 
    112                                 if status_idx == 0: 
    113                                         continue 
    114                                 status = STATUS_LIST[status_idx] 
    115                                 message = gajim.connections[account].status 
    116                                 single = helpers.get_uf_show(status) 
    117                                 if message is None: 
    118                                         message = '' 
    119                                 else: 
    120                                         message = message.strip() 
    121                                 if message != '': 
    122                                         single += ': ' + message 
    123                                 if multiline != '': 
    124                                         multilined = True 
    125                                 multiline += '\n  ' + account + '\n  \t' + single 
    126                 if multilined: 
    127                         text += multiline 
    128                 elif single != '': 
    129                         text += ' - ' + single 
    130                 else: 
    131                         text += ' - ' + helpers.get_uf_show('offline') 
    132                  
     100         
     101        def change_status(self, global_status): 
     102                ''' set tray image to 'global_status' ''' 
    133103                # change image and status, only if it is different  
    134104                if global_status is not None and self.status != global_status: 
    135105                        self.status = global_status 
    136106                self.set_img() 
    137                 #~ self.tip.set_tip(self.t, text) 
    138107         
    139108        def start_chat(self, widget, account, jid): 
     
    272241 
    273242        def on_clicked(self, widget, event): 
    274                 # hide the tooltip 
    275                 #~ self.tip.disable() 
    276                 #~ self.tip.enable() 
     243                self.on_tray_leave_notify_event(widget, None) 
    277244                win = self.plugin.roster.window 
    278245                if event.button == 1: # Left click 
     
    350317                        eb.connect('leave-notify-event', self.on_tray_leave_notify_event) 
    351318                        self.tooltip = dialogs.NotificationAreaTooltip(self.plugin) 
    352                         #~ self.set_tooltip() 
     319 
    353320                        self.img_tray = gtk.Image() 
    354321                        eb.add(self.img_tray) 
     
    357324                self.t.show_all() 
    358325         
    359         def set_tooltip(self, unread_messages_no=None): 
    360                 if unread_messages_no > 1: 
    361                         text = _('Gajim - %s unread messages') % unread_messages_no 
    362                 elif unread_messages_no == 1: 
    363                         text = _('Gajim - 1 unread message') 
    364                 else: # it's None or 0 
    365                         self.change_status() 
    366          
    367326        def hide_icon(self): 
    368327                if self.t: