Abdelrazak Younes wrote:
Jean-Marc Lasgouttes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
The first thing to do would be to move *all* code related to toolbar
and menubar handling to the frontend. We should do the toolbar/menubar
Action unification we were talking about back before 1.4.0 (in
Christmas 2005?), basically:
Yes.
We have *one* file describing all actions. Each action would have the
following fields:
- the translatable name: mandatory for looking up the action
Why? I do not like using a gui name to look up a function. lfun+arg
looks better to me.
lfun+arg might be very long, especially if the action is a command
sequence. And the name is defined already in the menu description file
(stmenu.inc). I just propose to reuse that. Then 'stdmenu.inc' would
just have to enumerate the names it wants.
- the associated LFUN: mandatory.
OK
- the relevant option(s): optional
By option, you mean argument, right?
Yes.
- the associated icon: optional, LyX would look up for a proper icon
based on the lfun name and option (as it does now) if not present. If
really not present, construct an icon with "name" if needed on a
toolbar.
OK
- the associated default bindings: optional. These would be overridden
by any bind file in use.
What shall we do that at all?
Because it seems logical to me. It does not make sense IMHO to define
everything related to an action in this file except for its shortcut. So
all of cua.bind should IMHO be merged into this new file. We can even
define multiple shortcuts for the different platforms if need be.
Bind file should then be for users that want to modify the default
shortcuts.
If XML were chosen, something like that (from the top of my head could
do the job:
<action name="Square root">
<LFUN name="math-insert">
<option>\sqrt</option>
</LFUN>
<icon>math-insert-sqrt</icon>
<binding>A-M-s</binding>
</action>
I do not see the point of xml in this case, but I do not care much.
XML because it's easy to parse and modify via a GUI.
And also because I like XML :-)
But an INI-like format could do too:
[square-root]
description = "Square &Root"
lfun = math-insert
argument=
icon = math-insert-sqrt
binding = "A-M s"
[select-all]
description="&Select All"
lfun = command-sequence
argument = "buffer-begin ; buffer-end-select"
icon =
binding = "C-a"
The advantage of splitting the command in its lfun and its argument is
that we could 'inherit' an action by overriding only the argument in a
user defined file.
Abdel.