spinetoolbox.spine_db_editor.widgets.mass_select_items_dialogs

Classes for custom QDialogs to add edit and remove database items.

Module Contents

Classes

_SelectDatabases

A widget that shows checkboxes for each database.

MassSelectItemsDialog

A dialog to query a selection of dbs and items from the user.

MassRemoveItemsDialog

A dialog to query user's preferences for mass removing db items.

MassExportItemsDialog

A dialog to let users chose items for JSON export.

class spinetoolbox.spine_db_editor.widgets.mass_select_items_dialogs._SelectDatabases(db_maps, checked_states, parent)[source]

Bases: PySide6.QtWidgets.QWidget

A widget that shows checkboxes for each database.

Parameters
  • db_maps (tuple of DatabaseMapping) – database maps

  • checked_states (dict, optional) – mapping from item name to check state boolean

  • parent (QWidget) – parent widget

checked_state_changed[source]
checked_states()[source]

Collects the checked states of databases.

Returns

mapping from database mapping to checked state boolean

Return type

dict

any_checked()[source]

Checks if any of the checkboxes is checked.

Returns

True if any check box is checked, False otherwise

Return type

bool

class spinetoolbox.spine_db_editor.widgets.mass_select_items_dialogs.MassSelectItemsDialog(parent, db_mngr, *db_maps, stored_state, ok_button_text)[source]

Bases: spinetoolbox.widgets.custom_qwidgets.SelectDatabaseItemsDialog

A dialog to query a selection of dbs and items from the user.

Parameters
  • parent (SpineDBEditor) – parent widget

  • db_mngr (SpineDBManager) – database manager

  • *db_maps – the dbs to select items from

  • stored_state (dict, Optional) – widget’s previous state

  • ok_button_text (str, optional) – alternative label for the OK button

state_storing_requested[source]
_handle_check_box_state_changed(_checked)[source]

Enables or disables the OK button.

accept()[source]
class spinetoolbox.spine_db_editor.widgets.mass_select_items_dialogs.MassRemoveItemsDialog(parent, db_mngr, *db_maps, stored_state=None)[source]

Bases: MassSelectItemsDialog

A dialog to query user’s preferences for mass removing db items.

Initialize class.

Parameters
  • parent (SpineDBEditor) –

  • db_mngr (SpineDBManager) –

  • db_maps (DiffDatabaseMapping) – the dbs to select items from

  • stored_state (dict, Optional) – widget’s previous state

accept()[source]
class spinetoolbox.spine_db_editor.widgets.mass_select_items_dialogs.MassExportItemsDialog(parent, db_mngr, *db_maps, stored_state=None)[source]

Bases: MassSelectItemsDialog

A dialog to let users chose items for JSON export.

Parameters
  • parent (SpineDBEditor) –

  • db_mngr (SpineDBManager) –

  • db_maps (DiffDatabaseMapping) – the dbs to select items from

  • stored_state (dict, Optional) – widget’s previous state

_warn_checked_non_data_items = False[source]
data_submitted[source]
accept()[source]