The docking code is complete, for now

114 views
Skip to first unread message

Edward K. Ream

unread,
May 29, 2019, 1:17:54 AM5/29/19
to leo-editor
See #1150. All bugs have been fixed or deferred. There is no need to set legacy_log_dock to True.

The deferred bug happens only if docks can be floated.  Allowing floatable docks is not a high priority for me.

The only remaining item is updating style sheets in Leo's official theme files. That will happen tomorrow.

Please test the code and report any problems.

Edward

Edward K. Ream

unread,
May 29, 2019, 7:26:12 AM5/29/19
to leo-editor
On Wednesday, May 29, 2019 at 12:17:54 AM UTC-5, Edward K. Ream wrote:

See #1150. All bugs have been fixed or deferred.

A new/old bug: Docks layouts are not correct when there are multiple open outlines.  I'll fix this next.

Edward

Edward K. Ream

unread,
May 29, 2019, 8:32:30 AM5/29/19
to leo-editor
On Wednesday, May 29, 2019 at 6:26:12 AM UTC-5, Edward K. Ream wrote:

> A new/old bug: Docks layouts are not correct when there are multiple open outlines.

Fixed at 99cc3c9b.  The new code is considerably more flexible than the pyzo way:

Leo only saves and restores dock state, not overall window geometry.  As before, Leo saves window geometry only when saving an outline.

Leo saves both per-outline and global dock state whenever you close an outline.

For each opened outline, Leo attempts to restore per-outline state, using the last-saved global state as a fallback.

Summary

You should find that everything "just works". Let me know if not. Use --trace=dock to see what is happening.

It shouldn't be necessary to clear ~/.leo/db, but do that if you have problems.

This concludes, (once again ;-) programming work on #1150. I'll close this issue after updating stylesheets.

Edward

Chris George

unread,
May 29, 2019, 9:17:47 AM5/29/19
to leo-e...@googlegroups.com
1. Delete cache.
2. Open single file in Leo.
3. Change tab arrangement; specifically I moved "Tab" to the left of "Outline" and then dropped "Find", "Spell" and "Body" into "Tab". Then I moved the splitter to have "Body" at about 75% and "Outline" at 25%.
4. Add some text to a node. Save the file.
5. Close Leo.

When I reopen Leo everything goes back to the default layout. None of the changes are saved.

This message appears in the terminal on exit.

saveWindowState myLife.leo



Chris

Edward K. Ream

unread,
May 29, 2019, 9:28:12 AM5/29/19
to leo-editor
On Wed, May 29, 2019 at 8:17 AM Chris George <techn...@gmail.com> wrote:
1. Delete cache.
2. Open single file in Leo.
3. Change tab arrangement; specifically I moved "Tab" to the left of "Outline" and then dropped "Find", "Spell" and "Body" into "Tab". Then I moved the splitter to have "Body" at about 75% and "Outline" at 25%.
4. Add some text to a node. Save the file.
5. Close Leo.

Works for me.  Please supply log info: platform, rev, etc.

Edward

Chris George

unread,
May 29, 2019, 9:33:34 AM5/29/19
to leo-editor

Leo 6.0-devel, dock branch, build 99cc3c9b57
2019-05-29 07:12:16 -0500
Python 3.6.7, PyQt version 5.12.0
linux

Edward K. Ream

unread,
May 29, 2019, 9:36:02 AM5/29/19
to leo-editor
On Wed, May 29, 2019 at 8:33 AM Chris George <techn...@gmail.com> wrote:

Leo 6.0-devel, dock branch, build 99cc3c9b57
2019-05-29 07:12:16 -0500
Python 3.6.7, PyQt version 5.12.0
linux

Thanks.  I'll have a look.  What does --trace=dock report?

Edward

Chris George

unread,
May 29, 2019, 9:36:07 AM5/29/19
to leo-editor
Same behaviour from a new rev.


Leo 6.0-devel, dock branch, build 47865da36c

2019-05-29 08:33:31 -0500

Python 3.6.7, PyQt version 5.12.0

linux


lewis

unread,
May 29, 2019, 9:55:09 AM5/29/19
to leo-editor
I like the flexibility of the docks, and enjoying the features however the layouts I prepare are not saved or used when reloading.
This happens if you have one or many files open.

