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

Allow creating documents from templates via the context menu #1747

Open
tmarplatt opened this issue Mar 11, 2024 · 4 comments
Open

Allow creating documents from templates via the context menu #1747

tmarplatt opened this issue Mar 11, 2024 · 4 comments
Labels
enhancement Request: New feature or improvement

Comments

@tmarplatt
Copy link
Contributor

Right now it is only possible to add new templated Documents to the Project Tree via the Add Item button. But the Project Tree context menu already allows adding new default items via the context menu.

It should be possible to select an available template right from the context menu.

Bonus points if the list of templates is available at the same level as the default documents in the context menu (as opposed to navigating to the “From Template” sub-menu). Perhaps in a section of its own separated by a horizontal bar?

@tmarplatt tmarplatt added the enhancement Request: New feature or improvement label Mar 11, 2024
@vkbo
Copy link
Owner

vkbo commented Mar 11, 2024

As explained in #1519, the submenus are not included. The Qt framework already handles placement of context menus badly, and often cuts them off. Adding multiple submenus under an existing submenu is just asking for problems.

A parallel submenu may be a usable workaround, but I am trying to limit the size of the existing menu as well.

@vkbo vkbo changed the title Project Tree: allow creating a document from a template via the context menu Allow creating documents from templates via the context menu Mar 11, 2024
@tmarplatt
Copy link
Contributor Author

tmarplatt commented Mar 12, 2024

but I am trying to limit the size of the existing menu as well.

Surely not as a UX feature? Consider an author already invested in Templates by having added a number of them, anticipating their particular use cases. It should be perfectly acceptable to this author to open a context menu and see it expanded by the very number of custom templates. Small by default, large by customization. Sounds great!

Unless there's a different rationale for the size restriction?

edit: I realize now you may be referring to the main context menu, not the “Create New ...” submenu.

@vkbo
Copy link
Owner

vkbo commented Mar 12, 2024

I realize now you may be referring to the main context menu, not the “Create New ...” submenu.

Yes:

"The Qt framework already handles placement of context menus badly, and often cuts them off. Adding multiple submenus under an existing submenu is just asking for problems."

@hifron
Copy link

hifron commented May 20, 2024

GUIMain has methods supported in novelwriter listed in https://github.com/vkbo/novelWriter/blob/main/novelwriter/guimain.py

some file managers support scripts which could invoke some commands to novelwriter like
novelwriter --close-document
it is called command menu or command palete and says that some menu with currently supported commands(or all if desired) presented in some option box(or alternative as context menu) to be selected command from list and invoked...

if implemented as command-line API(but could be implemented also by GUI option box) could be for example:
novelwriter --close-document or from option list box as command list with one of command: close-document

but novelwriter --data=prefilled_project.zip test/ work only from GUI because postLaunchTasks method with command line args does nothing other than calling self.openProject(cmdOpen) or show welcomeScreen if not project opened. openProject only changeDocument if already opened some but not zip.

So to this issue: context menu is only host between commands passengers invoked and such invocation if not so desired currently in novelwriter could be added via filemanager and his actions with calling some addingDocument with commandline or via context menu in future...

context menu or command palete could be implemented in various ways but novelwriter should be prepared for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request: New feature or improvement
Projects
None yet
Development

No branches or pull requests

3 participants