Re: [PATCH] Adding LFUN for removing LyX modules

2022-01-08 Thread Jean-Marc Lasgouttes
Le 22/10/2021 à 23:27, Yuriy Skalko a écrit : Thanks for the suggestions, Jean-Marc. Moved the check there. Probably it is worth to do the same for layoutModuleCanBeAdded, right? As I see now, the check for removing modules in frontend (updateDelPB) is more complex. Is that additional check rea

Re: [PATCH] Adding LFUN for removing LyX modules

2021-10-22 Thread Yuriy Skalko
Note that it is best to move the test for removing the module in getStatus, so that the function is disabled. With that, it would become possible in the frontend to use that code. I do not like to have duplicated (and possibly different) logic in those places. The solution might be to have a te

Re: [PATCH] Adding LFUN for removing LyX modules

2021-10-22 Thread Pavel Sanda
On Thu, Oct 21, 2021 at 08:14:27PM +0300, Yuriy Skalko wrote: > +/*! > + * \var lyx::FuncCode lyx::LFUN_LAYOUT_MODULE_REMOVE > + * \li Action: Removes a module. > + * \li Notion: Removes a module from the list of included modules for the > current buffer. > + * \li Syntax: layout-module-remove >

Re: [PATCH] Adding LFUN for removing LyX modules

2021-10-22 Thread Jean-Marc Lasgouttes
Le 22/10/2021 à 01:39, Yuriy Skalko a écrit : I like this idea! What if layout-module-remove is used on a module that a different module depends on? e.g., AMS Theorems (Extended) depends on AMS Theorems. If I have both added and I try to remove AMS Theorems, what happens? Do we need a layoutModul

Re: [PATCH] Adding LFUN for removing LyX modules

2021-10-21 Thread Yuriy Skalko
I like this idea! What if layout-module-remove is used on a module that a different module depends on? e.g., AMS Theorems (Extended) depends on AMS Theorems. If I have both added and I try to remove AMS Theorems, what happens? Do we need a layoutModuleCanBeRemoved helper function? Actually there m

Re: [PATCH] Adding LFUN for removing LyX modules

2021-10-21 Thread Scott Kostyshak
On Thu, Oct 21, 2021 at 08:14:27PM +0300, Yuriy Skalko wrote: > > Now LyX has functions for adding one module (LFUN_LAYOUT_MODULE_ADD) and for > removing all modules (LFUN_LAYOUT_MODULES_CLEAR), but removing only one > module is impossible. I propose to add such function: > LFUN_LAYOUT_MODULE_REMO

[PATCH] Adding LFUN for removing LyX modules

2021-10-21 Thread Yuriy Skalko
Now LyX has functions for adding one module (LFUN_LAYOUT_MODULE_ADD) and for removing all modules (LFUN_LAYOUT_MODULES_CLEAR), but removing only one module is impossible. I propose to add such function: LFUN_LAYOUT_MODULE_REMOVE. My current use case: adding and removing module "Minimalistic