I have run the clear-all-caches command and then arranged docks to my preference. After saving and restarting Leo I consistently get a layout in the form
[Outline ] [Tabs]
[ -        -] [Find]
[Body x x x x x ]

The body pane shows the Body heading only and you have to drag the splitter up to see any body text.

Leo Log Window
Leo 6.0-devel, dock branch (commit 99cc3c9b5)
Python 3.7.3, PyQt version 5.12.3
Windows 10 AMD64 (build 10.0.17134) SP0

Regards
Lewis

Edward K. Ream

unread,
May 29, 2019, 9:59:53 AM5/29/19
to leo-editor
On Wed, May 29, 2019 at 8:35 AM Edward K. Ream <edre...@gmail.com> wrote:

Leo 6.0-devel, dock branch, build 99cc3c9b57
2019-05-29 07:12:16 -0500
Python 3.6.7, PyQt version 5.12.0
linux

Thanks.  I'll have a look.

Works for me on linux, python 3.6.4, PyQt version 5.6.2, build ..fa6e63

Edward

Chris George

unread,
May 29, 2019, 10:00:16 AM5/29/19
to leo-editor
chris@technatica:~/leo-editor$ python3 ./launchLeo.py --trace=dock

setting leoID from os.getenv('USER'): 'chris'

Leo 6.0-devel, dock branch, build 47865da36c
2019-05-29 08:33:31 -0500
getImageFinder not found: /working/leo/leo-editor/leo/Icons/cleo/chkboxblk.png
qt.qpa.xcb: QXcbConnection: XCB error: 5 (BadAtom), sequence: 1153, resource id: 0, major code: 19 (DeleteProperty), minor code: 0
Autosave: Wed May 29 06:40:55 2019
wrote recent file: /home/chris/.leo/.leoRecentFiles.txt

Edward K. Ream

unread,
May 29, 2019, 10:01:26 AM5/29/19
to leo-editor


On Wed, May 29, 2019 at 8:55 AM lewis <lewi...@operamail.com> wrote:

> I have run the clear-all-caches command.

Not sure that will work.  Try deleting everything within the ~/.leo/db folder.

Edward

Edward K. Ream

unread,
May 29, 2019, 10:03:37 AM5/29/19
to leo-editor
On Wed, May 29, 2019 at 9:00 AM Chris George <techn...@gmail.com> wrote:
chris@technatica:~/leo-editor$ python3 ./launchLeo.py --trace=dock

setting leoID from os.getenv('USER'): 'chris'
Leo 6.0-devel, dock branch, build 47865da36c
2019-05-29 08:33:31 -0500
getImageFinder not found: /working/leo/leo-editor/leo/Icons/cleo/chkboxblk.png
qt.qpa.xcb: QXcbConnection: XCB error: 5 (BadAtom), sequence: 1153, resource id: 0, major code: 19 (DeleteProperty), minor code: 0
Autosave: Wed May 29 06:40:55 2019
wrote recent file: /home/chris/.leo/.leoRecentFiles.txt

The save/restore code is not being called.  Try --gui=qttabs.  If that works I'll know how to fix the bug.

Edward

Chris George

unread,
May 29, 2019, 10:07:39 AM5/29/19
to leo-editor
No. That didn't work.

Chris

lewis

unread,
May 29, 2019, 10:21:44 AM5/29/19
to leo-editor
I deleted everything from ~/leo/db but that didn't change anything.

Regards
Lewis

On Thursday, May 30,

Chris George

unread,
May 29, 2019, 11:02:41 AM5/29/19
to leo-e...@googlegroups.com
I checked out 140aa9fef2af3c8f767a79d90f825d3a823955c4.

I opened my test file.

It displayed the layout I had set for this file properly. Everything "just works".

So something you did between this rev and today's revs broke saving tab layout.

I reverted back to today's latest rev and the default tab layout happens.

So the info is in the file but current rev doesn't read it.

Chris


setting leoID from os.getenv('USER'): 'chris'
Leo 6.0-devel, None branch, build 140aa9fef2
2019-05-28 11:48:22 -0500
restoreWindowState missing key
: windowGeometry:/home/chris/Working/MegaSync/writing/Origins/Origins.db
qt
.qpa.xcb:

 
QXcbConnection: XCB error: 5 (BadAtom), sequence: 1153, resource id: 0,
 major code
: 19 (DeleteProperty), minor code: 0

wrote
/home/chris/.leo/leo.session
wrote recent file
: /home/chris/.leo/.leoRecentFiles.txt
saveWindowState windowGeometry
:/home/chris/Working/MegaSync/writing/Origins/Origins.db
saveWindowState windowState
:/home/chris/Working/MegaSync/writing/Origins/Origins.db


Edward K. Ream

unread,
May 29, 2019, 11:41:35 AM5/29/19
to leo-editor
On Wed, May 29, 2019 at 9:07 AM Chris George <techn...@gmail.com> wrote:
No. That didn't work.

OK.  I'll improve the tracing.

Edward

Edward K. Ream

unread,
May 29, 2019, 1:04:54 PM5/29/19
to leo-editor
On Wed, May 29, 2019 at 10:41 AM Edward K. Ream <edre...@gmail.com> wrote:

> OK.  I'll improve the tracing.

Done at 416b0f8c.  Please run with --trace=cache,dock and report the output.

Edward

Chris George

unread,
May 29, 2019, 1:14:43 PM5/29/19
to leo-editor
It still doesn't work. Here is the trace including the restart.

chris@technatica:~/leo-editor$ python3 ./launchLeo.py --trace=cache,dock

setting leoID
from os.getenv('USER'): 'chris'

===== Global Cache: Startup =====


File: /home/chris/Working/Websites/amazingsinging.ca/amazing.leo...

            body_outline_ratio
: 0.5
          body_secondary_ratio
: 0.5
              current_position
: 1,6,1
                      expanded
: chris.20180715060504.1,chris.20180715060504.15,chris.20180715060504.16
                        marked
:
               window_position
:
(
   
'0',
   
'0',
   
'1044',
   
'1920'
)

All others (Global Cache: Startup)...

     __cache_pickle_protocol__
: 2
                open
-leo-files:
[]
  viewrendered_default_layouts
:
(
   
None,
   
None
)
windowGeometry
:/home/chris/Working/MegaSync/writing/Origins/Origins.db: AdnQywADAAAAAAAAAAAAAAAAB38AAAPwAAAAAAAAAAAAAAd/AAAD8AAAAAAAAAAAB4AAAAAAAAAA
AAAAB38AAAPw

windowState
:
windowState
:/home/chris/Working/MegaSync/writing/Origins/Origins.db
windowState
:/home/chris/Working/Websites/amazingsinging.ca/amazing.leo
Leo 6.0-devel, dock branch, build 416b0f8cbe
2019-05-29 12:01:04 -0500

qt
.qpa.xcb: QXcbConnection: XCB error: 5 (BadAtom), sequence: 1153, resource id: 0, major code: 19 (DeleteProperty), minor code: 0

wrote recent file
: /home/chris/.leo/.leoRecentFiles.txt
wrote
/home/chris/.leo/leo.session
saveWindowState
Origins.db set key: windowState:
saveWindowState
Origins.db set key: windowState:/home/chris/Working/MegaSync/writing/Origins/Origins.db
saveWindowState amazing
.leo set key: windowState:
saveWindowState amazing
.leo set key: windowState:/home/chris/Working/Websites/amazingsinging.ca/amazing.leo

===== Global Cache: Shutdown =====


File: /home/chris/Working/Websites/amazingsinging.ca/amazing.leo...

            body_outline_ratio
: 0.5
          body_secondary_ratio
: 0.5
              current_position
: 1,6,1
                      expanded
: chris.20180715060504.1,chris.20180715060504.15,chris.20180715060504.16
                        marked
:
               window_position
:
(
   
'0',
   
'0',
   
'1044',
   
'1920'
)

All others (Global Cache: Shutdown)...

     __cache_pickle_protocol__
: 2
                open
-leo-files:
[]
  viewrendered_default_layouts
:
(
   
None,
   
None
)
windowGeometry
:/home/chris/Working/MegaSync/writing/Origins/Origins.db: AdnQywADAAAAAAAAAAAAAAAAB38AAAPwAAAAAAAAAAAAAAd/AAAD8AAAAAAAAAAAB4AAAAAAAAAA
AAAAB38AAAPw

windowState
:
windowState
:/home/chris/Working/MegaSync/writing/Origins/Origins.db
windowState
:/home/chris/Working/Websites/amazingsinging.ca/amazing.leo
chris@technatica
:~/leo-editor$ python3 ./launchLeo.py --trace=cache,dock

setting leoID
from os.getenv('USER'): 'chris'

===== Global Cache: Startup =====


File: /home/chris/Working/Websites/amazingsinging.ca/amazing.leo...

            body_outline_ratio
: 0.5
          body_secondary_ratio
: 0.5
              current_position
: 1,6,1
                      expanded
: chris.20180715060504.1,chris.20180715060504.15,chris.20180715060504.16
                        marked
:
               window_position
:
(
   
'0',
   
'0',
   
'1044',
   
'1920'
)

All others (Global Cache: Startup)...

     __cache_pickle_protocol__
: 2
                open
-leo-files:
[]
  viewrendered_default_layouts
:
(
   
None,
   
None
)
windowGeometry
:/home/chris/Working/MegaSync/writing/Origins/Origins.db: AdnQywADAAAAAAAAAAAAAAAAB38AAAPwAAAAAAAAAAAAAAd/AAAD8AAAAAAAAAAAB4AAAAAAAAAA
AAAAB38AAAPw

windowState
:
windowState
:/home/chris/Working/MegaSync/writing/Origins/Origins.db
windowState
:/home/chris/Working/Websites/amazingsinging.ca/amazing.leo
Leo 6.0-devel, dock branch, build 416b0f8cbe
2019-05-29 12:01:04 -0500

qt
.qpa.xcb: QXcbConnection: XCB error: 5 (BadAtom), sequence: 1153, resource id: 0, major code: 19 (DeleteProperty), minor code: 0


Chris
Message has been deleted

Edward K. Ream

unread,
May 29, 2019, 5:31:44 PM5/29/19
to leo-editor
On Wed, May 29, 2019 at 12:14 PM Chris George <techn...@gmail.com> wrote:
It still doesn't work. Here is the trace including the restart.

I see.  No files specified on the command line. Should be easy to fix.

Edward

Edward K. Ream

unread,
May 29, 2019, 5:43:52 PM5/29/19
to leo-editor
On Wednesday, May 29, 2019 at 4:31:44 PM UTC-5, Edward K. Ream wrote:

> I see.  No files specified on the command line. Should be easy to fix.

Try rev f6ac485.

Edward

Chris George

unread,
May 29, 2019, 6:17:36 PM5/29/19
to leo-editor
It now works correctly when only one file was open when I shut down. Opening another file or having two files open when shutting down doesn't. The second file loads the default tab layout.

I then cleared the cache and loaded a file from the command line. The tab layout that I set before restarting was loaded properly but opening a second file loads the default tab layout.

So loading one file from the previous session joins loading one file from the command line as cases where the expected behaviour happens. More files open in either case still needs work.

Chris

Edward K. Ream

unread,
May 30, 2019, 12:19:29 AM5/30/19
to leo-editor
On Wed, May 29, 2019 at 5:17 PM Chris George <techn...@gmail.com> wrote:
It now works correctly when only one file was open when I shut down. Opening another file or having two files open when shutting down doesn't. The second file loads the default tab layout.

Still with no files on the command-line, right?  Again, this should be easy to fix.

Edward

Edward K. Ream

unread,
May 30, 2019, 12:28:14 AM5/30/19
to leo-editor
On Wed, May 29, 2019 at 11:19 PM Edward K. Ream <edre...@gmail.com> wrote:

Still with no files on the command-line, right?  Again, this should be easy to fix.

d408da0 should do it.

Edward

Chris George

unread,
May 30, 2019, 8:30:57 AM5/30/19
to leo-editor
Success. Tested with three files.

Tab layout is retained on restart for all.

Chris

Edward K. Ream

