Re: Windows defender is flagging LeoApp.exe as carrying a trojan

2018-03-09 Thread Edward K. Ream
On Fri, Mar 9, 2018 at 1:52 AM, Satish Goda  wrote:

> I just downloaded 5.7 final from Source Forge
>
> https://sourceforge.net/projects/leo/files/Leo/5.7-final/Leo_5.7_final_Win.zip/download
>  
> 
>
>
> After extracting and running LeoApp.exe, I see a warning from Window
> defender (I am using Windows 10 and I have virus scanning enables for
> ages). Did anybody else notice this?
>

​I haven't.​


>
> 5.7b2 runs fine and I downloaded it from Source forge last month.
>

​I wouldn't ignore this warning.  It may say something about your machine.

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 post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Themes

2018-03-09 Thread Edward K. Ream
On Thu, Mar 8, 2018 at 11:18 AM, Chris George  wrote:

> Where do I get to choose the boxes?
>

​There are two settings: For the Leo Dark setting they are:

@string tree-image-closed = nodes-dark/triangles/closed.png
@string tree-image-open = nodes-dark/triangles/open.png

I think these paths are relative to the leo/Icons folder.  *But let's not
guess*.

Searching for tree-image-closed finds ssm.set_indicator_paths & helper.
Here is the docstring:

'''
In the stylesheet, replace (if they exist)::

image: @tree-image-closed
image: @tree-image-open

by::

url(path/closed.png)
url(path/open.png)

path can be relative to ~ or to leo/Icons.

Assuming that ~/myIcons/closed.png exists, either of these will work::

@string tree-image-closed = nodes-dark/triangles/closed.png
@string tree-image-closed = myIcons/closed.png

Return the updated stylesheet.
'''
These two settings might also be involved:

@bool color_theme_is_dark = True
@string color_theme = leo_dark_0

Again, *let's not guess*.

*@bool color_theme_is_dark*: I found nothing for a regex search for
color.theme.is.dark.

I was about to disable it, but its body text contains:

Set to true for dark themes, so bookmarks.py can generate
random background colors which are appropriate etc.

*@string color_theme*: A cff on the regex color.theme yields 5 matches,
including qt_gui.getImageImage. The docstring is:

'''Load the image in file named `name` and return it.

If self.color_theme, set from @settings -> @string color_theme is set,

 - look first in $HOME/.leo/themes//Icons,
 - then in .../leo/themes//Icons,
 - then in .../leo/Icons,
 - as well as trying absolute path
 '''
It's helper also has the same docstring ;-)

*Summary*: The truth is out there if we look.

HTH.

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 post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Themes menu: status report

2018-03-09 Thread Edward K. Ream
Yesterday I prototyped the Themes menu.  With the latest code from the 
devel branch you can see the results with these two @button nodes:

@button open-light-theme
c.styleSheetManager.load_theme_file('EKRLight.leo')

@button open-dark-theme
c.styleSheetManager.load_theme_file('LeoBlackSolarized.leo')

You can switch back and forth between them as many times as you like. So it 
looks likes everything "just" works, but appearances are quite wrong.

The rest of this post is an ENB (Engineering Notebook) post.  Feel free to 
ignore, but it is pre-writing for new docs. It also discusses planned 
improvements in tooling for themes. See the summary.

*Status*

ssm.load_theme_files reads the theme file correctly using a null gui.  It 
then computes a *local* settings dict that contains the two stylesheets.  
It extracts the stylesheets and applies them. This *mostly* handles 
stylesheets correctly.  However, *settings that affect stylesheets are not 
updated correctly at present*.

*Which settings?*

The present code updates the (local) settings using the *entire* @settings 
tree in the theme file.  This is wrong. Some settings apply to the theme 
*file*, rather than the theme. These settings lie *outside* the @theme 
tree. Examples:

@bool minibuffer_find_mode = False # Ensures that the Find Tab is visible.
@bool show-tips = False # Suppresses tips when opening the file.

Loading a theme should not change these settings!  So the local settings 
should include only settings included in the @theme tree.

*Changing settings*

This is unexpectedly tricky.  After computing the local settings, we want 
to use *all and only* those settings when computing the stylesheets.  How 
to do this?  We don't want to pollute the code with this consideration.  
That is, we want the code to continue to use c.config.get* as before.

The simplest thing that could possibly work may be to use *temporary global 
settings*. Something like this:

c.config.save_settings() # Saves previous global settings.
c.config.init_setting(local_settings) # Make the local settings global.
<>
c.config.restore_settings() # Restores the previous global settings.

Finally, we *do* want to update the *old* global settings with the new *local 
*settings, so they have effect everywhere.  These settings affect syntax 
coloring, etc., not just the stylesheets themselves.

But we must update the global settings only *after* computing the style 
sheets, so that we are *sure* that the computed stylesheets depend *only* 
on settings in the @theme tree of the loaded theme and on *nothing* else. 
This detail is worth *any* amount of work because it helps us 
long-suffering theme devs.  Loading a theme file by itself should show devs 
*exactly 
the same thing* as loading the theme from the Theme menu.  The only way to 
ensure that is to be very careful about updating settings.

*Checking style sheets*

Qt whiffs when it comes to checking style sheets. I plan to add syntax 
checking logic for computed style sheets.  The code will warn about:

- Bad nesting of curly braces and comments.
- @constants within comments and unresolved @constants when all is 
completed.

These are all signs of trouble. It might be good to run these checks during 
every iteration of @constant expansion.

*Summary*

Updating settings is surprisingly tricky.  Doing so properly will show devs 
*exactly 
*what will happen when their themes are applied. These details are worth 
any amount of work.

The code that creates and expands style sheets will soon do sanity checks 
on the results. The @constant expansion algorithm will remain unchanged.

It may take a day or three to complete this work.  Such work will pay off 
handsomely.

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 post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Themes menu: status report

2018-03-09 Thread Edward K. Ream
On Friday, March 9, 2018 at 5:33:48 AM UTC-6, Edward K. Ream wrote:

*Changing settings*
>
> This is unexpectedly tricky.  After computing the local settings, we want 
> to use *all and only* those settings when computing the stylesheets.  How 
> to do this?  
>

Oh joy. It appears that we can just pass the local settings dict to  
expand_css_constants.  No need to mess with temporary global settings.

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 post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Permanent devel branch created

2018-03-09 Thread lewis
I am on branch (master), and I just wanted to confirm that the git command 
to pull the leo devel branch is

$ git checkout devel


Thanks
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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Permanent devel branch created

2018-03-09 Thread Edward K. Ream
On Fri, Mar 9, 2018 at 5:59 AM, lewis  wrote:

> I am on branch (master), and I just wanted to confirm that the git command
> to pull the leo devel branch is
>
> $ git checkout devel
>
​
Yes.  You can see the branch you are on with `git branch`

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 post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


0eaf01b: Leo reports unresolved @constant substitutions in style sheets

2018-03-09 Thread Edward K. Ream
ssm.expand_css_constants now *always* reports failed substitutions. How did 
we stylesheet devs ever live without this??

For example, the lists are completely different when simulating a load from 
the Themes menu, which tells me that the theme-related dictionary lookup is 
broken. 

This trace could be disabled, but imo we may as well leave this for now.

I did make a tiny change to the substitution logic itself.  It now excludes 
'@button', '@constants', '@data', '@language' from the list of symbols to 
be substituted.  These can appear in comments and I see no way excluding 
them could be a significant change.

The alternative would be to exclude them from the *reports* of failed 
substitutions, but I think the present code is good enough.

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 post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Permanent devel branch created

2018-03-09 Thread Terry Brown
On Fri, 9 Mar 2018 03:59:18 -0800 (PST)
lewis  wrote:

> I am on branch (master), and I just wanted to confirm that the git
> command to pull the leo devel branch is
> 
> $ git checkout devel

Probably obvious, but that just switches you to the devel branch.
Once switched you'll stay on it, and just use git pull as usual.

On the first checkout you'll be up to date with origin, the remote,
subsequent checkouts will take you to your local devel branch, still
requiring a git pull to catch up with origin.

Cheers -Terry

> Thanks
> 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+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: How to make Outlines which contains images and can display those images?

2018-03-09 Thread Pal Csanyi
2018. március 5., hétfő 10:34:02 UTC+1 időpontban Edward K. Ream a 
következőt írta:
>
> On Sun, Mar 4, 2018 at 4:16 AM, Pal Csanyi  > wrote:
>
> > I want to write in Leo editor Outline which will be contains images too 
> beside text.
> > Moreover, I want to can see those images.
>  
> ​​
> This is already possible, in a number of ways.
> ​
>
> - You can put images of various kinds in @html, @image and @svg nodes.​
> ​
>
> ​  You can put either references or actual sources in @html and @svg 
> nodes.​
>
>
> -
> ​ Leo's viewrendered pane (Alt-0) will show actual images.  Like this:
>
> @language md
>  alt="Splash">
> 
> whatever
> ​
>
>
> ​#762  says ​
> ​quickstart.leo & CheatSheet.leo should demo Leo's features​
> ​, including these.
>
> Edward
>
So I created an @image node with name '@image' and with body:
@language md


whatever
​
and saved it.
But after I hit Alt+0 I get this message:
@image: file not found: 

However I can run this command successfully on an xterm window:
display /home/pali/Kepek/FrekvenciaMero.png
and the image is displayed.

So what is wrong in my @image node so it does not work?

I am running Gentoo Linux system.

-- 
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 post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Themes

2018-03-09 Thread Chris George
A recent commit fixed the box problem. But I am still struggling with how 
to source images other than "open" and "close".

It looks great with the correct boxes.

Chris

On Friday, March 9, 2018 at 9:53:31 AM UTC-8, Chris George wrote:
>
>
>
>
>
>
> Where do I get to choose the boxes?
>>>
>>
>> ​There are two settings: For the Leo Dark theme they are:
>>
>> @string tree-image-closed = nodes-dark/triangles/closed.png
>> @string tree-image-open = nodes-dark/triangles/open.png
>>
>
>> I think these paths are relative to the leo/Icons folder.  *But let's 
>> not guess*.
>>
>> Searching for tree-image-closed finds ssm.set_indicator_paths & helper.  
>> Here is the docstring:
>>
>> '''
>> In the stylesheet, replace (if they exist)::
>>
>> image: @tree-image-closed
>> image: @tree-image-open
>>
>> by::
>>
>> url(path/closed.png)
>> url(path/open.png)
>>
>> path can be relative to ~ or to leo/Icons.
>>
>> Assuming that ~/myIcons/closed.png exists, either of these will work::
>>
>> @string tree-image-closed = nodes-dark/triangles/closed.png
>> @string tree-image-closed = myIcons/closed.png
>>
>> Return the updated stylesheet.
>> '''
>>
>
> I have verified that this works fine if the folder is in my home directory 
> (not a great place for theme images IMHO) or in leo/Icons (also not a great 
> place for theme images IMHO) Putting them in then in 
> *.../leo/themes//Icons 
> *doesn't work and this is the only place where theme images should live 
> IMHO. Having more than one place to look is extremely valuable for 
> settings. But it can lead to madness for people looking to create or modify 
> themes.
>
> I have attached two screenshots to clarify. abstract.png is an example of 
> correct behavior. nb. All theme images should be svg. Raster formats look 
> like crap when you resize them. 
>
> @string tree-image-closed = dark/branch_closed.svg
> @string tree-image-closed = dark/branch_open.svg
>
> These settings are read, inserted and applied. The triangle images are 
> correctly displayed. Here is the css that works with it.
>
>
>
> QTreeView::branch:closed:has-children{
>
> image: @tree-image-closed;
>
> }
>
> QTreeView::branch:open:has-children{
>
> image: @tree-image-open;
>
> }
>
>  The second image is direct.png. It shows the total loss of triangles in 
> the tree. Here is the css.
>
> TreeView::branch:closed:has-children{
>
> 
> image: url(:dark/branch_closed.svg);
>
> }
>
> QTreeView::branch:open:has-children{
>
> image: url(:dark/branch_open.svg);
>
> }
>
> The css passes the checks, the images simply do not display.
>
>
> Looking at the full stylesheet, the color_theme machinery returns the 
> following for the abstract.png css.
>
>
>
>
> QTreeView::branch:closed:has-children{
>
> image: url(/home/chris/leo-editor/leo/Icons/dark/branch_closed.svg);
>
> }
>
> QTreeView::branch:open:has-children{
>
> image: url(/home/chris/leo-editor/leo/Icons/dark/branch_open.svg);
>
> }
>
> The script replaces dark/branch_open.svg with the full path to the image. 
> It seems that direct coding of the stylesheet won't work for any other 
> images than the two; open and closed. I tried creating a new definition in 
> the same node as the @string statements, but it didn't work. Creating the 
> smae abstraction for every single new image we want to use in the 
> stylesheet would be tedious. 
>
>
> For ease of use (themers and users) is there a different mechanism we 
> could use for replacing the path to leo when appending to the provided path 
> relative to leo/themes/? For example: the default Qt styling 
> uses the format
>
> url(://);
>
>
> Note the leading "/". 
>
>
> If we could support this syntax, it would make modifying existing Qt 
> themes much, much simpler. 
>
>
>
> These two settings might also be involved:
>>
>> @bool color_theme_is_dark = True
>> @string color_theme = leo_dark_0
>>
>> Again, *let's not guess*.
>>
>> *@bool color_theme_is_dark*: I found nothing for a regex search for 
>> color.theme.is.dark.
>>
>> I was about to disable it, but its body text contains:
>>
>> Set to true for dark themes, so bookmarks.py can generate
>> random background colors which are appropriate etc.
>>
>>  
> As for the boxes, I still have white boxes in the tree. The directory 
> .../leo/themes/dark exists and contains the desired boxes. The undesirable 
> boxes *do not exist *on my local machine. I have disconnected my network. 
> I must assume that the white boxes I am seeing are Qt defaults that are 
> part of Qt and are appearing because the desired boxes cannot be found.
>
>@bool color_theme_is_dark = True
>@string color_theme = dark
>  
>
>> *@string color_theme*: A cff on the regex color.theme yields 5 matches, 
>> including qt_gui.getImageImage. The docstring is:
>>
>> '''Load the image in file named `name` and return it.
>>
>> If self.color_theme, set from @settings -> @string color_theme is se

Re: How to make Outlines which contains images and can display those images?

2018-03-09 Thread Edward K. Ream
On Fri, Mar 9, 2018 at 11:19 AM, Pal Csanyi  wrote:

So I created an @image node with name '@image' and with body:
> @language md
> ​​
> 
>

​The src attribute is url.  File urls look something like this:

​


HTH.

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 post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: How to make Outlines which contains images and can display those images?

2018-03-09 Thread lewis
It seems the @image in the node heading is causing the display failure

Lewis

On Saturday, March 10, 2018 at 4:19:48 AM UTC+11, Pal Csanyi wrote:
>
>
> So I created an @image node with name '@image' [snip]
>
So what is wrong in my @image node so it does not work?
>

-- 
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 post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: How to make Outlines which contains images and can display those images?

2018-03-09 Thread Csányi Pál
Indeed. As soon as I changed the node heading to 'FrekvenciaMero'
Alt+0 shows me the image.
Thank you very much!

2018-03-10 5:56 GMT+01:00 lewis :
> It seems the @image in the node heading is causing the display failure
>
> Lewis
>
> On Saturday, March 10, 2018 at 4:19:48 AM UTC+11, Pal Csanyi wrote:
>>
>>
>> So I created an @image node with name '@image' [snip]
>>
>> So what is wrong in my @image node so it does not work?
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "leo-editor" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/leo-editor/Gj75Zb0zeY8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> leo-editor+unsubscr...@googlegroups.com.
> To post to this group, send email to leo-editor@googlegroups.com.
> Visit this group at https://groups.google.com/group/leo-editor.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: How to make Outlines which contains images and can display those images?

2018-03-09 Thread Pal Csanyi
However the following does not work. Why not?
I create another node with headline 'Displaying an image'
with body text:


@language md
This is an image


The following does not work. Why not?

![Alt image](/home/pali/Kepek/FrekvenciaMero.png)



Actualy I am trying to use syntax from here:
https://daringfireball.net/projects/markdown/syntax#philosophy

Alt+0 shows this:
*This is an image *
The following does not work. Why not?
![Alt image](/home/pali/Kepek/FrekvenciaMero.png)


2018. március 10., szombat 6:00:42 UTC+1 időpontban Pal Csanyi a következőt 
írta:
>
> Indeed. As soon as I changed the node heading to 'FrekvenciaMero' 
> Alt+0 shows me the image. 
> Thank you very much! 
>
> 2018-03-10 5:56 GMT+01:00 lewis 
> > It seems the @image in the node heading is causing the display failure 
> > 
> > Lewis 
> > 
> > On Saturday, March 10, 2018 at 4:19:48 AM UTC+11, Pal Csanyi wrote: 
> >> 
> >> 
> >> So I created an @image node with name '@image' [snip] 
> >> 
> >> So what is wrong in my @image node so it does not work? 
>

-- 
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 post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.