Reload outline proof of principle: filename = c.fileName()
if len(g.app.commanders()) == 1: c.doCommandByName('restart-leo') else: c.doCommandByName('close-window') g.openWithFileName(filename, old_c=c) If there is more than one outline open, the re-opened one opens to the right of the last tab. I think that's a minor matter, and there is probably a simple solution for it. Even LeoPyRef.leo takes no more than 3 seconds to reload on my system. I can easily live with that. g.openWithFileName()doesn't work if there is just one outline because Leo wants to close when the last outline is closed. In the process, the database connection is closed but it needs to be open to re-open the outline (other thing might be going south, too). Maybe there's a way to prevent Leo from trying to close if the last outline is going to be re-opened, hopefully without major surgery. Except for the length of time that Leo takes to open even a single short outline, this script works just fine. On Friday, August 30, 2024 at 11:00:01 AM UTC-4 Edward K. Ream wrote: > This Engineering Notebook post discusses issues relating to Leo's new > layouts. As of today, the "devel" branch contains these PRs: > > - PR #4055 <https://github.com/leo-editor/leo-editor/pull/4055>: Add > "@string qt-layout-name" setting. > - PR #4058 <https://github.com/leo-editor/leo-editor/pull/4058>: retire > the reload-outline command. > > These PRs ensure that Leo's new layouts will work as desired for almost > all Leonistas. > > *Changing layouts during execution* > > Almost nobody, myself included, needs (or wants) to change the layout of a > particular outline *while Leo is running*. Instead, Leonistas can: > > - Assign *default layouts for all outlines* in myLeoSettings.leo. > - Assign *per-outline layouts* by adding the setting in individual > outlines. > > Also, Leonistas can change outlines dynamically using the > use-*whatever*-layout > commands. In today's codebase, these commands execute the restart-leo > command. > > *Changing layouts without restarting Leo* > > Thomas wants to change layouts *without *restarting Leo. This isn't an > unreasonable request, but doing it is fraught. The original attempt > involved adding a 'reload-outline' command, but this command is too tricky > for me to fix. > > *Summary* > > Leo's codebase should satisfy almost all users' desires regarding layouts. > I would like to release Leo 6.8.2 on Thursday, September 5. > > I have zero interest in resurrecting the reload-outline command, but I'll > consider a PR that makes it work. This PR would be part of Leo 6.8.3. > > Your comments, please. > > 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/e4c7ce5a-a911-47d4-af42-965e643fedb8n%40googlegroups.com.