spinetoolbox.widgets.data_store_widget

Contains the DataStoreForm class.

author:
  1. Marin (KTH)
date:

26.11.2018

Module Contents

class spinetoolbox.widgets.data_store_widget.DataStoreFormBase(db_mngr, *db_urls)[source]

Bases: PySide2.QtWidgets.QMainWindow

Base class for DataStoreForm

Initializes form.

Parameters:
  • db_mngr (SpineDBManager) – The manager to use
  • *db_urls (tuple) – Database url, codename.
msg[source]
msg_error[source]
error_box[source]
add_menu_actions(self)[source]

Adds actions to View and Edit menu.

connect_signals(self)[source]

Connects signals to slots.

update_undo_redo_actions(self, index)[source]
update_commit_enabled(self, _clean=False)[source]
show_history_dialog(self, checked=False)[source]
init_models(self)[source]

Initializes models.

add_message(self, msg)[source]

Appends regular message to status bar.

Parameters:msg (str) – String to show in QStatusBar
restore_dock_widgets(self)[source]

Docks all floating and or hidden QDockWidgets back to the window.

_handle_menu_edit_about_to_show(self)[source]

Runs when the edit menu from the main menubar is about to show. Enables or disables actions according to selection status.

_find_focus_child(self)[source]
selected_entity_class_ids(self, entity_class_type)[source]

Returns object class ids selected in object tree and parameter tag toolbar.

_accept_selection(self, widget)[source]

Clears selection from all widgets except the given one, so there’s only one selection in the form at a time. In addition, registers the given widget as the official source for all operations involving selections (copy, remove, edit), but only in case it has a selection.

remove_selection(self, checked=False)[source]

Removes selection of items.

copy(self, checked=False)[source]

Copies data to clipboard.

paste(self, checked=False)[source]

Pastes data from clipboard.

show_import_file_dialog(self, checked=False)[source]

Shows dialog to allow user to select a file to import.

export_database(self, checked=False)[source]

Exports data from database into a file.

_select_database(self)[source]

Lets user select a database from available databases.

Shows a dialog from which user can select a single database. If there is only a single database it is selected automatically and no dialog is shown.

Returns:the database map of the database or None if no database was selected
export_to_excel(self, db_map, file_path)[source]

Exports data from database into Excel file.

export_to_sqlite(self, db_map, file_path)[source]

Exports data from database into SQlite file.

refresh_session(self, checked=False)[source]
commit_session(self, checked=False)[source]

Commits session.

rollback_session(self, checked=False)[source]
receive_session_committed(self, db_maps)[source]
receive_session_rolled_back(self, db_maps)[source]
receive_session_refreshed(self, db_maps)[source]
_handle_tag_button_toggled(self, db_map_ids, checked)[source]

Updates filter according to selected tags.

show_manage_parameter_tags_form(self, checked=False)[source]
_handle_parameter_value_list_selection_changed(self, selected, deselected)[source]

Accepts selection.

show_parameter_value_list_context_menu(self, pos)[source]

Shows the context menu for parameter value list tree view.

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

Removes selection of parameter value-lists.

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_parameter_definitions_added(self, db_map_data)[source]
receive_parameter_values_added(self, db_map_data)[source]
receive_parameter_value_lists_added(self, db_map_data)[source]
receive_parameter_tags_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_parameter_definitions_updated(self, db_map_data)[source]
receive_parameter_values_updated(self, db_map_data)[source]
receive_parameter_value_lists_updated(self, db_map_data)[source]
receive_parameter_tags_updated(self, db_map_data)[source]
receive_parameter_definition_tags_set(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]
receive_parameter_definitions_removed(self, db_map_data)[source]
receive_parameter_values_removed(self, db_map_data)[source]
receive_parameter_value_lists_removed(self, db_map_data)[source]
receive_parameter_tags_removed(self, db_map_data)[source]
restore_ui(self)[source]

Restore UI state from previous session.

save_window_state(self)[source]

Save window state parameters (size, position, state) via QSettings.

closeEvent(self, event)[source]

Handle close window.

Parameters:event (QCloseEvent) – Closing event
class spinetoolbox.widgets.data_store_widget.DataStoreForm(db_mngr, *db_urls)[source]

Bases: spinetoolbox.widgets.tabular_view_mixin.TabularViewMixin, spinetoolbox.widgets.graph_view_mixin.GraphViewMixin, spinetoolbox.widgets.parameter_view_mixin.ParameterViewMixin, spinetoolbox.widgets.tree_view_mixin.TreeViewMixin, spinetoolbox.widgets.data_store_widget.DataStoreFormBase

A widget to visualize Spine dbs.

Initializes everything.

Parameters:
  • db_mngr (SpineDBManager) – The manager to use
  • *db_urls (tuple) – Database url, codename.
connect_signals(self)[source]
tabify_and_raise(self, docks)[source]

Tabifies docks in given list, then raises the first.

Parameters:docks (list) –
begin_style_change(self)[source]

Begins a style change operation.

end_style_change(self)[source]

Ends a style change operation.

apply_tree_style(self, checked=False)[source]

Applies the tree style, inspired in the former tree view.

apply_tabular_style(self, checked=False)[source]

Applies the tree style, inspired in the former tabular view.

apply_graph_style(self, checked=False)[source]

Applies the tree style, inspired in the former graph view.