Changeset 2660 for trunk/src/systray.py
- Timestamp:
- 07/31/05 21:32:06 (3 years ago)
- Files:
-
- 1 modified
-
trunk/src/systray.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/systray.py
r2659 r2660 53 53 self.new_message_handler_id = None 54 54 self.t = None 55 #~ self.tip = gtk.Tooltips()56 55 self.img_tray = gtk.Image() 57 56 self.status = 'offline' … … 86 85 nb += jids[jid].nb_unread[jid] 87 86 88 self.set_tooltip(nb) # update the tooltip89 90 87 def remove_jid(self, jid, account): 91 88 l = [account, jid] … … 101 98 if jid != 'tabbed': 102 99 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' ''' 133 103 # change image and status, only if it is different 134 104 if global_status is not None and self.status != global_status: 135 105 self.status = global_status 136 106 self.set_img() 137 #~ self.tip.set_tip(self.t, text)138 107 139 108 def start_chat(self, widget, account, jid): … … 272 241 273 242 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) 277 244 win = self.plugin.roster.window 278 245 if event.button == 1: # Left click … … 350 317 eb.connect('leave-notify-event', self.on_tray_leave_notify_event) 351 318 self.tooltip = dialogs.NotificationAreaTooltip(self.plugin) 352 #~ self.set_tooltip() 319 353 320 self.img_tray = gtk.Image() 354 321 eb.add(self.img_tray) … … 357 324 self.t.show_all() 358 325 359 def set_tooltip(self, unread_messages_no=None):360 if unread_messages_no > 1:361 text = _('Gajim - %s unread messages') % unread_messages_no362 elif unread_messages_no == 1:363 text = _('Gajim - 1 unread message')364 else: # it's None or 0365 self.change_status()366 367 326 def hide_icon(self): 368 327 if self.t:
