Ticket #721: gc_tooltips.3.2.diff

File gc_tooltips.3.2.diff, 8.7 KB (added by dkirov, 5 years ago)

just changed "get_root_origin" to "get_origin" it is positioned now

  • src/tabbed_chat_window.py

     
    474474                if enter is pressed without the shift key, message (if not empty) is sent 
    475475                and printed in the conversation""" 
    476476 
    477                 jid = self.get_active_jid() 
     477                #jid = self.get_active_jid() 
    478478                conversation_textview = widget 
    479479                message_buffer = conversation_textview.get_buffer() 
    480480                start_iter, end_iter = message_buffer.get_bounds() 
     
    761761                        nb, line = gajim.logger.read(jid, count - 1 - pos, count - pos) 
    762762                        pos = pos + 1 
    763763 
    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) 
    765765                        if line == []: 
    766766                                break 
    767767                         
  • src/tooltips.py

     
    241241                self.text_lable.set_markup(text) 
    242242                self.hbox.add(self.table) 
    243243                self.win.add(self.hbox) 
     244class 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 
    244249                 
     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 
    245289class RosterTooltip(BaseTooltip, StatusTable): 
    246290        ''' Tooltip that is shown in the roster treeview ''' 
    247291        def __init__(self, plugin): 
     
    411455                text += status 
    412456                self.text_lable.set_markup(text) 
    413457                self.hbox.add(self.text_lable) 
    414                 self.win.add(self.hbox) 
     458                 
  • src/gtkgui.glade

     
    88658865                      <signal name="row_expanded" handler="on_list_treeview_row_expanded" last_modification_time="Sat, 05 Mar 2005 00:31:57 GMT"/> 
    88668866                      <signal name="button_press_event" handler="on_list_treeview_button_press_event" last_modification_time="Sat, 05 Mar 2005 00:32:05 GMT"/> 
    88678867                      <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"/> 
    88688870                    </widget> 
    88698871                  </child> 
    88708872                </widget> 
     
    1757417576              <accessibility> 
    1757517577                <atkproperty name="AtkObject::accessible_name" translatable="yes">Remove file transfer from the list.</atkproperty> 
    1757617578                <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"/> 
    1757817579              </accessibility> 
    1757917580              <signal name="clicked" handler="on_remove_button_clicked" last_modification_time="Wed, 03 Aug 2005 00:23:18 GMT"/> 
    1758017581            </widget> 
     
    1760817609              <accessibility> 
    1760917610                <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> 
    1761017611                <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"/> 
    1761217612              </accessibility> 
    1761317613              <signal name="clicked" handler="on_cancel_button_clicked" last_modification_time="Tue, 09 Aug 2005 17:07:31 GMT"/> 
    1761417614            </widget> 
     
    1765017650          <property name="draw_indicator">True</property> 
    1765117651          <accessibility> 
    1765217652            <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"/> 
    1765417653          </accessibility> 
    1765517654          <signal name="toggled" handler="on_notify_ft_complete_checkbox_toggled" last_modification_time="Wed, 31 Aug 2005 22:52:01 GMT"/> 
    1765617655        </widget> 
  • src/groupchat_window.py

     
    2727import cell_renderer_image 
    2828import gtkgui_helpers 
    2929import history_window 
     30import tooltips 
    3031 
    3132from gajim import Contact 
    3233from common import gajim 
     
    6566                self.gc_refer_to_nick_char = gajim.config.get('gc_refer_to_nick_char') 
    6667                self.new_room(room_jid, nick) 
    6768                self.show_title() 
     69                self.tooltip = tooltips.GCTooltip(plugin) 
    6870                 
    6971                 
    7072                # NOTE: if it not a window event, connect in new_room function 
     
    10771079                self.got_disconnected(room_jid) #init some variables 
    10781080                conversation_textview.grab_focus() 
    10791081                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         
    10811132        def on_treeview_size_allocate(self, widget, allocation): 
    10821133                """The MUC treeview has resized. Move the hpaneds in all tabs to match""" 
    10831134                thisroom_jid = self.get_active_jid() 
  • src/gajim.py

     
    11381138                        #else: 
    11391139                        #       self.systray_capabilities = True 
    11401140                        #       self.systray = systraywin32.SystrayWin32(self) 
     1141                        pass 
    11411142                else: 
    11421143                        try: 
    11431144                                import egg.trayicon # use gnomepythonextras trayicon