(self)
Update the preferences window with all the configuration from
        Config()
Update the preferences window with all the configuration from
        Config()
Update the preferences window with all the configuration from Config ()
def set_values(self):
        """Update the preferences window with all the configuration from
        Config()"""
        guiget = self.builder.get_object

        ## Global tab
        # Mouse focus
        focus = self.config['focus']
        active = 0
        if focus == 'click':
            active = 1
        elif focus in ['sloppy', 'mouse']:
            active = 2
        widget = guiget('focuscombo')
        widget.set_active(active)
        # Terminal separator size
        termsepsize = self.config['handle_size']
        widget = guiget('handlesize')
        widget.set_value(float(termsepsize))
        widget = guiget('handlesize_value_label')
        widget.set_text(str(termsepsize))

        # Cell Height
        cellheightsize = self.config['cell_height']
        cellheightsize = round(float(cellheightsize),1)
        widget = guiget('cellheight')
        widget.set_value(cellheightsize)
        widget = guiget('cellheight_value_label')
        widget.set_text(str(cellheightsize))

        # Cell Width
        cellwidthsize = self.config['cell_width']
        cellwidthsize = round(float(cellwidthsize),1)
        widget = guiget('cellwidth')
        widget.set_value(cellwidthsize)
        widget = guiget('cellwidth_value_label')
        widget.set_text(str(cellwidthsize))

        # Window geometry hints
        geomhint = self.config['geometry_hinting']
        widget = guiget('wingeomcheck')
        widget.set_active(geomhint)
        # Window state
        option = self.config['window_state']
        if option == 'hidden':
            active = 1
        elif option == 'maximise':
            active = 2
        elif option == 'fullscreen':
            active = 3
        else:
            active = 0
        widget = guiget('winstatecombo')
        widget.set_active(active)
        # Window borders
        widget = guiget('winbordercheck')
        widget.set_active(not self.config['borderless'])
        # Extra styling
        widget = guiget('extrastylingcheck')
        widget.set_active(self.config['extra_styling'])
        # Tab bar position
        option = self.config['tab_position']
        widget = guiget('tabposcombo')
        if option == 'bottom':
            active = 1
        elif option == 'left':
            active = 2
        elif option == 'right':
            active = 3
        elif option == 'hidden':
            active = 4
        else:
            active = 0
        widget.set_active(active)
        # Broadcast default
        option = self.config['broadcast_default']
        widget = guiget('broadcastdefault')
        if option == 'all':
            active = 0
        elif option == 'off':
            active = 2
        else:
            active = 1
        widget.set_active(active)
        # Disable Ctrl+mousewheel zoom
        widget = guiget('disablemousewheelzoom')
        widget.set_active(self.config['disable_mousewheel_zoom'])
        # scroll_tabbar
        widget = guiget('scrolltabbarcheck')
        widget.set_active(self.config['scroll_tabbar'])
        # homogeneous_tabbar
        widget = guiget('homogeneouscheck')
        widget.set_active(self.config['homogeneous_tabbar'])
        # DBus Server
        widget = guiget('dbuscheck')
        widget.set_active(self.config['dbus'])
        #Hide from taskbar
        widget = guiget('hidefromtaskbcheck')
        widget.set_active(self.config['hide_from_taskbar'])
        #Always on top
        widget = guiget('alwaysontopcheck')
        widget.set_active(self.config['always_on_top'])
        #Hide on lose focus
        widget = guiget('hideonlosefocuscheck')
        widget.set_active(self.config['hide_on_lose_focus'])
        #Show on all workspaces
        widget = guiget('stickycheck')
        widget.set_active(self.config['sticky'])

        # title bar at bottom
        widget = guiget('title_at_bottom_checkbutton')
        widget.set_active(self.config['title_at_bottom'])
        
        #Always split with profile
        widget = guiget('always_split_with_profile')
        widget.set_active(self.config['always_split_with_profile'])
        # Putty paste style
        widget = guiget('putty_paste_style')
        widget.set_active(self.config['putty_paste_style'])
        # Putty paste style source clipboard
        if self.config['putty_paste_style_source_clipboard']:
            widget = guiget('putty_paste_style_source_clipboard_radiobutton')
        else:
            widget = guiget('putty_paste_style_source_primary_radiobutton')
        widget.set_active(True)
        # Smart copy
        widget = guiget('smart_copy')
        widget.set_active(self.config['smart_copy'])
        # Clear selection on copy
        widget = guiget('clear_select_on_copy')
        widget.set_active(self.config['clear_select_on_copy'])
        # Disable mouse paste
        widget = guiget('disable_mouse_paste')
        widget.set_active(self.config['disable_mouse_paste'])

        ## Profile tab
        # Populate the profile list
        widget = guiget('profilelist')
        liststore = widget.get_model()
        profiles = self.config.list_profiles()
        if '__internal_json_profile__' in profiles:
            profiles.remove('__internal_json_profile__')
        self.profileiters = {}
        for profile in profiles:
            if profile == 'default':
                editable = False
            else:
                editable = True
            self.profileiters[profile] = liststore.append([profile, editable])
        selection = widget.get_selection()
        selection.connect('changed', self.on_profile_selection_changed)
        selection.select_iter(self.profileiters['default'])

        ## Layouts tab
        widget = guiget('layoutlist')
        liststore = widget.get_model()
        layouts = self.config.list_layouts()
        if '__internal_json_layout__' in layouts:
            layouts.remove('__internal_json_layout__')
        self.layoutiters = {}
        for layout in layouts:
            if layout == 'default':
                editable = False
            else:
                editable = True
            self.layoutiters[layout] = liststore.append([layout, editable])
        selection = widget.get_selection()
        selection.connect('changed', self.on_layout_selection_changed)
        terminator = Terminator()
        if terminator.layoutname and terminator.layoutname != '__internal_json_layout__':
            layout_to_highlight = terminator.layoutname
        else:
            layout_to_highlight = 'default'
        selection.select_iter(self.layoutiters[layout_to_highlight])
        # Now set up the selection changed handler for the layout itself
        widget = guiget('LayoutTreeView')
        selection = widget.get_selection()
        selection.connect('changed', self.on_layout_item_selection_changed)

        ## Keybindings tab
        widget = guiget('keybindingtreeview')
        liststore = widget.get_model()
        liststore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
        keybindings = self.config['keybindings']
        for keybinding in keybindings:
            keyval = 0
            mask = 0
            value = keybindings[keybinding]
            if value is not None and value != '':
                try:
                    (keyval, mask) = self.keybindings._parsebinding(value)
                except KeymapError:
                    pass
            liststore.append([keybinding, self.keybindingnames[keybinding],
                             keyval, mask])

        ## Plugins tab
        # Populate the plugin list
        widget = guiget('pluginlist')
        liststore = widget.get_model()
        self.registry = PluginRegistry()
        self.pluginiters = {}
        pluginlist = self.registry.get_available_plugins()
        self.plugins = {}
        for plugin in pluginlist:
            if plugin[0] != "_": # Do not display hidden plugins
                self.plugins[plugin] = self.registry.is_enabled(plugin)

        for plugin in self.plugins:
            self.pluginiters[plugin] = liststore.append([plugin,
                                             self.plugins[plugin]])
        selection = widget.get_selection()
        selection.connect('changed', self.on_plugin_selection_changed)
        if len(self.pluginiters) > 0:
            selection.select_iter(liststore.get_iter_first())
