The dip.shell module implements the infrastructure for defining and interfacing with a shell.
Base class: Interface
The IDisplay interface defines the metadata that an object may provide so that it can be referred to in a GUI and be recognisable by the user. It’s use is usually optional, i.e. an application will normally try to use other information if an object does not implement this interface.
Base class: Interface
The IShell interface defines the API of a shell.
The following action identifiers are considered to be well known. A shell would normally be expected to honour them.
dip.shell.actions.close dip.shell.actions.export dip.shell.actions.import dip.shell.actions.new dip.shell.actions.open dip.shell.actions.print dip.shell.actions.print_preview dip.shell.actions.printer_settings dip.shell.actions.quit dip.shell.actions.redo dip.shell.actions.save dip.shell.actions.save_as dip.shell.actions.undo dip.shell.actions.whats_this
The following action collection identifiers are considered to be well known. A shell, if it supports the concept of action collections, would normally be expected to honour them.
dip.shell.collections.edit dip.shell.collections.file dip.shell.collections.help dip.shell.collections.tools dip.shell.collections.view
Initialise the shell.
Parameter: | **properties – are keyword arguments used as property names and values that are applied to the shell widget. |
---|
Close a tool asking the user for help where necessary.
Parameter: | tool – is the tool to close. |
---|
Write a shell object to storage at its current location asking the user for help where necessary.
Parameter: | tool – is the tool operating on the shell object to write. |
---|
Write a shell object to storage at a new location asking the user for help where necessary.
Parameter: | tool – is the tool operating on the shell object to write. |
---|
Base class: IQActionAction
The IShellAction interface defines the API for an action that changes its state according to the user’s interaction with the containing shell.
Perform the action (probably) on a tool. This will not be called if validate() returns False.
Parameter: | tool – is the tool. |
---|
Check if the action can be performed on a tool.
Parameter: | tool – is the tool. |
---|---|
Returns: | True if the action can be performed. |
Base class: Interface
The IShellManager interface defines the API for a shell manager.
Close a tool asking the user for help where necessary.
Parameter: | tool – is the tool to close. |
---|---|
Returns: | True if the user didn’t cancel. |
Create a tool for a new shell object asking the user for help where necessary.
Returns: | the tool or None if the user cancelled. |
---|
Create a tool for a shell object read from storage asking the user for help where necessary.
Parameter: | location – is the optional location of the object to open. |
---|---|
Returns: | the object or None if the user cancelled. |
Confirm that the user wants to quit given the state of any shell objects.
Returns: | True if the user didn’t cancel. |
---|
Write a shell object to storage at its current location asking the user for help where necessary.
Parameter: | tool – is the tool operating on the shell object to write. |
---|
Write a shell object to storage at a new location asking the user for help where necessary.
Parameter: | tool – is the tool operating on the shell object to write. |
---|
Base class: IDisplay
The IShellObject interface defines the API of a shell object.
Base class: Interface
The IShellObjectFactory interface defines the API for factories of shell objects.
Create an instance of the shell object.
Parameter: | shell – is the shell. |
---|---|
Returns: | the instance of the shell object which must implement IShellObject or be able to be adapted to it. |
Base class: Interface
The ITool interface defines the API of a tool than operates on a shell object and relies on a shell manager to manage the lifecycle of the object.
Base class: Interface
The IToolFactory interface defines the API for tool factories.
Create an instance of the tool.
Parameters: |
|
---|---|
Returns: | the instance of the tool. This must be a QWidget instance and, therefore, can be adapted to the ITool interface. |
Check if the tool can handle an object.
Parameter: | obj – is the object. |
---|---|
Returns: | True if the tool can handle the object. |
Base class: IQActionAction
The IUnmanagedTool interface defines the API of an unmanaged tool.
Base class: Model
The ModelToolFactory class is a tool factory for any tool that uses an automatically generated view to edit a model. It is not registered as a tool factory itself, instead it will normally be sub-classed and those sub-classes will be registered.
Create an instance of the tool.
Parameters: |
|
---|---|
Returns: | the instance of the tool. |
Returns: | the view factory. |
---|
Check if the object can be handled.
Parameter: | obj – is the object. |
---|---|
Returns: | True if the tool can handle the object. |