I don't think that restarting Leo is always called for. A user might change the layout only for certain outlines. I do that all the time. If there has to be a restart process, then if the default layout is in the settings for a specific outline, then only that outline needs to be restarted.
On Sunday, July 28, 2024 at 11:32:19 AM UTC-4 Edward K. Ream wrote: > PR #4017 <https://github.com/leo-editor/leo-editor/pull/4017>has passed > an important milestone. It contains working *layout-creation methods *for > Leo's legacy and "big-tree" layouts. > > See the first comment of the PR for an overview of the changes. > > *Important: *the PR will *restart* Leo if the user executes the > reload-settings command after changing the *@string qt-layout-name* > setting. This scheme sidesteps the difficult (intractable?) problem of > undoing Qt layouts. > > Suppose that a Leonista wants to use multiple layouts in an outline. This > happens when *developing* layouts. It would be clumsy to change the > qt-layout-name setting. Happily, @button nodes can easily change layouts! > Here are two tested examples: > > *@button legacy* > > h = '@string qt-layout-name' > layout = 'legacy' > p = g.findNodeAnywhere(c, h, exact=False) > if p and p.h.endswith(f" {layout}"): > g.es_print('no change') > else: > p.h = f"{h} = {layout}" > c.save() > c.doCommandByName('restart-leo') > > *@button big-tree* > > h = '@string qt-layout-name' > layout = 'big-tree' > p = g.findNodeAnywhere(c, h, exact=False) > if p and p.h.endswith(f" {layout}"): > g.es_print('no change') > else: > p.h = f"{h} = {layout}" > c.save() > c.doCommandByName('restart-leo') > > The only difference between the two scripts is the name of the layout. > > Edward > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/a7de30d6-3ee8-468b-9753-3d9d66b73d94n%40googlegroups.com.