class documentation

class CustomToolManager(SignalEmitter): (source)

View In Hierarchy

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
def __init__(self): (source)

Undocumented

def __iter__(self): (source)

Undocumented

def create(self, Name, **properties): (source)
Create a new custom tool
Parameters
Namethe name to show in the Tools menu
**properties

properties for the custom tool, e.g.:

  • Comment
  • Icon
  • X-Zim-ExecTool
  • X-Zim-ReadOnly
  • X-Zim-ShowInToolBar
Returns
a new CustomTool object.
def delete(self, tool): (source)
Remove a custom tool from the list and delete the definition file.
Parameters
toola custom tool name or CustomTool object
def get_tool(self, name): (source)
Get a CustomTool by name.
Parameters
namethe tool name
Returns
a CustomTool object or None
def index(self, tool): (source)
Get the position of a specific tool in the list.
Parameters
toola custom tool name or CustomTool object
Returns
an integer for the position
def reorder(self, tool, i): (source)
Change the position of a tool in the list.
Parameters
toola custom tool name or CustomTool object
ithe new position as integer
__signals__ = (source)

Undocumented

@SignalHandler
def _on_list_changed(self, *a): (source)

Undocumented

def _on_tool_changed(self, tool, *a): (source)

Undocumented

def _read_list(self): (source)

Undocumented

def _write_list(self): (source)

Undocumented

_listfile = (source)

Undocumented

_names: list = (source)

Undocumented

_tools: dict = (source)

Undocumented