(self)
Class initialiser
Class initialiser
Class initialiser
def __init__(self):
        """Class initialiser"""
        GObject.GObject.__init__(self)

        self.terminator = Terminator()
        self.terminator.register_terminal(self)

        # FIXME: Surely these should happen in Terminator::register_terminal()?
        self.connect('enumerate', self.terminator.do_enumerate)
        self.connect('focus-in', self.terminator.focus_changed)
        self.connect('focus-out', self.terminator.focus_left)

        self.matches = {}
        self.cnxids = Signalman()

        self.config = Config()

        self.cwd = get_pid_cwd()
        self.origcwd = self.terminator.origcwd
        self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)

        self.pending_on_vte_size_allocate = False

        self.vte = Vte.Terminal()
        self.vte.set_allow_hyperlink(True)
        self.vte._draw_data = None
        if not hasattr(self.vte, "set_opacity") or \
           not hasattr(self.vte, "is_composited"):
            self.composite_support = False
        else:
            self.composite_support = True
        dbg('composite_support: %s' % self.composite_support)

        self.vte.show()
        self.update_url_matches()

        self.terminalbox = self.create_terminalbox()

        self.titlebar = Titlebar(self)
        self.titlebar.connect_icon(self.on_group_button_press)
        self.titlebar.connect('edit-done', self.on_edit_done)
        self.connect('title-change', self.titlebar.set_terminal_title)
        self.titlebar.connect('create-group', self.really_create_group)
        self.titlebar.update('window-focus-out')
        self.titlebar.show_all()

        self.searchbar = Searchbar()
        self.searchbar.connect('end-search', self.on_search_done)

        self.show()
        if self.config['title_at_bottom']:
            self.pack_start(self.terminalbox, True, True, 0)
            self.pack_start(self.titlebar, False, True, 0)
        else:
            self.pack_start(self.titlebar, False, True, 0)
            self.pack_start(self.terminalbox, True, True, 0)

        self.pack_end(self.searchbar, True, True, 0)

        self.connect_signals()

        os.putenv('TERM', self.config['term'])
        os.putenv('COLORTERM', self.config['colorterm'])

        env_proxy = os.getenv('http_proxy')
        if not env_proxy:
            if self.config['http_proxy'] and self.config['http_proxy'] != '':
                os.putenv('http_proxy', self.config['http_proxy'])
        self.reconfigure()
        self.vte.set_size(80, 24)
def __init__ ( self ) : GObject . GObject . __init__ ( self ) self . terminator = Terminator ( ) self . terminator . register_terminal ( self ) # FIXME: Surely these should happen in Terminator::register_terminal()? self . connect ( 'enumerate' , self . terminator . do_enumerate ) self . connect ( 'focus-in' , self . terminator . focus_changed ) self . connect ( 'focus-out' , self . terminator . focus_left ) self . matches = { } self . cnxids = Signalman ( ) self . config = Config ( ) self . cwd = get_pid_cwd ( ) self . origcwd = self . terminator . origcwd self . clipboard = Gtk . Clipboard . get ( Gdk . SELECTION_CLIPBOARD ) self . pending_on_vte_size_allocate = False self . vte = Vte . Terminal ( ) self . vte . set_allow_hyperlink ( True ) self . vte . _draw_data = None if not hasattr ( self . vte , "set_opacity" ) or not hasattr ( self . vte , "is_composited" ) : self . composite_support = False else : self . composite_support = True dbg ( 'composite_support: %s' % self . composite_support ) self . vte . show ( ) self . update_url_matches ( ) self . terminalbox = self . create_terminalbox ( ) self . titlebar = Titlebar ( self ) self . titlebar . connect_icon ( self . on_group_button_press ) self . titlebar . connect ( 'edit-done' , self . on_edit_done ) self . connect ( 'title-change' , self . titlebar . set_terminal_title ) self . titlebar . connect ( 'create-group' , self . really_create_group ) self . titlebar . update ( 'window-focus-out' ) self . titlebar . show_all ( ) self . searchbar = Searchbar ( ) self . searchbar . connect ( 'end-search' , self . on_search_done ) self . show ( ) if self . config [ 'title_at_bottom' ] : self . pack_start ( self . terminalbox , True , True , 0 ) self . pack_start ( self . titlebar , False , True , 0 ) else : self . pack_start ( self . titlebar , False , True , 0 ) self . pack_start ( self . terminalbox , True , True , 0 ) self . pack_end ( self . searchbar , True , True , 0 ) self . connect_signals ( ) os . putenv ( 'TERM' , self . config [ 'term' ] ) os . putenv ( 'COLORTERM' , self . config [ 'colorterm' ] ) env_proxy = os . getenv ( 'http_proxy' ) if not env_proxy : if self . config [ 'http_proxy' ] and self . config [ 'http_proxy' ] != '' : os . putenv ( 'http_proxy' , self . config [ 'http_proxy' ] ) self . reconfigure ( ) self . vte . set_size ( 80 , 24 )