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

def roster_window::RosterWindow::nameCellDataFunc (   self,
  column,
  renderer,
  model,
  iter,
  data = None 
)

When a row is added, set properties for name renderer

Definition at line 2833 of file roster_window.py.

02833                                                                             :
            '''When a row is added, set properties for name renderer'''
            theme = gajim.config.get('roster_theme')
            if model[iter][C_TYPE] == 'account':
                  color = gajim.config.get_per('themes', theme, 'accounttextcolor')
                  if color:
                        renderer.set_property('foreground', color)
                  else:
                        self.set_renderer_color(renderer, gtk.STATE_ACTIVE, False)
                  color = gajim.config.get_per('themes', theme, 'accountbgcolor')
                  if color:
                        renderer.set_property('cell-background', color)
                  else:
                        self.set_renderer_color(renderer, gtk.STATE_ACTIVE)
                  renderer.set_property('font',
                        gtkgui_helpers.get_theme_font_for_option(theme, 'accountfont'))
                  renderer.set_property('xpad', 0)
                  renderer.set_property('width', 3)
            elif model[iter][C_TYPE] == 'group':
                  color = gajim.config.get_per('themes', theme, 'grouptextcolor')
                  if color:
                        renderer.set_property('foreground', color)
                  else:
                        self.set_renderer_color(renderer, gtk.STATE_PRELIGHT, False)
                  color = gajim.config.get_per('themes', theme, 'groupbgcolor')
                  if color:
                        renderer.set_property('cell-background', color)
                  else:
                        self.set_renderer_color(renderer, gtk.STATE_PRELIGHT)
                  renderer.set_property('font',
                        gtkgui_helpers.get_theme_font_for_option(theme, 'groupfont'))
                  renderer.set_property('xpad', 4)
            else:
                  jid = model[iter][C_JID].decode('utf-8')
                  account = model[iter][C_ACCOUNT].decode('utf-8')
                  color = gajim.config.get_per('themes', theme, 'contacttextcolor')
                  if color:
                        renderer.set_property('foreground', color)
                  else:
                        renderer.set_property('foreground', None)
                  if jid in gajim.newly_added[account]:
                        renderer.set_property('cell-background', '#adc3c6')
                  elif jid in gajim.to_be_removed[account]:
                        renderer.set_property('cell-background', '#ab6161')
                  else:
                        color = gajim.config.get_per('themes', theme, 'contactbgcolor')
                        if color:
                              renderer.set_property('cell-background', color)
                        else:
                              renderer.set_property('cell-background', None)
                  renderer.set_property('font',
                        gtkgui_helpers.get_theme_font_for_option(theme, 'contactfont'))
                  parent_iter = model.iter_parent(iter)
                  if model[parent_iter][C_TYPE] == 'contact':
                        renderer.set_property('xpad', 16)
                  else:
                        renderer.set_property('xpad', 8)

      def fill_secondary_pixbuf_rederer(self, column, renderer, model, iter, data=None):


Generated by  Doxygen 1.6.0   Back to index