spinetoolbox.widgets.import_widget

ImportDialog class.

author:
  1. Vennström (VTT)
date:

1.6.2019

Module Contents

class spinetoolbox.widgets.import_widget.ImportDialog(settings, parent)[source]

Bases: PySide2.QtWidgets.QDialog

A widget for importing data into a Spine db. Currently used by DataStoreForm. It embeds three widgets that alternate depending on user’s actions: - select_widget is a QWidget for selecting the source data type (CSV, Excel, etc.) - _import_preview is an ImportPreviewWidget for defining Mappings to associate with the source data - _error_widget is an ImportErrorWidget to show errors from import operations

Parameters:
  • settings (QSettings) – settings for storing/restoring window state
  • parent (QWidget) – parent widget
_SETTINGS_GROUP_NAME = importDialog[source]
mapped_data[source]
mapping_errors[source]
connector_selected(self, selection)[source]
set_ok_button_availability(self)[source]
import_data(self, data, errors)[source]
data_ready(self, data, errors)[source]
ok_clicked(self)[source]
cancel_clicked(self)[source]
back_clicked(self)[source]
launch_import_preview(self)[source]
_handle_failed_connection(self, msg)[source]

Handle failed connection, show error message and select widget

Parameters:{str} -- str with message of reason for failed connection. (msg) –
set_preview_as_main_widget(self)[source]
set_error_widget_as_main_widget(self)[source]
_restore_preview_ui(self)[source]

Restore UI state from previous session.

closeEvent(self, event)[source]

Stores window’s settings and accepts the event.