Skip to content
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

created nodes not opening #800

Closed
kaarlsberg opened this issue May 11, 2020 · 29 comments
Closed

created nodes not opening #800

kaarlsberg opened this issue May 11, 2020 · 29 comments
Labels

Comments

@kaarlsberg
Copy link

kaarlsberg commented May 11, 2020

so i was formatting a document, on cherry tree, suddenly it sort of hanged, and i am freezed on the note i was currently in.

There was number of subnodes and nodes in the document, with plenty of text in it, but clicking on them does nothing.

Help!!, dont wanna loose my document

Screenshot from 2020-05-11 16-50-31

in the above screen shot, i am clicking on the node which is highlighted, but the text in it, does show up, i am freezed up in node just above that.

Edit: i can still edit the current node i am in, and can toggle subnodes of all nodes i created, just can't see or edit what is written in them

@txe
Copy link
Contributor

txe commented May 11, 2020

What cherrytree version and OS do you use?
Can you start cherrytree in the console and see if it will show any errors there?
Edit: as I understand, you're afraid to lose data if you close the app. Then, you can try to use option save as to resave data.

@datavectors
Copy link

Another tip I have used when a CT file is corrupted.
First install XMLCopyEditor
Save CT file as XML (*.ctd)
Try to validate CT file in XMLCopyEditor (or another XML editor if you have one).

@kaarlsberg
Copy link
Author

Hello @txe i did as you mentioned and saved a different copy of it using save as, then went ahead and reinstalled cherry tree again,it works now. thanks.
There was no problem with the file, i guess something went with the application itself.

@datavectors thankyou for your help

@txe
Copy link
Contributor

txe commented May 11, 2020

Good!

@txe txe closed this as completed May 11, 2020
@kaarlsberg
Copy link
Author

@txe Hii, i would request to open this issue again.
I am having same problem again.

I am using Ubuntu Linux 20.04, cherry tree version is 0.39.3
Last time as you asked, i tried opening cherry tree from terminal , the program opens with the same issue, but here is the error i get

$ cherrytree
ln: failed to create symbolic link '/home/anurag/snap/cherrytree/14/.config/gtk-2.0/gtkfilechooser.ini': File exists
Gtk-Message: 22:09:39.440: Failed to load module "gail"
Gtk-Message: 22:09:39.440: Failed to load module "atk-bridge"
Gtk-Message: 22:09:39.453: Failed to load module "canberra-gtk-module"
sel node id=89, seq=1
Traceback (most recent call last):
  File "/snap/cherrytree/14/share/cherrytree/modules/core.py", line 3150, in on_node_changed
    if self.enable_spell_check: self.spell_check_set_on()
  File "/snap/cherrytree/14/share/cherrytree/modules/core.py", line 4823, in spell_check_set_on
    self.spellchecker = pgsc_spellcheck.SpellChecker(self.sourceview, self, self.syntax_highlighting == cons.RICH_TEXT_ID, self.spell_check_lang)
  File "/snap/cherrytree/14/share/cherrytree/modules/pgsc_spellcheck.py", line 167, in __init__
    raise NoDictionariesFound()
pgsc_spellcheck.NoDictionariesFound

Help Please

@txe
Copy link
Contributor

txe commented May 13, 2020

Ok, I see why it happens and I will investigate it further later.
As for now, you can just turn off spellchecker in Preferences dialog, Rich Text tab.

@txe txe reopened this May 13, 2020
@kaarlsberg
Copy link
Author

Well the thing is, all the tabs in the preferences dialog can be browsed, except the Rich text tab.
Clicking on it, just gives a blank.

@txe
Copy link
Contributor

txe commented May 13, 2020

Ok, then try to install a spellcheck dictionary for hunspell, e.g. hunspell-en_US or hunspell-en-us

@txe
Copy link
Contributor

txe commented May 13, 2020

Or instead of deleting config.cfg, change a line there
enable_spell_check = True to enable_spell_check = False

@kaarlsberg
Copy link
Author

kaarlsberg commented May 13, 2020

sorry, i dont want to be annoying and bother you, more than it needs to be, but
hunspell-en-US latest version is already installed on the system.

Also checked config.cfg enable_spell_check = False is already set.

i guess i will go ahead and reinstall cherrytree again

@giuspen
Copy link
Owner

giuspen commented May 13, 2020

If you are having so many issues with the snap package you may want to try the flatpak instead https://flathub.org/apps/details/com.giuspen.cherrytree

@txe
Copy link
Contributor

txe commented May 13, 2020

@kaarlsberg, you are not bothering me, I just tried to give a fast workaround.
I'll give a proper fix tomorrow after installing ubuntu 20.

@kaarlsberg
Copy link
Author

@txe ahh, thanks

@txe txe added the snap label May 13, 2020
@txe
Copy link
Contributor

txe commented May 13, 2020

Hi @hellsworth, is it possible to put hunspell-en-us package (spellcheck dictionary) into the snap or remove pygtkspellcheck from the snap? Reasons:

  • cherrytree (currently, it can be fixed) works badly without spellcheck dictionaries
  • cherrytree snap doesn't see system spellcheck dictionaries
  • if there is not pygtkspellcheck, cherrytree will be OK without dictionaries

@txe
Copy link
Contributor

txe commented May 13, 2020

I'm not sure about the package name, it can be pyenchant or something like that

@hellsworth
Copy link
Contributor

hellsworth commented May 13, 2020

@txe Sure that seems fine. However, when I removed python-enchant and added hunspell-en-us, the Preferences -> Rich Text -> Enable Spell Check box was greyed out. Just in case maybe it was auto turned on in the background or something, I misspelled a word and there was no indication. Thoughts?

At least with python-enchant, I could click the "Enable Spell Check" box (although a misspelled word was still not highlighted in any way).

@txe
Copy link
Contributor

txe commented May 13, 2020

It was either put in or remove from )). So, to have spellchecking, you need both python-enchant and a dictionary.
About not highlighted, did you select a language in a combobox next to 'Enable Spell Check' box?

@hellsworth
Copy link
Contributor

Ok I've built with both python-enchant and hunspell-en-us and the 'Enable Spell Check' box is available but the 'Spell Check Language' box is still greyed out so I can't select a language. Thoughts?

with-enchant-hunspell

@giuspen
Copy link
Owner

giuspen commented May 14, 2020

The enable spell check is available if the python-enchant binding is found while the drop down is populated by python-enchant itself according to the dictionaries it finds installed. I'll check if I find something more about the dictionaries expected location

@giuspen
Copy link
Owner

giuspen commented May 14, 2020

Looking at my notes for the windows standalone archive https://github.com/giuspen/cherrytree/blob/master/windows/README.txt :
sudo apt-get install hunspell-de-de hunspell-fr hunspell-ru
sudo apt-get install myspell-cs myspell-es myspell-hy myspell-it myspell-lt myspell-nl myspell-pl myspell-pt-br myspell-uk
cd /usr/share/hunspell
ls
Maybe there's a way to configure enchant to look in other directories as well.

@hellsworth
Copy link
Contributor

Interesting. Well, we have the installed dictionaries in $SNAP/usr/share/hunspell within the snap so really it's a question of pointing to a non-standard location.

heather@fairy:/snap/cherrytree/x1$ ls -l usr/share/hunspell/
total 537
-rw-r--r-- 1 root root   3090 Oct 20  2017 en_US.aff
-rw-r--r-- 1 root root 546103 Oct 20  2017 en_US.dic

I went ahead and filed a query with the pyenchant devs since it's not obvious how to point python-enchant to a non-standard location.

@giuspen
Copy link
Owner

giuspen commented May 14, 2020

I found this:
https://www.systutorials.com/docs/linux/man/1-enchant/
Enchant looks for Myspell dictionaries in $(datadir)/enchant/myspell and ~/.enchant/myspell. Enchant looks for Ispell dictionaries in $(datadir)/enchant/ispell and ~/.enchant/ispell. Enchant looks for Uspell dictionaries in $(datadir)/enchant/uspell and ~/.enchant/uspell.

@giuspen
Copy link
Owner

giuspen commented May 14, 2020

@hellsworth today I was using the snap of cherrytree and while I had xterm installed, cherrytree was unable to invoke it via a system call complaining it couldn't find it on its path. Would it be possible from the snap to look for binaries outside or if not that you include xterm in the snap?

@txe
Copy link
Contributor

txe commented May 14, 2020

@hellsworth
About aspell, other snaps have the same issue with spell checking and for example how they deal with it:
https://github.com/vslavik/poedit/blob/master/snap/snapcraft.yaml

@hellsworth
Copy link
Contributor

@hellsworth today I was using the snap of cherrytree and while I had xterm installed, cherrytree was unable to invoke it via a system call complaining it couldn't find it on its path. Would it be possible from the snap to look for binaries outside or if not that you include xterm in the snap?

Oh yeah snaps can only see what's in their confined space.. I can include xterm in the staged-packages (runtime deps).

@hellsworth
Copy link
Contributor

@hellsworth
About aspell, other snaps have the same issue with spell checking and for example how they deal with it:
https://github.com/vslavik/poedit/blob/master/snap/snapcraft.yaml

Oh nice find @txe ! I'll give something like this a shot tomorrow

@hlascelles
Copy link

Thanks for looking at this - I am seeing the same with all of the above.

Could I just ask though - where is the config.cfg when installed as a Snap? I couldn't "unset" spellcheck or find the config file. A simple reinstall solved it, but it will be nice to know in the future. Thanks!

@txe
Copy link
Contributor

txe commented May 21, 2020

Try menu Help -> Open Preferences Directory

@txe
Copy link
Contributor

txe commented Jun 4, 2020

There is a new issue related to dictionary in snaps, so I'll close this one

@txe txe closed this as completed Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants