The simple-docks branch is ready for testing

56 views
Skip to first unread message

Edward K. Ream

unread,
Sep 8, 2020, 6:20:45 PM9/8/20
to leo-editor
This branch fixes #1654 and simplifies Leo's dock-handling code by eliminating g.app.save/restoreGlobalWindowState.

This promises to be an important step forward, but I think more testing is needed before merging "simple-docks" into devel.  Please report any problems.

Edward

Edward K. Ream

unread,
Sep 9, 2020, 5:26:15 PM9/9/20
to leo-editor
On Tuesday, September 8, 2020 at 5:20:45 PM UTC-5, Edward K. Ream wrote:

This branch fixes #1654 and simplifies Leo's dock-handling code by eliminating g.app.save/restoreGlobalWindowState.

The simple-docks branch has been merged into devel. Today's work is a big step forward. All the relevant code is in the LeoQtGui ctor. A comment explains that main_window.show() or main_window.showMinimized() must happen last, after creating the outline dock. This ensures that Leo restores saved layouts properly.

I have spent several days on this code. It was worth the effort. Two difficult methods have gone away.

I am fairly confident that the new code is sound. Please let me know if you have any difficulties.

Edward

Thomas Passin

unread,
Sep 9, 2020, 6:57:17 PM9/9/20
to leo-editor
Leo 6.3-devel, devel branch, build 65ecc3ff0d
2020-09-09 18:48:47 -0400
Python 3.8.2, PyQt version 5.15.0
Windows 10 AMD64 (build 10.0.18362) SP0

Open Leo with workbook.leo with --use-docks.  Observe the correct pane layout from previous run.  Create new outline using File/New.  Observe the new outline has a different layout than workbook.leo. Close Leo without saving new outline.  Open with --init-docks.  Observe that workbook has wrong layout.  Correct layout.  Open new outline.  Observe that the new outline has the default layout, not the layout of workbook.leo.

This version still doesn't behave as advertised.

Edward K. Ream

unread,
Sep 9, 2020, 7:26:29 PM9/9/20
to leo-editor
On Wed, Sep 9, 2020 at 5:57 PM Thomas Passin <tbp1...@gmail.com> wrote:
Leo 6.3-devel, devel branch, build 65ecc3ff0d
2020-09-09 18:48:47 -0400
Python 3.8.2, PyQt version 5.15.0
Windows 10 AMD64 (build 10.0.18362) SP0

Open Leo with workbook.leo with --use-docks.  Observe the correct pane layout from previous run.  Create new outline using File/New.  Observe the new outline has a different layout than workbook.leo. Close Leo without saving new outline. 

Leo uses an empty file name to represent the layout for new files.  I suggest you set your desired layout for new files by opening Leo with --init-docks, creating a new file, then quitting Leo. It shouldn't be necessary to save the new file.

Edward

Thomas Passin

unread,
Sep 9, 2020, 11:15:28 PM9/9/20
to leo-editor
This is not what happens for me.  I think you are being blinded by the fact that you know how to do things in a way that seems to work.

1. Open Leo with --init-docks.  Workbook opens in the default layout which is not what I want.  Create a new outline.  Change the layout to mine.  Close Leo without saving the new file.  Reopen with --use-docks. Leo opens with workbook in default layout.  New outline opens with my desired layout, but I'm stuck with the workbook being wrong.

2. Close Leo and reopen with --init-docks.  Now I can change the workbook outline, but Leo has forgotten what layout to apply to a new outline.  Rearrange panels so that both workbook and new outline have my layout.  Close Leo without saving new outline.  Open with --use-docks.  Now workbook opens with the intended outline and new outlines also open with it, but other existing outlines all open with the wrong, default layout. 

I am not going to go through this dance of closing all my current outlines, starting with --init-docks, creating a new outline, rearranging both outlines, closing Leo, and re-opening it again with --use-docks for each and every one of my existing outlines.  It's unworkable.  And it's fragile.  For example, Leo has once again forgotten to apply this new outline to new files in --use-docks.  It worked when I opened the first new outline, but when I closed that without saving so that only the workbook remained open, then created another new outline, it came up in the wrong, default layout again.

Any mistake in the sequence and you would have to start from the beginning again.  It's driving me nuts.  And it will drive away newcomers who will have a lot of trouble figuring it out and who have never seen any other program behave this way.  Pyzo doesn't behave like this.  I don't think that Pyzo has floating panels, but I'll give them up in a second if I can get some stable, understandable, reasonably intuitive behavior in exchange.

There must be a better way, but until then I'm sticking with the legacy layout.

Edward K. Ream

unread,
Sep 10, 2020, 9:03:59 AM9/10/20
to leo-editor
On Wed, Sep 9, 2020 at 10:15 PM Thomas Passin <tbp1...@gmail.com> wrote:

Any mistake in the sequence and you would have to start from the beginning again.

You should no longer have to clear the cache, and --init-docks does not do so.

You can set the layout of any file with --init-docks, and that should not affect any others.

Edward

Edward K. Ream

unread,
Sep 10, 2020, 10:03:51 AM9/10/20
to leo-editor

On Thursday, September 10, 2020 at 8:03:59 AM UTC-5, Edward K. Ream wrote:

You should no longer have to clear the cache, and --init-docks does not do so.

You can set the layout of any file with --init-docks, and that should not affect any others.

Thomas, would you be interested in a zoom get together? I'd like to see in more detail what you are doing.

Edward

Thomas Passin

unread,
Sep 10, 2020, 10:11:14 AM9/10/20
to leo-editor
Yes, that would be OK ... maybe later this afternoon?
Reply all
Reply to author
Forward
0 new messages