(self, layout_name)
Load a particular layout
Load a particular layout
Load a particular layout
def set_layout(self, layout_name):
        """Load a particular layout"""
        self.layout_name = layout_name
        store = self.treestore
        layout = self.config.layout_get_config(layout_name)
        listitems = {}
        store.clear()

        children = list(layout.keys())
        i = 0
        while children != []:
            child = children.pop()
            child_type = layout[child]['type']
            parent = layout[child]['parent']

            if child_type != 'Window' and parent not in layout:
                # We have an orphan!
                err('%s is an orphan in this layout. Discarding' % child)
                continue
            try:
                parentiter = listitems[parent]
            except KeyError:
                if child_type == 'Window':
                    parentiter = None
                else:
                    # We're not ready for this widget yet
                    children.insert(0, child)
                    continue

            if child_type == 'VPaned':
                child_type = 'Vertical split'
            elif child_type == 'HPaned':
                child_type = 'Horizontal split'

            listitems[child] = store.append(parentiter, [child, child_type])

        treeview = self.builder.get_object('LayoutTreeView')
        treeview.expand_all()
def set_layout ( self , layout_name ) : self . layout_name = layout_name store = self . treestore layout = self . config . layout_get_config ( layout_name ) listitems = { } store . clear ( ) children = list ( layout . keys ( ) ) i = 0 while children != [ ] : child = children . pop ( ) child_type = layout [ child ] [ 'type' ] parent = layout [ child ] [ 'parent' ] if child_type != 'Window' and parent not in layout : # We have an orphan! err ( '%s is an orphan in this layout. Discarding' % child ) continue try : parentiter = listitems [ parent ] except KeyError : if child_type == 'Window' : parentiter = None else : # We're not ready for this widget yet children . insert ( 0 , child ) continue if child_type == 'VPaned' : child_type = 'Vertical split' elif child_type == 'HPaned' : child_type = 'Horizontal split' listitems [ child ] = store . append ( parentiter , [ child , child_type ] ) treeview = self . builder . get_object ( 'LayoutTreeView' ) treeview . expand_all ( )