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

        # default regex flags are not CASELESS
        self.regex_flags_pcre2 = regex.FLAGS_PCRE2
        self.regex_flags_glib = regex.FLAGS_GLIB

        self.config = Config()

        self.get_style_context().add_class("terminator-terminal-searchbar")

        # Search text
        self.entry = Gtk.Entry()
        self.entry.set_activates_default(True)
        self.entry.show()
        self.entry.connect('activate', self.do_search)
        self.entry.connect('key-press-event', self.search_keypress)

        # Label
        label = Gtk.Label(label=_('Search:'))
        label.show()

        # Close Button
        close = Gtk.Button()
        close.set_relief(Gtk.ReliefStyle.NONE)
        close.set_focus_on_click(False)
        icon = Gtk.Image()
        icon.set_from_stock(Gtk.STOCK_CLOSE, Gtk.IconSize.MENU)
        close.add(icon)
        close.set_name('terminator-search-close-button')
        if hasattr(close, 'set_tooltip_text'):
            close.set_tooltip_text(_('Close Search bar'))
        close.connect('clicked', self.end_search)
        close.show_all()

        # Next Button
        self.next = Gtk.Button.new_with_label('Next')
        self.next.show()
        self.next.set_sensitive(False)
        self.next.connect('clicked', self.next_search)

        # Previous Button
        self.prev = Gtk.Button.new_with_label('Prev')
        self.prev.show()
        self.prev.set_sensitive(False)
        self.prev.connect('clicked', self.prev_search)

        # Match Case checkbox
        self.match_case = Gtk.CheckButton.new_with_label('Match Case')
        self.match_case.show()
        self.match_case.set_sensitive(True)
        self.match_case.set_active(self.config.base.get_item('case_sensitive'))
        self.match_case.connect('toggled', self.match_case_toggled)

        # Wrap checkbox
        self.wrap = Gtk.CheckButton.new_with_label('Wrap')
        self.wrap.show()
        self.wrap.set_sensitive(True)
        self.wrap.set_active(True)
        self.wrap.connect('toggled', self.wrap_toggled)

        # Invert Search checkbox
        self.invert_search = Gtk.CheckButton.new_with_label('Invert Search')
        self.invert_search.show()
        self.search_is_inverted = self.config.base.get_item('invert_search')
        self.invert_search.set_active(self.search_is_inverted)
        self.invert_search.connect('toggled', self.wrap_invert_search)

        self.pack_start(label, False, True, 0)
        self.pack_start(self.entry, True, True, 0)
        self.pack_start(self.prev, False, False, 0)
        self.pack_start(self.next, False, False, 0)
        self.pack_start(self.wrap, False, False, 0)
        self.pack_start(self.match_case, False, False, 0)
        self.pack_start(self.invert_search, False, False, 0)
        self.pack_end(close, False, False, 0)

        self.hide()
        self.set_no_show_all(True)
def __init__ ( self ) : GObject . GObject . __init__ ( self ) # default regex flags are not CASELESS self . regex_flags_pcre2 = regex . FLAGS_PCRE2 self . regex_flags_glib = regex . FLAGS_GLIB self . config = Config ( ) self . get_style_context ( ) . add_class ( "terminator-terminal-searchbar" ) # Search text self . entry = Gtk . Entry ( ) self . entry . set_activates_default ( True ) self . entry . show ( ) self . entry . connect ( 'activate' , self . do_search ) self . entry . connect ( 'key-press-event' , self . search_keypress ) # Label label = Gtk . Label ( label = _ ( 'Search:' ) ) label . show ( ) # Close Button close = Gtk . Button ( ) close . set_relief ( Gtk . ReliefStyle . NONE ) close . set_focus_on_click ( False ) icon = Gtk . Image ( ) icon . set_from_stock ( Gtk . STOCK_CLOSE , Gtk . IconSize . MENU ) close . add ( icon ) close . set_name ( 'terminator-search-close-button' ) if hasattr ( close , 'set_tooltip_text' ) : close . set_tooltip_text ( _ ( 'Close Search bar' ) ) close . connect ( 'clicked' , self . end_search ) close . show_all ( ) # Next Button self . next = Gtk . Button . new_with_label ( 'Next' ) self . next . show ( ) self . next . set_sensitive ( False ) self . next . connect ( 'clicked' , self . next_search ) # Previous Button self . prev = Gtk . Button . new_with_label ( 'Prev' ) self . prev . show ( ) self . prev . set_sensitive ( False ) self . prev . connect ( 'clicked' , self . prev_search ) # Match Case checkbox self . match_case = Gtk . CheckButton . new_with_label ( 'Match Case' ) self . match_case . show ( ) self . match_case . set_sensitive ( True ) self . match_case . set_active ( self . config . base . get_item ( 'case_sensitive' ) ) self . match_case . connect ( 'toggled' , self . match_case_toggled ) # Wrap checkbox self . wrap = Gtk . CheckButton . new_with_label ( 'Wrap' ) self . wrap . show ( ) self . wrap . set_sensitive ( True ) self . wrap . set_active ( True ) self . wrap . connect ( 'toggled' , self . wrap_toggled ) # Invert Search checkbox self . invert_search = Gtk . CheckButton . new_with_label ( 'Invert Search' ) self . invert_search . show ( ) self . search_is_inverted = self . config . base . get_item ( 'invert_search' ) self . invert_search . set_active ( self . search_is_inverted ) self . invert_search . connect ( 'toggled' , self . wrap_invert_search ) self . pack_start ( label , False , True , 0 ) self . pack_start ( self . entry , True , True , 0 ) self . pack_start ( self . prev , False , False , 0 ) self . pack_start ( self . next , False , False , 0 ) self . pack_start ( self . wrap , False , False , 0 ) self . pack_start ( self . match_case , False , False , 0 ) self . pack_start ( self . invert_search , False , False , 0 ) self . pack_end ( close , False , False , 0 ) self . hide ( ) self . set_no_show_all ( True )