spinetoolbox.project_commands¶
QUndoCommand subclasses for modifying the project.
| authors: |
|
|---|---|
| date: | 12.2.2020 |
Module Contents¶
Classes¶
SpineToolboxCommand |
|
SetProjectNameCommand |
Command to set the project name. |
SetProjectDescriptionCommand |
Command to set the project description. |
AddProjectItemsCommand |
Command to add items. |
RemoveAllProjectItemsCommand |
Command to remove all items from project. |
RemoveProjectItemCommand |
Command to remove items. |
RenameProjectItemCommand |
Command to rename items. |
AddLinkCommand |
Command to add link. |
RemoveLinkCommand |
Command to remove link. |
MoveIconCommand |
Command to move icons in the Design view. |
SetItemSpecificationCommand |
Command to set the specification for a Tool. |
AddSpecificationCommand |
Command to add item specs to a project. |
RemoveSpecificationCommand |
Command to remove item specs from a project. |
UpdateSpecificationCommand |
Command to update item specs in a project. |
-
class
spinetoolbox.project_commands.SpineToolboxCommand[source]¶ Bases:
PySide2.QtWidgets.QUndoCommand
-
class
spinetoolbox.project_commands.SetProjectNameCommand(project, name)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to set the project name.
Parameters: - project (SpineToolboxProject) – the project
- name (str) – The new name
-
class
spinetoolbox.project_commands.SetProjectDescriptionCommand(project, description)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to set the project description.
Parameters: - project (SpineToolboxProject) – the project
- description (str) – The new description
-
class
spinetoolbox.project_commands.AddProjectItemsCommand(project, item_type, items, set_selected=False, verbosity=True)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to add items.
Parameters: - project (SpineToolboxProject) – the project
- item_type (str) – The factory name
- items (Iterable) – one or more dict of items to add
- set_selected (bool) – Whether to set item selected after the item has been added to project
- verbosity (bool) – If True, prints message
-
class
spinetoolbox.project_commands.RemoveAllProjectItemsCommand(project, items_per_category, links, delete_data=False)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to remove all items from project.
Parameters: - project (SpineToolboxProject) – the project
- delete_data (bool) – If True, deletes the directories and data associated with the items
-
class
spinetoolbox.project_commands.RemoveProjectItemCommand(project, name, delete_data=False)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to remove items.
Parameters: - project (SpineToolboxProject) – the project
- name (str) – Item’s name
- delete_data (bool) – If True, deletes the directories and data associated with the item
-
class
spinetoolbox.project_commands.RenameProjectItemCommand(project_item_model, tree_item, new_name)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to rename items.
Parameters: - project_item_model (ProjectItemModel) – the project
- tree_item (LeafProjectTreeItem) – the item to rename
- new_name (str) – the new name
-
class
spinetoolbox.project_commands.AddLinkCommand(graphics_view, src_connector, dst_connector)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to add link.
Parameters: - graphics_view (DesignQGraphicsView) – the view
- src_connector (ConnectorButton) – the source connector
- dst_connector (ConnectorButton) – the destination connector
-
class
spinetoolbox.project_commands.RemoveLinkCommand(graphics_view, link)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to remove link.
Parameters: - graphics_view (DesignQGraphicsView) – the view
- link (Link) – the link
-
class
spinetoolbox.project_commands.MoveIconCommand(graphics_item)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to move icons in the Design view.
Parameters: graphics_item (ProjectItemIcon) – the icon
-
class
spinetoolbox.project_commands.SetItemSpecificationCommand(item, specification)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to set the specification for a Tool.
Parameters: - item (ProjectItem) – the Item
- specification (ProjectItemSpecification) – the new spec
-
class
spinetoolbox.project_commands.AddSpecificationCommand(toolbox, specification)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to add item specs to a project.
Parameters: - toolbox (ToolboxUI) – the toolbox
- specification (ProjectItemSpecification) – the spec
-
class
spinetoolbox.project_commands.RemoveSpecificationCommand(toolbox, row, ask_verification)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to remove item specs from a project.
Parameters: - toolbox (ToolboxUI) – the toolbox
- row (int) – the row in the ProjectItemSpecPaletteModel
- ask_verification (bool) – if True, shows confirmation message the first time
-
class
spinetoolbox.project_commands.UpdateSpecificationCommand(toolbox, row, specification)[source]¶ Bases:
spinetoolbox.project_commands.SpineToolboxCommandCommand to update item specs in a project.
Parameters: - toolbox (ToolboxUI) – the toolbox
- row (int) – the row in the ProjectItemSpecPaletteModel of the spec to be replaced
- specification (ProjectItemSpecification) – the updated spec