Ticket #721: gc_tooltips.3.2.diff
| File gc_tooltips.3.2.diff, 8.7 KB (added by dkirov, 5 years ago) |
|---|
-
src/tabbed_chat_window.py
474 474 if enter is pressed without the shift key, message (if not empty) is sent 475 475 and printed in the conversation""" 476 476 477 jid = self.get_active_jid()477 #jid = self.get_active_jid() 478 478 conversation_textview = widget 479 479 message_buffer = conversation_textview.get_buffer() 480 480 start_iter, end_iter = message_buffer.get_bounds() … … 761 761 nb, line = gajim.logger.read(jid, count - 1 - pos, count - pos) 762 762 pos = pos + 1 763 763 764 # line is [] if log file for jid is not a file (does not exist or dir) 764 # line is [] if log file for jid is not a file (does not exist or dir) 765 765 if line == []: 766 766 break 767 767 -
src/tooltips.py
241 241 self.text_lable.set_markup(text) 242 242 self.hbox.add(self.table) 243 243 self.win.add(self.hbox) 244 class GCTooltip(BaseTooltip, StatusTable): 245 ''' Tooltip that is shown in the GC treeview ''' 246 def __init__(self, plugin): 247 self.account = None 248 self.plugin = plugin 244 249 250 self.image = gtk.Image() 251 self.image.set_alignment(0.5, 0.025) 252 BaseTooltip.__init__(self) 253 StatusTable.__init__(self) 254 255 def populate(self, contact): 256 if not contact : 257 return 258 self.create_window() 259 self.hbox = gtk.HBox() 260 self.hbox.set_homogeneous(False) 261 self.create_table() 262 263 264 info = '<span size="large" weight="bold">' + contact.name + '</span>' 265 info += '\n<span weight="bold">' + _('Role: ') + '</span>' + \ 266 gtkgui_helpers.escape_for_pango_markup(contact.role) 267 268 info += '\n<span weight="bold">' + _('Affiliation: ') + '</span>' + \ 269 gtkgui_helpers.escape_for_pango_markup(contact.affiliation) 270 271 info += '\n<span weight="bold">' + _('Status: ') + \ 272 '</span>' + helpers.get_uf_show(contact.show) 273 274 if contact.status: 275 status = contact.status.strip() 276 if status != '': 277 # escape markup entities. Is it posible to have markup in status? 278 info += ' - ' + gtkgui_helpers.escape_for_pango_markup(status) 279 280 #single_line, resource_str, multiple_resource= '', '', False 281 282 283 self.text_lable.set_markup(info) 284 self.hbox.pack_start(self.image, False, False) 285 self.hbox.pack_start(self.table, True, True) 286 self.win.add(self.hbox) 287 288 245 289 class RosterTooltip(BaseTooltip, StatusTable): 246 290 ''' Tooltip that is shown in the roster treeview ''' 247 291 def __init__(self, plugin): … … 411 455 text += status 412 456 self.text_lable.set_markup(text) 413 457 self.hbox.add(self.text_lable) 414 self.win.add(self.hbox)458 -
src/gtkgui.glade
8865 8865 <signal name="row_expanded" handler="on_list_treeview_row_expanded" last_modification_time="Sat, 05 Mar 2005 00:31:57 GMT"/> 8866 8866 <signal name="button_press_event" handler="on_list_treeview_button_press_event" last_modification_time="Sat, 05 Mar 2005 00:32:05 GMT"/> 8867 8867 <signal name="key_press_event" handler="on_list_treeview_key_press_event" last_modification_time="Sat, 26 Mar 2005 20:42:24 GMT"/> 8868 <signal name="motion_notify_event" handler="on_list_treeview_motion_notify_event" last_modification_time="Thu, 18 Aug 2005 23:11:24 GMT"/> 8869 <signal name="leave_notify_event" handler="on_list_treeview_leave_notify_event" last_modification_time="Thu, 18 Aug 2005 23:11:51 GMT"/> 8868 8870 </widget> 8869 8871 </child> 8870 8872 </widget> … … 17574 17576 <accessibility> 17575 17577 <atkproperty name="AtkObject::accessible_name" translatable="yes">Remove file transfer from the list.</atkproperty> 17576 17578 <atkproperty name="AtkObject::accessible_description" translatable="yes">This action removes single file transfer from the list. If the transfer is active, it is first stopped and then removed</atkproperty> 17577 <atkaction action_name="click" description="Removing selected file transfer"/>17578 17579 </accessibility> 17579 17580 <signal name="clicked" handler="on_remove_button_clicked" last_modification_time="Wed, 03 Aug 2005 00:23:18 GMT"/> 17580 17581 </widget> … … 17608 17609 <accessibility> 17609 17610 <atkproperty name="AtkObject::accessible_name" translatable="yes" comments="Ι'm a atk sting that should say Cancel instead of stop. say that to nkoukr">Stop file transfer</atkproperty> 17610 17611 <atkproperty name="AtkObject::accessible_description" translatable="yes" comments="Ι'm a atk sting that should say Cancel instead of stop and should not have space at the end nor dot. say that to nkour">Stops the selected file transfer. If there is an incomplete file, kept in the file system it will be removed. This operation is not reversable. </atkproperty> 17611 <atkaction action_name="click" description="Stoping selected file transfer"/>17612 17612 </accessibility> 17613 17613 <signal name="clicked" handler="on_cancel_button_clicked" last_modification_time="Tue, 09 Aug 2005 17:07:31 GMT"/> 17614 17614 </widget> … … 17650 17650 <property name="draw_indicator">True</property> 17651 17651 <accessibility> 17652 17652 <atkproperty name="AtkObject::accessible_description" translatable="yes" comments="I'm atk string. please remove my last space for 0.9. Remind that to nkour (he's a poor man)">When a file transfer is complete show a popup notification </atkproperty> 17653 <atkaction action_name="press" description="Activate/Disable notification for when a file transfer is complete"/>17654 17653 </accessibility> 17655 17654 <signal name="toggled" handler="on_notify_ft_complete_checkbox_toggled" last_modification_time="Wed, 31 Aug 2005 22:52:01 GMT"/> 17656 17655 </widget> -
src/groupchat_window.py
27 27 import cell_renderer_image 28 28 import gtkgui_helpers 29 29 import history_window 30 import tooltips 30 31 31 32 from gajim import Contact 32 33 from common import gajim … … 65 66 self.gc_refer_to_nick_char = gajim.config.get('gc_refer_to_nick_char') 66 67 self.new_room(room_jid, nick) 67 68 self.show_title() 69 self.tooltip = tooltips.GCTooltip(plugin) 68 70 69 71 70 72 # NOTE: if it not a window event, connect in new_room function … … 1077 1079 self.got_disconnected(room_jid) #init some variables 1078 1080 conversation_textview.grab_focus() 1079 1081 self.childs[room_jid].show_all() 1080 1082 1083 def on_list_treeview_motion_notify_event(self, widget, event): 1084 model = widget.get_model() 1085 props = widget.get_path_at_pos(int(event.x), int(event.y)) 1086 if self.tooltip.timeout > 0: 1087 if not props or self.tooltip.id != props[0]: 1088 self.tooltip.hide_tooltip() 1089 if props: 1090 [row, col, x, y] = props 1091 iter = None 1092 try: 1093 iter = model.get_iter(row) 1094 except: 1095 self.tooltip.hide_tooltip() 1096 return 1097 room_jid = self.get_active_jid() 1098 nick = model[iter][1] 1099 if nick != 'moderator' and nick !='participant' : 1100 account = self.account 1101 1102 img = model[iter][0] 1103 if self.tooltip.timeout == 0 or self.tooltip.id != props[0]: 1104 self.tooltip.id = row 1105 self.tooltip.timeout = gobject.timeout_add(500, 1106 self.show_tooltip, gajim.gc_contacts[account][room_jid][nick]) 1107 pass 1108 1109 def on_list_treeview_leave_notify_event(self, widget, event): 1110 model = widget.get_model() 1111 props = widget.get_path_at_pos(int(event.x), int(event.y)) 1112 if self.tooltip.timeout > 0: 1113 if not props or self.tooltip.id == props[0]: 1114 self.tooltip.hide_tooltip() 1115 pass 1116 1117 def show_tooltip(self, contact): 1118 room_jid = self.get_active_jid() 1119 pointer = self.list_treeview[room_jid].get_pointer() 1120 props = self.list_treeview[room_jid].get_path_at_pos(pointer[0], pointer[1]) 1121 if props and self.tooltip.id == props[0]: 1122 # check if the current pointer is at the same path 1123 # as it was before setting the timeout 1124 rect = self.list_treeview[room_jid].get_cell_area(props[0],props[1]) 1125 position = self.list_treeview[room_jid].window.get_origin() 1126 pointer = self.window.get_pointer() 1127 self.tooltip.show_tooltip(contact, (pointer[0], rect.height), 1128 (position[0], position[1] + rect.y)) 1129 else: 1130 self.tooltip.hide_tooltip() 1131 1081 1132 def on_treeview_size_allocate(self, widget, allocation): 1082 1133 """The MUC treeview has resized. Move the hpaneds in all tabs to match""" 1083 1134 thisroom_jid = self.get_active_jid() -
src/gajim.py
1138 1138 #else: 1139 1139 # self.systray_capabilities = True 1140 1140 # self.systray = systraywin32.SystrayWin32(self) 1141 pass 1141 1142 else: 1142 1143 try: 1143 1144 import egg.trayicon # use gnomepythonextras trayicon
