vkbo / novelWriter

novelWriter is an open source plain text editor designed for writing novels. It supports a minimal markdown-like syntax for formatting text. It is written with Python 3 (3.9+) and Qt 5 (5.15) for cross-platform support.
https://novelwriter.io
GNU General Public License v3.0
2.03k stars 102 forks source link

Status icon settings & multiple projects #1847

Open awqk opened 5 months ago

awqk commented 5 months ago

Just noticed the status icon config is part of the project settings. Especially with the upcoming new features #1810, I would want to do the setup only once, and use the same setting for all my projects.

Please consider making this a global setting, or allow import/export, or copy from other project. Maybe it is as simple as storing the settings in a separate file in the meta subdirectory, to allow manual copy between projects, and have "Rebuild Index" update the usage statistics.

vkbo commented 5 months ago

The already provided solution for this is to create a template project. You can create new projects from a template from the new Welcome dialog.

I'll update the documentation on this, since it is not mentioned.

vkbo commented 5 months ago

Also, they cannot be global. Each status/importance label is associated with a unique key. The user interface ensures you cannot delete a key that is in use. If they were global, there would be no way to check this and you will risk erasing information from other projects when you make changes.

The only safe way to handle this would be to allow for import/export. However, this too is non-trivial since you cannot clear existing status labels on import, since they are in use. How do you then consolidate the imported changes? The only option is to append them, and you have to manually go through all your documents and switch to the new ones, before you delete the old. There is no easy way to automate this, so it would require a merge tool that is a medium sized feature task and a fair bit of effort to implement. A larger feature task is not likely to be implemented any time soon as there are a lot of higher impact features in the pipeline.

The only clean way is to use templates.

awqk commented 5 months ago

It would all be so easy, if it weren't for the details :smile:. Looking at two projects, I see the keys are different every time, even if the colours and label are the same. That's probably bad news for importing and copying.

But I agree, making this setting global feels a bit dangerous, and having templates is better than nothing. It's not like the status labels change a lot, and if I want I can still hack the .nwx file.

vkbo commented 5 months ago

Hacking the .nwx file is never the solution, but always a workaround, sure 😄

Anyway, I can convert this to a feature request as an import/export implementation. But as I said, it will not be implemented in a while. There are a lot of more impactful features to work on, and I don't seem to be able to make much of a dent in the number of requests as new ones come in all the time,

I did think a bit more about how a merge tool could work. It could compare the label text and update the colour and icon settings for those that have the same name (and ignore the unique key), and add the ones that do not. It is a lot simpler, and the user can simply cancel the Project Settings dialog if it ends up a mess. The changes are not applied directly.

Incidentally, the original implementation only used the status label text as the key. But that got a bit clunky when the user renamed them as all documents using it had to be updated. That's why I switched to a random generated key in version 2.0. It's the same logic used for document file names. Disconnecting the label from the actual entry makes a lot of things easier in the code, and a lot more robust against code errors.

awqk commented 5 months ago

I don't seem to be able to make much of a dent in the number of requests as new ones come in all the time

I will try to slow down a bit :smile: