Code Monkey home page Code Monkey logo

Comments (3)

giuspen avatar giuspen commented on September 25, 2024

I'm not understanding why you need the list of recent documents updated in the config.cfg while your cherrytree window is still running. Can you describe better your use case?

from cherrytree.

gitvectors avatar gitvectors commented on September 25, 2024

My "use case" is as follows. I hope it does not give you indigestion.

Desktop Ubuntu 22.04 but Windows 10 can be dual booted (rarely use windows though).
Adopted CherryTree as my main “container" for multiple processes (desktop and cloud).
For example if I want to communicate with a cloud service (there are many) such as Azure I place all the “context notes” in a container - *ctd. Including scripts in CodeBoxes.
If I want to run a desktop workflow I create a CherryTree container for that purpose.
I do not put every workflow/process into a single CherryTree container.
To manage this terrain I use Recoll as my indexing engine in Ubuntu. There is a Windows version of Recoll but developer requests a small reasonable donation for this added development. I stay in Ubuntu.

I index my entire desktop (takes long time on first indexing) but thereafter daily "update index" in Recoll.

Now in Recoll I have a GUI and I search ext:ctd. This means “list all files with extension *.ctd”. More complex queries can be seen from cheat sheet which shows when hovering cursor over query field.

In recoll GUI after searching ext:ctd I see every CherryTree document in my desktop, searchable by Date, Title. Filename etc.

Current *.ctd count is 698.

If I want to search for CherryTree files containing key words I add that to the Recoll Query Language form.

When I want to launch any of the (698) detected CherryTree documents I first setup Recoll > Preferences > GUI Configuration > Choose Editor Application

And in application/xml associate that with cherrytree %f

This ensures that instead of Desktop Default (which shows raw XML) the selected file launches in CherryTree.
Now I can click on any CherryTree file in Recoll and a parallel CherryTree window opens.

I look at Docky bar and right click on CherryTree icon I can see all concurrent CherryTree windows open and I can switch between these.

BUT in addition to this window switching in docky bar I would like to be in any CherryTree window and leverage File > Recent Documents to give another dimension of toggling between the stack of recent sessions I have launched from Recoll as my launchpad.

My reported “issue” is that this dynamic list is out of sync. I cannot go back to a recent document since there is a lag of last document showing in syncing (because CherryTree is never shut down). The Recent Documents list is lagging behind this agile switching model I have devised.

HOWEVER, I realise that can add this “update config.cfg” during live session as discussed below. No need to change Cherrytree.


Recently ...

I have multiple Cherrytree documents in my Ubuntu desktop as described above. Version 1.1.2.

I use Recoll to index these and it has worked very well. Indeed as I explain above in my daily workflow I have several instances of Cherytree running at any time and I can switch. I use Recoll as the launcher for CherryTree documents

But recently I note that when launching CherryTree instances the previous Preferences are not preserved and the Recent Documents list is reset to a shorter list.

I inspect
/Home/.config/cherrytree/config.cfg
which shows default font settings.

[fonts]
rt_font=Sans 11
pt_font=Sans 11
tree_font=Sans 10
code_font=Monospace 11
vte_font=Monospace 10

I don't yet know why this reset occurs. And why it worked previously. But it occurs to me that in the same way that CherryTree creates multiple backups, we might have multiple backups of config files.

     ~config.cfg
     ~~config.cfg
     ~~~config.cfg

And an ability to cycle through these backup configurations in the active CherryTree instance.

As a workaround I shall have to write a script to emulate this backup and dynamically toggle between config.cfg snapshots.

As an added thought I will use Meld so that i can compare changes between instances.

A workaround CodeBox Python script might follow this.

Open /HOME/.config/cherrytree/

Copy ~~~config.cfg to ~~~~config.cfg
Copy ~~config.cfg to ~~~config.cfg
Copy ~config.cfg to ~~config.cfg
Copy config.cfg to ~config.cfg

Meld config.cfg and ~config.cfg
Meld ~config.cfg and ~~config.cfg
Meld ~_config.cfg and ~~~config.cfg

Meld *.ctd and *.~ctd
Meld *.~ctd and *.~~ctd
Meld *.~~ctd and *.~~~ctd

from cherrytree.

giuspen avatar giuspen commented on September 25, 2024

Since the config.cfg is getting larger and larger and an attempt to save it happens also if you shutdown your OS with cherrytree still running, it would make sense to support a safe backup (rotate an already successfully parsed config file) before saving the new one and restore from the latest backup in case of failure to parse.

from cherrytree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.