Ticket #721: gc_tooltips.diff
| File gc_tooltips.diff, 8.5 KB (added by Sef, 5 years ago) |
|---|
-
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 # primary contact 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 single_line, resource_str, multiple_resource= '', '', False 274 num_resources = 0 275 276 self.text_lable.set_markup(info) 277 self.hbox.pack_start(self.image, False, False) 278 self.hbox.pack_start(self.table, True, True) 279 self.win.add(self.hbox) 280 281 245 282 class RosterTooltip(BaseTooltip, StatusTable): 246 283 ''' Tooltip that is shown in the roster treeview ''' 247 284 def __init__(self, plugin): … … 411 448 text += status 412 449 self.text_lable.set_markup(text) 413 450 self.hbox.add(self.text_lable) 414 self.win.add(self.hbox)451 -
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 … … 74 76 'on_groupchat_window_focus_in_event': self.on_groupchat_window_focus_in_event, 75 77 'on_groupchat_window_focus_out_event': self.on_groupchat_window_focus_out_event, 76 78 'on_chat_notebook_key_press_event': self.on_chat_notebook_key_press_event, 79 #'on_list_treeview_motion_notify_event': self.on_list_treeview_motion_notify_event, 80 #'on_list_treeview_leave_notify_event': self.on_list_treeview_leave_notify_event, 77 81 } 78 82 79 83 self.xml.signal_autoconnect(signal_dict) … … 1077 1081 self.got_disconnected(room_jid) #init some variables 1078 1082 conversation_textview.grab_focus() 1079 1083 self.childs[room_jid].show_all() 1080 1084 1085 def on_list_treeview_motion_notify_event(self, widget, event): 1086 model = widget.get_model() 1087 props = widget.get_path_at_pos(int(event.x), int(event.y)) 1088 if self.tooltip.timeout > 0: 1089 if not props or self.tooltip.id != props[0]: 1090 self.tooltip.hide_tooltip() 1091 if props: 1092 [row, col, x, y] = props 1093 iter = None 1094 try: 1095 iter = model.get_iter(row) 1096 except: 1097 self.tooltip.hide_tooltip() 1098 return 1099 #print model[iter][2] 1100 room_jid = self.get_active_jid() 1101 nick = model[iter][1] 1102 fjid = gajim.construct_fjid(room_jid, nick) 1103 #print nick,fjid 1104 #print self.plugin.windows[self.account]['gc'] 1105 #print gajim.gc_contacts[self.account] 1106 if nick != 'moderator' and nick !='participant' : 1107 #print model[iter][1], model[iter][2], model[iter][0] 1108 account = self.account 1109 jid = fjid 1110 img = model[iter][0] 1111 if self.tooltip.timeout == 0 or self.tooltip.id != props[0]: 1112 self.tooltip.id = row 1113 self.tooltip.timeout = gobject.timeout_add(500, 1114 self.show_tooltip, gajim.gc_contacts[account][room_jid][nick]) 1115 pass 1116 1117 def on_list_treeview_leave_notify_event(self, widget, event): 1118 model = widget.get_model() 1119 props = widget.get_path_at_pos(int(event.x), int(event.y)) 1120 if self.tooltip.timeout > 0: 1121 if not props or self.tooltip.id == props[0]: 1122 self.tooltip.hide_tooltip() 1123 pass 1124 1125 def show_tooltip(self, contact): 1126 room_jid = self.get_active_jid() 1127 pointer = self.list_treeview[room_jid].get_pointer() 1128 props = self.list_treeview[room_jid].get_path_at_pos(pointer[0], pointer[1]) 1129 if props and self.tooltip.id == props[0]: 1130 # check if the current pointer is at the same path 1131 # as it was before setting the timeout 1132 rect = self.list_treeview[room_jid].get_cell_area(props[0],props[1]) 1133 position = self.list_treeview[room_jid].window.get_root_origin() 1134 pointer = self.window.get_pointer() 1135 self.tooltip.show_tooltip(contact, (pointer[0], rect.height ), 1136 (position[0], position[1] + rect.width)) 1137 else: 1138 self.tooltip.hide_tooltip() 1139 1081 1140 def on_treeview_size_allocate(self, widget, allocation): 1082 1141 """The MUC treeview has resized. Move the hpaneds in all tabs to match""" 1083 1142 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
