class CustomToolManager(SignalEmitter): (source)
Manager for dealing with the desktop files which are used to store custom tools.
Custom tools are external commands that are intended to show in the "Tools" menu in zim (and optionally in the tool bar). They are defined as desktop entry files in a special folder (typically "~/.local/share/zim/customtools") and use several non standard keys. See CustomTool
for details.
This object is iterable and maintains a specific order for tools to be shown in in the user interface.
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | create |
Create a new custom tool |
Method | delete |
Remove a custom tool from the list and delete the definition file. @param tool: a custom tool name or CustomTool object |
Method | get_tool |
Get a CustomTool by name. @param name: the tool name @returns: a CustomTool object or None |
Method | index |
Get the position of a specific tool in the list. @param tool: a custom tool name or CustomTool object @returns: an integer for the position |
Method | reorder |
Change the position of a tool in the list. @param tool: a custom tool name or CustomTool object @param i: the new position as integer |
Class Variable | __signals__ |
Undocumented |
Method | _on_list_changed |
Undocumented |
Method | _on_tool_changed |
Undocumented |
Method | _read_list |
Undocumented |
Method | _write_list |
Undocumented |
Instance Variable | _listfile |
Undocumented |
Instance Variable | _names |
Undocumented |
Instance Variable | _tools |
Undocumented |
Inherited from SignalEmitter
:
Method | __new__ |
Undocumented |
Method | block_signals |
Returns a context manager for blocking one or more signals |
Method | connect |
Register a handler for a specific object. |
Method | connect_after |
Like connect() but handler will be called after default handler |
Method | disconnect |
Undocumented |
Method | emit |
Undocumented |
Method | emit_return_first |
Emits a signal and stops emission on the first handler that returns a not-None value. |
Method | emit_return_iter |
Returns an generator that calls one handler on each iteration and yields the return values. This allows aggregating return values. |
Method | _connect |
Undocumented |
Method | _setup_signal |
Undocumented |
Method | _teardown_signal |
Undocumented |
Parameters | |
Name | the name to show in the Tools menu |
**properties | properties for the custom tool, e.g.:
|
Returns | |
a new CustomTool object. |
Parameters | |
tool | a custom tool name or CustomTool object |
Parameters | |
tool | a custom tool name or CustomTool object |
Returns | |
an integer for the position |
Parameters | |
tool | a custom tool name or CustomTool object |
i | the new position as integer |