Skip to content

Python-based UI interface improvements #4147

@skef

Description

@skef

It seems like the project may be on the cusp of making more regular use of python scripts and potential user contributions. So I think I'll look into extending the interactive aspects of the scripting interface a bit more, in some ways we've already discussed in past issues and in other ways that are new (and easier). Here is a list:

  1. Do the discovery thing discussed in We need a way to create UI elements from Python scripts—the inability to import GTK from Python is a bug! #3663 so that you can install a python package in the normal way and have it add menu items. (Skip enable/disable for now, add that if and when people ask for it.)
  2. Modify registerMenuItem so that if the menu-function argument is the string "separator" the "menu-name' item is replaced with a menu separator.
  3. Modify registerMenuItem so that if the menu-function argument is the string "link" the "data" field is treated as a URL, which is opened when the item is selected from the menu. (For good measure add an interface to the fontforge object for opening a web page in other contexts.)
  4. If possible, re-enable the shortcut-string (now more or less ineffectual) as a "suggestion", so that if the specified hotkey is not already "taken" it is enabled on that item. (The tricky thing here is whether one can tell that a hotkey is taken. I don't remember.) Junk the current syntax in favor of the hotkey file syntax (if they are different). Don't require repeating the name in the shortcut string.
  5. Write a short style guide, either in the docs or on the wiki (seems like docs would be preferable -- not many people know about the wiki), for scripts-for-other-people. Basically: encourage a single top-level menu item for each contribution with multiple sub-items. Then at the bottom a separator and a link to an "about" page. Also some suggestions for hotkey suggestions. Include the basics of how to write one module that does different things in different contexts.

Unless discovery is trickier than I expect this shouldn't add up to much work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions