New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have Leo self register with operating system (create menu links, icons, etc) #1012
Comments
This comment has been minimized.
This comment has been minimized.
On Sun, Nov 4, 2018 at 11:48 AM matt wilkie ***@***.***> wrote:
There are some aging Leo scripts for setting file type associations etc.
for Leo on Windows -- register-leo.leox and un-register-leo.leox under
leo/scripts/
<https://github.com/leo-editor/leo-editor/tree/master/leo/scripts>. They
are designed to run from inside Leo with Ctrl-B or from command line leo
--script=....
It would be good to upgrade these to include creating start menu links,
deskop shortcuts with icons and so on.
I agree.
Edward
|
Relaunching doesn't work yet. I expect because this pattern is expecting to be run from the parent exe process, but in this case we're running from inside Leo. #1012 Leo build: 20190213233241
Part way there. I've adjusted
|
created branch `desktop-links` to keep maybe-not-working as well as possibly-dangerous scripts out of everyone else's way. Part of #1012. Leo build: 20190214234013
Created branch
Side notes:
|
With today's work culminating in commit 5f3c569 win-register-leo and win-unregister-leo scripts work again. After registration:
Example output when running as normal user:
And after starting as Administrator:
and
Caveats:
|
With bb0e6bb incomplete works in progress and scrap is removed. I've rediscovered the The (un)register scripts do work from the command line, but the command line needs to be crafted properly. I'll document that soon. I'm hoping to get a fully working "request elevation from inside Leo" recipe first. Register now works for both source code checkout and pip installed Leo. |
Register and Unregister now work a) from Leo GUI, b) from Leo command line, and c) from straight python :-) 👍 Python: Leo script: --Script path must be relative to Leo GUI:
* Current node location, subject to change: Expected results
Remaining to-do before complete: Request elevation prompt when running from Leo gui. Pushed in b5017f6 |
almost done #1012 Leo build: 20190227233831
part of #1012. We could just ship like this, it works, but it has too many files/nodes for my taste. There's got to be a better way of combining them. Maybe all into a module? Leo build: 20190305052933
So now both register and unregister work, and we no longer require the user to manually launch Leo or a CMD shell as administrator. Leo prompts for elevation at run time. What's not good: we're using cross-file clones between the scripts because of the shared request elevation and related code. Have to figure out how to combine these into a single script, or maybe even move into Leo itself(?) Part of #1012 Leo build: 20190314011223
With b380d72 there's no longer a need to manually launch Leo or a command shell as administrator. Yay! The prompt for elevation from just python on the command line does not work. I haven't dug into it because now that we can fire from inside Leo it's less necessary. There's room for refactoring: there are duplicate functions across the scripts in cross-file clones. |
I created sub-issues removed Milestone marker for this parent one. So the components can have different milestones. |
updated current status note. |
This is functionally complete for Windows and half there for Linux (lightly tested) so I'm going to close. I wish for a nicer looking way to describe and use the scripts but changing UI would be a much bigger project. |
Windows
Make python2 compatible (py2 compatible Windows file-type registration settings #1099)Linux: see #1246
Current Status - Windows
2019-10-09
Functionally complete (modulo a bug I just found).
2019-07-30
Integrated into Settings menu as "Open Desktop Integration Leo", which creates two buttons in the menu bar, which carry out the actions described below. There's no logic to distinguish between OS yet, so the menu shows on Linux and Mac also.
2019-02-27
Register and Unregister now work a) from Leo GUI, b) from Leo command line, and c) from straight python :-) 👍
Leo GUI:
scripts.leo
>> Find "Windows only scripts" node* >> select@file win-register-leo.leox
>> Execute script (Ctrl-B)* Current node location, subject to change:
.../leo-editor/leo/scripts/scripts.leo#Scripts-->@file leoScripts.txt-->Command-line scripts-->Windows-only scripts
Leo script:
Python:
The text was updated successfully, but these errors were encountered: