Logo Search packages:      
Sourcecode: gajim version File versions  Download package

def roster_window::RosterWindow::on_roster_treeview_row_activated (   self,
  widget,
  path,
  col = 0 
)

When an iter is double clicked: open the first event window

Definition at line 2488 of file roster_window.py.

02488                                                                        :
            '''When an iter is double clicked: open the first event window'''
            model = self.tree.get_model()
            account = model[path][C_ACCOUNT].decode('utf-8')
            type = model[path][C_TYPE]
            jid = model[path][C_JID].decode('utf-8')
            resource = None
            iter = model.get_iter(path)
            if type in ('group', 'account'):
                  if self.tree.row_expanded(path):
                        self.tree.collapse_row(path)
                  else:
                        self.tree.expand_row(path, False)
            else:
                  first_ev = gajim.get_first_event(account, jid)
                  if not first_ev:
                        # look in other resources
                        for c in gajim.contacts.get_contact(account, jid):
                              fjid = c.get_full_jid()
                              first_ev = gajim.get_first_event(account, fjid)
                              if first_ev:
                                    resource = c.resource
                                    break
                  if not first_ev and model.iter_has_child(iter):
                        child_iter = model.iter_children(iter)
                        while not first_ev and child_iter:
                              child_jid = model[child_iter][C_JID].decode('utf-8')
                              first_ev = gajim.get_first_event(account, child_jid)
                              if first_ev:
                                    jid = child_jid
                              else:
                                    child_iter = model.iter_next(child_iter)
                  if first_ev:
                        fjid = jid
                        if resource:
                              fjid += '/' + resource
                        if self.open_event(account, fjid, first_ev):
                              return
                  c = gajim.contacts.get_contact_with_highest_priority(account, jid)
                  self.on_open_chat_window(widget, c, account, resource = resource)

      def on_roster_treeview_row_expanded(self, widget, iter, path):


Generated by  Doxygen 1.6.0   Back to index