unread,
May 30, 2019, 9:35:09 AM5/30/19
to leo-editor
On Thu, May 30, 2019 at 7:30 AM Chris George <techn...@gmail.com> wrote:
Success. Tested with three files.

Thanks for the confirmation, and all your help testing.

Edward

lewis

unread,
Jun 1, 2019, 4:07:12 AM6/1/19
to leo-e...@googlegroups.com
The persistence of the dock layout keeps getting better but I have this scenario where a file does not keep it's layout.

3 files opened with saved layouts, close Leo.
Restart Leo - the 3 files A,B,C, load with their individual dock layout.   
close 1 file C, close Leo.

Now restart Leo - the 2 files A,B open and retain their layout.
Open file C - it has not retained it's individual dock layout, but opens with default.

Leo 6.0-devel, dock branch dbba3a2

Python 3.7.3, PyQt version 5.12.3

Regards
Lewis

Edward K. Ream

unread,
Jun 1, 2019, 7:51:02 AM6/1/19
to leo-editor
On Sat, Jun 1, 2019 at 3:07 AM lewis <lewi...@operamail.com> wrote:
The persistence of the dock layout keeps getting better but I have this scenario where a file does not keep it's layout.

3 files opened with saved layouts, close Leo.
Restart Leo - the 3 files A,B,C, load with their individual dock layout.   
close 1 file C, close Leo.

Now restart Leo - the 2 files A,B open and retain their layout.
Open file C - it has not retained it's individual dock layout, but opens with default.

Please run Leo from a console and provide a full log with --trace=dock, including the command line args.

Thanks.

Edward

lewis

unread,
Jun 1, 2019, 8:30:01 AM6/1/19
to leo-editor
Here is the log

N:\git\leo-editor>launchleo.py --trace=dock

Empty setting name in False
set parent @settings
extractExecutableString rest rest
extractExecutableString rest python
extractExecutableString rest rest
extractExecutableString rest python
Leo 6.0-devel, dock branch
livecode.py: can not import meta
pip install meta
Started our command server
Loaded theme 'Dark'
Loaded theme 'Default'
Loaded theme 'Scintilla'
Loaded theme 'Solarized_Dark'
Loaded theme 'Solarized_Light'
pyzo_support.py is not a real plugin.
rss.py: can not import feedparser
livecode.py: can not import meta
pip install meta
pyzo_support.py is not a real plugin.
extractExecutableString rest rest
extractExecutableString rest python
extractExecutableString rest rest
extractExecutableString rest python
livecode.py: can not import meta
pip install meta
pyzo_support.py is not a real plugin.
extractExecutableString rest rest
extractExecutableString rest python
extractExecutableString rest rest
extractExecutableString rest python
registerCommand redefining @button-PooledenergyBILL AtButtonCallback DServe_Eff_Filters.leo gnx: lewis.20181008203251.1 len(script) 0 -> AtButtonCallback DServe_Eff_Filters.leo gnx: lewis.20181009230656.1 len(script) 0
livecode.py: can not import meta
pip install meta
pyzo_support.py is not a real plugin.
extractExecutableString rest rest
extractExecutableString rest python
extractExecutableString rest rest
extractExecutableString rest python
registerCommand redefining @button-timetest AtButtonCallback tabula_test.leo gnx: lewis.20180713111738.1 len(script) 560 -> AtButtonCallback tabula_test.leo gnx: lewis.20180713111503.1 len(script) 0
restoreWindowState workbook.leo found key: windowState:C:/Users/lewis/.leo/workbook.leo
restoreWindowState DServe_Eff_Filters.leo found key: windowState:C:/Users/lewis/OneDrive - Efficiency Filters Pty Ltd/DServe_Eff_Filters.leo
restoreWindowState tabula_test.leo found key: windowState:N:/leo/tabula_test.leo
wrote recent file: C:/Users/lewis/.leo/.leoRecentFiles.txt
saveWindowState tabula_test.leo set key: windowState:
saveWindowState tabula_test.leo set key: windowState:N:/leo/tabula_test.leo
wrote C:/Users/lewis/.leo/leo.session
saveWindowState workbook.leo set key: windowState:
saveWindowState workbook.leo set key: windowState:C:/Users/lewis/.leo/workbook.leo
saveWindowState DServe_Eff_Filters.leo set key: windowState:
saveWindowState DServe_Eff_Filters.leo set key: windowState:C:/Users/lewis/OneDrive - Efficiency Filters Pty Ltd/DServe_Eff_Filters.leo

