spinetoolbox.spine_db_editor.widgets.spine_db_editor

Contains the SpineDBEditor class.

author
  1. Marin (KTH)

date

26.11.2018

Module Contents

Classes

SpineDBEditorBase

Base class for SpineDBEditor (i.e. Spine database editor).

SpineDBEditor

A widget to visualize Spine dbs.

class spinetoolbox.spine_db_editor.widgets.spine_db_editor.SpineDBEditorBase(db_mngr)[source]

Bases: PySide2.QtWidgets.QMainWindow

Base class for SpineDBEditor (i.e. Spine database editor).

Initializes form.

Parameters

db_mngr (SpineDBManager) – The manager to use

msg[source]
msg_error[source]
file_exported[source]
sqlite_file_exported[source]
property toolbox(self)[source]
property settings_subgroup(self)[source]
property db_names(self)[source]
property first_db_map(self)[source]
property db_url_codenames(self)[source]
load_db_urls(self, db_url_codenames, create=False, update_history=True)[source]
init_add_undo_redo_actions(self)[source]
fetch_db_maps(self, *db_maps)[source]
_make_busy(self)[source]
_make_iddle(self)[source]
load_previous_urls(self, _=False)[source]
load_next_urls(self, _=False)[source]
open_db_file(self, _=False)[source]
create_db_file(self, _=False)[source]
_make_docks_menu(self)[source]

Returns a menu with all dock toggle/view actions. Called by self.add_main_menu().

Returns

QMenu

add_main_menu(self)[source]

Adds a menu with main actions to toolbar.

connect_signals(self)[source]

Connects signals to slots.

update_undo_redo_actions(self, index)[source]
_replace_undo_redo_actions(self, new_undo_action, new_redo_action)[source]
_refresh_undo_redo_actions(self)[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]

Pushes message to notification stack.

Parameters

msg (str) – String to show in the notification

Pushes link message to notification stack.

Parameters

msg (str) – String to show in notification

refresh_copy_paste_actions(self)[source]

Runs when menus are about to show. Enables or disables actions according to selection status.

copy(self, checked=False)[source]

Copies data to clipboard.

paste(self, checked=False)[source]

Pastes data from clipboard.

import_data(self, data)[source]
import_file(self, checked=False)[source]

Import file. It supports SQLite, JSON, and Excel.

import_from_json(self, file_path)[source]
import_from_sqlite(self, file_path)[source]
import_from_excel(self, file_path)[source]
show_mass_export_items_dialog(self, checked=False)[source]

Shows dialog for user to select dbs and items for export.

export_session(self, checked=False)[source]

Exports changes made in the current session as reported by DiffDatabaseMapping.

mass_export_items(self, db_map_item_types)[source]
export_data(self, db_map_ids_for_export)[source]

Exports data from given dictionary into a file.

Parameters

db_map_ids_for_export – Dictionary mapping db maps to keyword arguments for spinedb_api.export_data

static _parse_db_map_metadata(db_map_metadata)[source]
static _metadata_per_entity(db_map, entity_ids)[source]
show_db_map_entity_metadata(self, db_map_ids)[source]
static _metadata_per_parameter_value(db_map, param_val_ids)[source]
show_db_map_parameter_value_metadata(self, db_map_ids)[source]
reload_session(self, db_maps)[source]

Reloads data from given db_maps.

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, cookie)[source]
receive_session_rolled_back(self, db_maps)[source]
receive_session_refreshed(self, db_maps)[source]
show_mass_remove_items_form(self, checked=False)[source]
show_parameter_value_editor(self, index)[source]

Shows the parameter_value editor for the given index of given table view.

receive_error_msg(self, db_map_error_log)[source]
log_changes(self, action, item_type, db_map_data)[source]

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

receive_scenarios_added(self, db_map_data)[source]
receive_alternatives_added(self, db_map_data)[source]
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_entity_groups_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_features_added(self, db_map_data)[source]
receive_tools_added(self, db_map_data)[source]
receive_tool_features_added(self, db_map_data)[source]
receive_tool_feature_methods_added(self, db_map_data)[source]
receive_scenarios_updated(self, db_map_data)[source]
receive_alternatives_updated(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_features_updated(self, db_map_data)[source]
receive_tools_updated(self, db_map_data)[source]
receive_tool_features_updated(self, db_map_data)[source]
receive_tool_feature_methods_updated(self, db_map_data)[source]
receive_parameter_definition_tags_set(self, db_map_data)[source]
receive_scenarios_removed(self, db_map_data)[source]
receive_alternatives_removed(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_entity_groups_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]
receive_features_removed(self, db_map_data)[source]
receive_tools_removed(self, db_map_data)[source]
receive_tool_features_removed(self, db_map_data)[source]
receive_tool_feature_methods_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.

tear_down(self)[source]
closeEvent(self, event)[source]

Handle close window.

Parameters

event (QCloseEvent) – Closing event

class spinetoolbox.spine_db_editor.widgets.spine_db_editor.SpineDBEditor(db_mngr, db_url_codenames=None)[source]

Bases: spinetoolbox.spine_db_editor.widgets.tabular_view_mixin.TabularViewMixin, spinetoolbox.spine_db_editor.widgets.graph_view_mixin.GraphViewMixin, spinetoolbox.spine_db_editor.widgets.parameter_view_mixin.ParameterViewMixin, spinetoolbox.spine_db_editor.widgets.tree_view_mixin.TreeViewMixin, SpineDBEditorBase

A widget to visualize Spine dbs.

Initializes everything.

Parameters

db_mngr (SpineDBManager) – The manager to use

connect_signals(self)[source]

Connects signals to slots.

_restart_timer_refresh_tab_order(self, _visible=False)[source]
_refresh_tab_order(self)[source]
tabify_and_raise(self, docks)[source]

Tabifies docks in given list, then raises the first.

Parameters

docks (list) –

restore_dock_widgets(self)[source]

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

begin_style_change(self)[source]

Begins a style change operation.

end_style_change(self)[source]

Ends a style change operation.

apply_stacked_style(self, checked=False)[source]

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

apply_pivot_style(self, _action)[source]

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

apply_graph_style(self, checked=False)[source]

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

static _get_base_dir()[source]