def set_values ( self ) : guiget = self . builder . get_object ## Global tab # Mouse focus focus = self . config [ 'focus' ] active = 0 if focus == 'click' : active = 1 elif focus in [ 'sloppy' , 'mouse' ] : active = 2 widget = guiget ( 'focuscombo' ) widget . set_active ( active ) # Terminal separator size termsepsize = self . config [ 'handle_size' ] widget = guiget ( 'handlesize' ) widget . set_value ( float ( termsepsize ) ) widget = guiget ( 'handlesize_value_label' ) widget . set_text ( str ( termsepsize ) ) # Cell Height cellheightsize = self . config [ 'cell_height' ] cellheightsize = round ( float ( cellheightsize ) , 1 ) widget = guiget ( 'cellheight' ) widget . set_value ( cellheightsize ) widget = guiget ( 'cellheight_value_label' ) widget . set_text ( str ( cellheightsize ) ) # Cell Width cellwidthsize = self . config [ 'cell_width' ] cellwidthsize = round ( float ( cellwidthsize ) , 1 ) widget = guiget ( 'cellwidth' ) widget . set_value ( cellwidthsize ) widget = guiget ( 'cellwidth_value_label' ) widget . set_text ( str ( cellwidthsize ) ) # Window geometry hints geomhint = self . config [ 'geometry_hinting' ] widget = guiget ( 'wingeomcheck' ) widget . set_active ( geomhint ) # Window state option = self . config [ 'window_state' ] if option == 'hidden' : active = 1 elif option == 'maximise' : active = 2 elif option == 'fullscreen' : active = 3 else : active = 0 widget = guiget ( 'winstatecombo' ) widget . set_active ( active ) # Window borders widget = guiget ( 'winbordercheck' ) widget . set_active ( not self . config [ 'borderless' ] ) # Extra styling widget = guiget ( 'extrastylingcheck' ) widget . set_active ( self . config [ 'extra_styling' ] ) # Tab bar position option = self . config [ 'tab_position' ] widget = guiget ( 'tabposcombo' ) if option == 'bottom' : active = 1 elif option == 'left' : active = 2 elif option == 'right' : active = 3 elif option == 'hidden' : active = 4 else : active = 0 widget . set_active ( active ) # Broadcast default option = self . config [ 'broadcast_default' ] widget = guiget ( 'broadcastdefault' ) if option == 'all' : active = 0 elif option == 'off' : active = 2 else : active = 1 widget . set_active ( active ) # Disable Ctrl+mousewheel zoom widget = guiget ( 'disablemousewheelzoom' ) widget . set_active ( self . config [ 'disable_mousewheel_zoom' ] ) # scroll_tabbar widget = guiget ( 'scrolltabbarcheck' ) widget . set_active ( self . config [ 'scroll_tabbar' ] ) # homogeneous_tabbar widget = guiget ( 'homogeneouscheck' ) widget . set_active ( self . config [ 'homogeneous_tabbar' ] ) # DBus Server widget = guiget ( 'dbuscheck' ) widget . set_active ( self . config [ 'dbus' ] ) #Hide from taskbar widget = guiget ( 'hidefromtaskbcheck' ) widget . set_active ( self . config [ 'hide_from_taskbar' ] ) #Always on top widget = guiget ( 'alwaysontopcheck' ) widget . set_active ( self . config [ 'always_on_top' ] ) #Hide on lose focus widget = guiget ( 'hideonlosefocuscheck' ) widget . set_active ( self . config [ 'hide_on_lose_focus' ] ) #Show on all workspaces widget = guiget ( 'stickycheck' ) widget . set_active ( self . config [ 'sticky' ] ) # title bar at bottom widget = guiget ( 'title_at_bottom_checkbutton' ) widget . set_active ( self . config [ 'title_at_bottom' ] ) #Always split with profile widget = guiget ( 'always_split_with_profile' ) widget . set_active ( self . config [ 'always_split_with_profile' ] ) # Putty paste style widget = guiget ( 'putty_paste_style' ) widget . set_active ( self . config [ 'putty_paste_style' ] ) # Putty paste style source clipboard if self . config [ 'putty_paste_style_source_clipboard' ] : widget = guiget ( 'putty_paste_style_source_clipboard_radiobutton' ) else : widget = guiget ( 'putty_paste_style_source_primary_radiobutton' ) widget . set_active ( True ) # Smart copy widget = guiget ( 'smart_copy' ) widget . set_active ( self . config [ 'smart_copy' ] ) # Clear selection on copy widget = guiget ( 'clear_select_on_copy' ) widget . set_active ( self . config [ 'clear_select_on_copy' ] ) # Disable mouse paste widget = guiget ( 'disable_mouse_paste' ) widget . set_active ( self . config [ 'disable_mouse_paste' ] ) ## Profile tab # Populate the profile list widget = guiget ( 'profilelist' ) liststore = widget . get_model ( ) profiles = self . config . list_profiles ( ) if '__internal_json_profile__' in profiles : profiles . remove ( '__internal_json_profile__' ) self . profileiters = { } for profile in profiles : if profile == 'default' : editable = False else : editable = True self . profileiters [ profile ] = liststore . append ( [ profile , editable ] ) selection = widget . get_selection ( ) selection . connect ( 'changed' , self . on_profile_selection_changed ) selection . select_iter ( self . profileiters [ 'default' ] ) ## Layouts tab widget = guiget ( 'layoutlist' ) liststore = widget . get_model ( ) layouts = self . config . list_layouts ( ) if '__internal_json_layout__' in layouts : layouts . remove ( '__internal_json_layout__' ) self . layoutiters = { } for layout in layouts : if layout == 'default' : editable = False else : editable = True self . layoutiters [ layout ] = liststore . append ( [ layout , editable ] ) selection = widget . get_selection ( ) selection . connect ( 'changed' , self . on_layout_selection_changed ) terminator = Terminator ( ) if terminator . layoutname and terminator . layoutname != '__internal_json_layout__' : layout_to_highlight = terminator . layoutname else : layout_to_highlight = 'default' selection . select_iter ( self . layoutiters [ layout_to_highlight ] ) # Now set up the selection changed handler for the layout itself widget = guiget ( 'LayoutTreeView' ) selection = widget . get_selection ( ) selection . connect ( 'changed' , self . on_layout_item_selection_changed ) ## Keybindings tab widget = guiget ( 'keybindingtreeview' ) liststore = widget . get_model ( ) liststore . set_sort_column_id ( 0 , Gtk . SortType . ASCENDING ) keybindings = self . config [ 'keybindings' ] for keybinding in keybindings : keyval = 0 mask = 0 value = keybindings [ keybinding ] if value is not None and value != '' : try : ( keyval , mask ) = self . keybindings . _parsebinding ( value ) except KeymapError : pass liststore . append ( [ keybinding , self . keybindingnames [ keybinding ] , keyval , mask ] ) ## Plugins tab # Populate the plugin list widget = guiget ( 'pluginlist' ) liststore = widget . get_model ( ) self . registry = PluginRegistry ( ) self . pluginiters = { } pluginlist = self . registry . get_available_plugins ( ) self . plugins = { } for plugin in pluginlist : if plugin [ 0 ] != "_" : # Do not display hidden plugins self . plugins [ plugin ] = self . registry . is_enabled ( plugin ) for plugin in self . plugins : self . pluginiters [ plugin ] = liststore . append ( [ plugin , self . plugins [ plugin ] ] ) selection = widget . get_selection ( ) selection . connect ( 'changed' , self . on_plugin_selection_changed ) if len ( self . pluginiters ) > 0 : selection . select_iter ( liststore . get_iter_first ( ) )