N:\git\leo-editor>
N:\git\leo-editor>
N:\git\leo-editor>launchleo.py --trace=dock

Empty setting name in False
set parent @settings
extractExecutableString rest rest
extractExecutableString rest python
extractExecutableString rest rest
extractExecutableString rest python
Leo 6.0-devel, dock branch
livecode.py: can not import meta
pip install meta
Started our command server
Loaded theme 'Dark'
Loaded theme 'Default'
Loaded theme 'Scintilla'
Loaded theme 'Solarized_Dark'
Loaded theme 'Solarized_Light'
pyzo_support.py is not a real plugin.
rss.py: can not import feedparser
livecode.py: can not import meta
pip install meta
pyzo_support.py is not a real plugin.
extractExecutableString rest rest
extractExecutableString rest python
extractExecutableString rest rest
extractExecutableString rest python
livecode.py: can not import meta
pip install meta
pyzo_support.py is not a real plugin.
extractExecutableString rest rest
extractExecutableString rest python
extractExecutableString rest rest
extractExecutableString rest python
registerCommand redefining @button-PooledenergyBILL AtButtonCallback DServe_Eff_Filters.leo gnx: lewis.20181008203251.1 len(script) 0 -> AtButtonCallback DServe_Eff_Filters.leo gnx: lewis.20181009230656.1 len(script) 0
restoreWindowState workbook.leo found key: windowState:C:/Users/lewis/.leo/workbook.leo
restoreWindowState DServe_Eff_Filters.leo found key: windowState:C:/Users/lewis/OneDrive - Efficiency Filters Pty Ltd/DServe_Eff_Filters.leo
livecode.py: can not import meta
pip install meta
pyzo_support.py is not a real plugin.
extractExecutableString rest rest
extractExecutableString rest python
extractExecutableString rest rest
extractExecutableString rest python
registerCommand redefining @button-timetest AtButtonCallback tabula_test.leo gnx: lewis.20180713111738.1 len(script) 560 -> AtButtonCallback tabula_test.leo gnx: lewis.20180713111503.1 len(script) 0
wrote C:/Users/lewis/.leo/leo.session
wrote recent file: C:/Users/lewis/.leo/.leoRecentFiles.txt
saveWindowState workbook.leo set key: windowState:
saveWindowState workbook.leo set key: windowState:C:/Users/lewis/.leo/workbook.leo
saveWindowState DServe_Eff_Filters.leo set key: windowState:
saveWindowState DServe_Eff_Filters.leo set key: windowState:C:/Users/lewis/OneDrive - Efficiency Filters Pty Ltd/DServe_Eff_Filters.leo
saveWindowState tabula_test.leo set key: windowState:
saveWindowState tabula_test.leo set key: windowState:N:/leo/tabula_test.leo

N:\git\leo-editor>
[end]

Edward K. Ream

unread,
Jun 1, 2019, 7:06:56 PM6/1/19
to leo-editor
On Sat, Jun 1, 2019 at 3:07 AM lewis <lewi...@operamail.com> wrote:
The persistence of the dock layout keeps getting better but I have this scenario where a file does not keep it's layout.

I could replicate the problem.

Rev 3014232 may be the final fix in this area.

LM.loadLocalFile opens all files, so it, and only it, is the proper place to call g.app.restoreWindowState.  Let me know if problems remain.


3 files opened with saved layouts, close Leo.
Restart Leo - the 3 files A,B,C, load with their individual dock layout.   
close 1 file C, close Leo.

Now restart Leo - the 2 files A,B open and retain their layout.
Open file C - it has not retained it's individual dock layout, but opens with default.

Regards
Lewis

--
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+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/e89d11c3-cec9-4aeb-b063-a7d4ba489f01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
------------------------------------------------------------------------------------------
Edward K. Ream: edre...@gmail.com Leo: http://leoeditor.com/
------------------------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages