spinetoolbox.widgets.tree_view_mixin

Contains the TreeViewMixin class.

author:
  1. Marin (KTH)
date:

26.11.2018

Module Contents

class spinetoolbox.widgets.tree_view_mixin.TreeViewMixin(*args, **kwargs)[source]

Provides object and relationship trees for the data store form.

add_menu_actions(self)[source]

Adds toggle view actions to View menu.

connect_signals(self)[source]

Connects signals to slots.

init_models(self)[source]

Initializes models.

_handle_object_tree_selection_changed(self, selected, deselected)[source]

Updates object filter and sets default rows.

_handle_relationship_tree_selection_changed(self, selected, deselected)[source]

Updates relationship filter and sets default rows.

static _db_map_items(indexes)[source]

Groups items from given tree indexes by db map.

Returns:lists of dictionary items keyed by DiffDatabaseMapping
Return type:dict
static _db_map_class_id_data(db_map_data)[source]

Returns a new dictionary where the class id is also part of the key.

Returns:lists of dictionary items keyed by tuple (DiffDatabaseMapping, integer class id)
Return type:dict
static _extend_merge(left, right)[source]

Returns a new dictionary by uniting left and right.

Returns:lists of dictionary items keyed by DiffDatabaseMapping
Return type:dict
_update_object_filter(self)[source]

Updates filters object filter according to object tree selection.

_update_relationship_filter(self)[source]

Update filters relationship filter according to relationship tree selection.

edit_object_tree_items(self, current)[source]

Starts editing the given index in the object tree.

edit_relationship_tree_items(self, current)[source]

Starts editing the given index in the relationship tree.

show_object_tree_context_menu(self, pos)[source]

Shows the context menu for object tree.

Parameters:pos (QPoint) – Mouse position
show_relationship_tree_context_menu(self, pos)[source]

Shows the context for relationship tree.

Parameters:pos (QPoint) – Mouse position
fully_expand_selection(self)[source]
fully_collapse_selection(self)[source]
find_next_relationship(self, index)[source]

Expands next occurrence of a relationship in object tree.

call_show_add_objects_form(self, index)[source]
call_show_add_relationship_classes_form(self, index)[source]
call_show_add_relationships_form(self, index)[source]
show_add_object_classes_form(self, checked=False)[source]

Shows dialog to let user select preferences for new object classes.

show_add_objects_form(self, checked=False, class_name='')[source]

Shows dialog to let user select preferences for new objects.

show_add_relationship_classes_form(self, checked=False, object_class_one_name=None)[source]

Shows dialog to let user select preferences for new relationship class.

show_add_relationships_form(self, checked=False, relationship_class_key=(), object_class_name='', object_name='')[source]

Shows dialog to let user select preferences for new relationships.

show_edit_object_classes_form(self, checked=False)[source]
show_edit_objects_form(self, checked=False)[source]
show_edit_relationship_classes_form(self, checked=False)[source]
show_edit_relationships_form(self, checked=False)[source]
show_remove_object_tree_items_form(self)[source]

Shows form to remove items from object treeview.

show_remove_relationship_tree_items_form(self)[source]

Shows form to remove items from relationship treeview.

notify_items_changed(self, action, item_type, db_map_data)[source]

Enables or disables actions and informs the user about what just happened.

receive_object_classes_added(self, db_map_data)[source]
receive_objects_added(self, db_map_data)[source]
receive_relationship_classes_added(self, db_map_data)[source]
receive_relationships_added(self, db_map_data)[source]
receive_object_classes_updated(self, db_map_data)[source]
receive_objects_updated(self, db_map_data)[source]
receive_relationship_classes_updated(self, db_map_data)[source]
receive_relationships_updated(self, db_map_data)[source]
receive_object_classes_removed(self, db_map_data)[source]
receive_objects_removed(self, db_map_data)[source]
receive_relationship_classes_removed(self, db_map_data)[source]
receive_relationships_removed(self, db_map_data)[source]