Comment 8 for bug 1299092

Revision history for this message
Guillaume Chereau (guillaume-chereau) wrote : Re: [Bug 1299092] Re: Restore default_shortcuts.json and embedded scripts support

There were some technical problems with the default_shortcuts.json
approach in my opinion. I changed it so that the default shortcuts are
defined in the C++ code at the same time we create the actions, it
avoided some redundancies and made the code smaller. Also I thought it
was nicer to save only the redefined shortcuts directly in the config
file instead of the somehow complicated json format that was used.

One thing that annoyed me what that in the json file you had for
example:

  "actionShow_Constellation_Lines": {
    "text": "Constellation lines",
    "primaryKey": "C",
    "checkable": "1",
    "autorepeat": "0",
    "global": "1"
  }

Here the only real information is the primaryKey attribute. All the
other attributes are already known by the code implementing the action,
so it does not make sense to make them configurable. What would it mean
for example to change the checkable value to "0"?

Those changes were not related to the embedded scripts functionality, I
just happened to remove that as well since it was part of the json file,
at the time I thought it was acceptable to just let people create
shortcuts in the usual way.

So, it would be possible to reintroduce some support for embedded scripts,
but at the cost of having a special file to parse only for this reason,
which I somehow find annoying.

An intermediary solution could be to allow to specify a default shortcut
directly in the script files. Then you would still need to create one
file per script, but at least you wouldn't have to change the config.ini
to add the shortcuts. Do you think that solution would be good enough?