(self, other=None)
Update our contents
Update our contents
Update our contents
def update(self, other=None):
        """Update our contents"""
        default_bg = False

        temp_heldtext_str = ''
        temp_sizetext_str = ''

        if self.terminal.is_held_open:
            temp_heldtext_str = _('[INACTIVE: Right-Click for Relaunch option] ')
        if not self.config['title_hide_sizetext']:
            temp_sizetext_str = " %s" % (self.sizetext)
        self.label.set_text("%s%s%s" % (temp_heldtext_str, self.termtext, temp_sizetext_str))

        if (not self.config['title_use_system_font']) and self.config['title_font']:
            title_font = Pango.FontDescription(self.config['title_font'])
        else:
            title_font = Pango.FontDescription(self.config.get_system_prop_font())
        self.label.modify_font(title_font)
        self.grouplabel.modify_font(title_font)

        if other:
            term = self.terminal
            terminator = self.terminator
            if other == 'window-focus-out':
                title_fg = self.config['title_inactive_fg_color']
                title_bg = self.config['title_inactive_bg_color']
                icon = '_receive_off'
                default_bg = True
                group_fg = self.config['title_inactive_fg_color']
                group_bg = self.config['title_inactive_bg_color']
            elif term != other and term.group and term.group == other.group:
                if terminator.groupsend == terminator.groupsend_type['off']:
                    title_fg = self.config['title_inactive_fg_color']
                    title_bg = self.config['title_inactive_bg_color']
                    icon = '_receive_off'
                    default_bg = True
                else:
                    title_fg = self.config['title_receive_fg_color']
                    title_bg = self.config['title_receive_bg_color']
                    icon = '_receive_on'
                group_fg = self.config['title_receive_fg_color']
                group_bg = self.config['title_receive_bg_color']
            elif term != other and not term.group or term.group != other.group:
                if terminator.groupsend == terminator.groupsend_type['all']:
                    title_fg = self.config['title_receive_fg_color']
                    title_bg = self.config['title_receive_bg_color']
                    icon = '_receive_on'
                else:
                    title_fg = self.config['title_inactive_fg_color']
                    title_bg = self.config['title_inactive_bg_color']
                    icon = '_receive_off'
                    default_bg = True
                group_fg = self.config['title_inactive_fg_color']
                group_bg = self.config['title_inactive_bg_color']
            else:
                # We're the active terminal
                title_fg = self.config['title_transmit_fg_color']
                title_bg = self.config['title_transmit_bg_color']
                if terminator.groupsend == terminator.groupsend_type['all']:
                    icon = '_active_broadcast_all'
                elif terminator.groupsend == terminator.groupsend_type['group']:
                    icon = '_active_broadcast_group'
                else:
                    icon = '_active_broadcast_off'
                group_fg = self.config['title_transmit_fg_color']
                group_bg = self.config['title_transmit_bg_color']

            self.label.modify_fg(Gtk.StateType.NORMAL,
                    Gdk.color_parse(title_fg))
            self.grouplabel.modify_fg(Gtk.StateType.NORMAL,
                    Gdk.color_parse(group_fg))
            self.modify_bg(Gtk.StateType.NORMAL, 
                    Gdk.color_parse(title_bg))
            if not self.get_desired_visibility():
                if default_bg == True:
                    color = term.get_style_context().get_background_color(Gtk.StateType.NORMAL)  # VERIFY FOR GTK3
                else:
                    color = Gdk.color_parse(title_bg)
            self.update_visibility()
            self.ebox.modify_bg(Gtk.StateType.NORMAL,
                    Gdk.color_parse(group_bg))
            self.set_from_icon_name(icon, Gtk.IconSize.MENU)
def update ( self , other = None ) : default_bg = False temp_heldtext_str = '' temp_sizetext_str = '' if self . terminal . is_held_open : temp_heldtext_str = _ ( '[INACTIVE: Right-Click for Relaunch option] ' ) if not self . config [ 'title_hide_sizetext' ] : temp_sizetext_str = " %s" % ( self . sizetext ) self . label . set_text ( "%s%s%s" % ( temp_heldtext_str , self . termtext , temp_sizetext_str ) ) if ( not self . config [ 'title_use_system_font' ] ) and self . config [ 'title_font' ] : title_font = Pango . FontDescription ( self . config [ 'title_font' ] ) else : title_font = Pango . FontDescription ( self . config . get_system_prop_font ( ) ) self . label . modify_font ( title_font ) self . grouplabel . modify_font ( title_font ) if other : term = self . terminal terminator = self . terminator if other == 'window-focus-out' : title_fg = self . config [ 'title_inactive_fg_color' ] title_bg = self . config [ 'title_inactive_bg_color' ] icon = '_receive_off' default_bg = True group_fg = self . config [ 'title_inactive_fg_color' ] group_bg = self . config [ 'title_inactive_bg_color' ] elif term != other and term . group and term . group == other . group : if terminator . groupsend == terminator . groupsend_type [ 'off' ] : title_fg = self . config [ 'title_inactive_fg_color' ] title_bg = self . config [ 'title_inactive_bg_color' ] icon = '_receive_off' default_bg = True else : title_fg = self . config [ 'title_receive_fg_color' ] title_bg = self . config [ 'title_receive_bg_color' ] icon = '_receive_on' group_fg = self . config [ 'title_receive_fg_color' ] group_bg = self . config [ 'title_receive_bg_color' ] elif term != other and not term . group or term . group != other . group : if terminator . groupsend == terminator . groupsend_type [ 'all' ] : title_fg = self . config [ 'title_receive_fg_color' ] title_bg = self . config [ 'title_receive_bg_color' ] icon = '_receive_on' else : title_fg = self . config [ 'title_inactive_fg_color' ] title_bg = self . config [ 'title_inactive_bg_color' ] icon = '_receive_off' default_bg = True group_fg = self . config [ 'title_inactive_fg_color' ] group_bg = self . config [ 'title_inactive_bg_color' ] else : # We're the active terminal title_fg = self . config [ 'title_transmit_fg_color' ] title_bg = self . config [ 'title_transmit_bg_color' ] if terminator . groupsend == terminator . groupsend_type [ 'all' ] : icon = '_active_broadcast_all' elif terminator . groupsend == terminator . groupsend_type [ 'group' ] : icon = '_active_broadcast_group' else : icon = '_active_broadcast_off' group_fg = self . config [ 'title_transmit_fg_color' ] group_bg = self . config [ 'title_transmit_bg_color' ] self . label . modify_fg ( Gtk . StateType . NORMAL , Gdk . color_parse ( title_fg ) ) self . grouplabel . modify_fg ( Gtk . StateType . NORMAL , Gdk . color_parse ( group_fg ) ) self . modify_bg ( Gtk . StateType . NORMAL , Gdk . color_parse ( title_bg ) ) if not self . get_desired_visibility ( ) : if default_bg == True : color = term . get_style_context ( ) . get_background_color ( Gtk . StateType . NORMAL ) # VERIFY FOR GTK3 else : color = Gdk . color_parse ( title_bg ) self . update_visibility ( ) self . ebox . modify_bg ( Gtk . StateType . NORMAL , Gdk . color_parse ( group_bg ) ) self . set_from_icon_name ( icon , Gtk . IconSize . MENU )