spinetoolbox.spine_db_editor.widgets.spine_db_editor
Contains the SpineDBEditor class.
Module Contents
Classes
Base class for SpineDBEditor (i.e. Spine database editor). |
|
A widget to visualize Spine dbs. |
- class spinetoolbox.spine_db_editor.widgets.spine_db_editor.SpineDBEditorBase(db_mngr)[source]
Bases:
PySide6.QtWidgets.QMainWindow
Base class for SpineDBEditor (i.e. Spine database editor).
- Parameters
db_mngr (SpineDBManager) – The manager to use
- static is_db_map_editor()[source]
Always returns True as SpineDBEditors are truly database editors.
Unless, of course, the database can one day be opened in read-only mode. In that case this method should return False.
- Returns
Always True
- Return type
bool
Returns a menu with all dock toggle/view actions. Called by
self.add_main_menu()
.- Returns
QMenu
Adds a menu with main actions to toolbar.
- add_message(msg)[source]
Pushes message to notification stack.
- Parameters
msg (str) – String to show in the notification
- refresh_copy_paste_actions()[source]
Runs when menus are about to show. Enables or disables actions according to selection status.
- import_data(data)[source]
Imports data to all database mappings open in the editor.
- Parameters
data (dict) – data to import
- show_mass_export_items_dialog(checked=False)[source]
Shows dialog for user to select dbs and items for export.
- duplicate_entity(entity_item)[source]
Duplicates an entity.
- Parameters
entity_item (EntityItem) –
- duplicate_scenario(db_map, scen_id)[source]
Duplicates a scenario.
- Parameters
db_map (DiffDatabaseMapping) –
scen_id (int) –
- export_data(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
- _store_purge_settings(state)[source]
Stores Purge items dialog state.
- Parameters
state (dict) – dialog state
- show_parameter_value_editor(index, plain=False)[source]
Shows the parameter_value editor for the given index of given table view.
- _log_items_change(msg)[source]
Enables or disables actions and informs the user about what just happened.
- restore_ui(view_type, fresh=False)[source]
Restores UI state from previous session.
- Parameters
view_type (str) – What the selected view type is.
fresh (bool) – If true, the view specified with subgroup will be applied, instead of loading the previous window state of the said view.
- tear_down()[source]
Performs clean up duties.
- Returns
True if editor is ready to close, False otherwise
- Return type
bool
- _prompt_to_commit_changes()[source]
Prompts the user to commit or rollback changes to ‘dirty’ db maps.
- Returns
QMessageBox status code
- Return type
int
- _get_commit_msg(db_names)[source]
Prompts user for commit message.
- Parameters
db_names (Iterable of str) – database names
- Returns
commit message
- Return type
str
- 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.stacked_view_mixin.StackedViewMixin
,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
- tabify_and_raise(docks)[source]
Tabifies docks in given list, then raises the first.
- Parameters
docks (list) –
- apply_stacked_style(_checked=None)[source]
Applies the stacked style, inspired in the former tree view.
- apply_pivot_style(_checked=None)[source]
Applies the pivot style, inspired in the former tabular view.