dialogs.*¶
Modal dialogs
- class dialogs.ApproveWarningDialog(parent)[source]¶
Bases:
object
Modal warning dialog for approving files to be evaled
The modal dialog is shown on accessing the property choice.
- Parameters:
parent (
QWidget
) – Parent widget, e.g. main window
- property choice: bool¶
User choice
Returns True iif the user approves leaving safe_mode. Returns False iif the user chooses to stay in safe_mode Returns None if the user chooses to abort the operation
- choices = <PyQt5.QtWidgets.QMessageBox.StandardButtons object>¶
- default_choice = 65536¶
- text = 'You are going to approve and trust a file that you have not created yourself. After proceeding, the file is executed.\n \nIt may harm your system as any program can. Please check all cells thoroughly before proceeding.\n \nProceed and sign this file as trusted?'¶
- title = 'Security warning'¶
- class dialogs.CellKeyDialog(parent, shape)[source]¶
Bases:
DataEntryDialog
Modal dialog for entering a cell key, i.e. row, column, table
- Parameters:
- class dialogs.ChartDialog(parent, key, size=(1000, 700))[source]¶
Bases:
QDialog
The chart dialog
- Parameters:
- class dialogs.CsvExportAreaDialog(parent, grid, title)[source]¶
Bases:
DataEntryDialog
Modal dialog for entering csv export area
Initially, this dialog is filled with the selection bounding box if present or with the visible area of <= 1 cell is selected.
- Parameters:
parent (
QWidget
) – Parent widget, e.g. main windowgrid (
QTableView
) – The main grid widgettitle (
str
) – Dialog title
- property _column_validator: QIntValidator¶
Returns column validator
- property _row_validator: QIntValidator¶
Returns row validator
- property _validator¶
Returns int validator for positive numbers
- property area: Union[SinglePageArea, MultiPageArea]¶
Executes the dialog and returns top, left, bottom, right
Returns None if the dialog is canceled.
- area_cls¶
alias of
SinglePageArea
- groupbox_title = 'Page area'¶
- labels = ['Top', 'Left', 'Bottom', 'Right']¶
- class dialogs.CsvExportDialog(parent, csv_area)[source]¶
Bases:
QDialog
Modal dialog for exporting csv files
- Parameters:
parent (
QWidget
) – Parent windowcsv_area (
SinglePageArea
) – Grid area to be exported
- create_buttonbox()[source]¶
Returns button box with Reset, Apply, Ok, Cancel
- Return type:
QDialogButtonBox
- maxrows = 10¶
- title = 'CSV export'¶
- class dialogs.CsvFileImportDialog(main_window)[source]¶
Bases:
FileDialogBase
Modal dialog for importing csv files
- Parameters:
main_window (
QMainWindow
) – Application main window
- filters_list = ['CSV file (*.*)']¶
- property suffix¶
Do not offer suffix for filepath
- title = 'Import data'¶
- class dialogs.CsvImportDialog(parent, filepath, digest_types=None)[source]¶
Bases:
QDialog
Modal dialog for importing csv files
- Parameters:
- title = 'CSV import'¶
- class dialogs.CsvParameterGroupBox(parent)[source]¶
Bases:
QGroupBox
QGroupBox that holds parameter widgets for the csv import dialog
- Parameters:
parent (
QWidget
) – Parent window
- adjust_csvdialect(dialect)[source]¶
Adjusts csv dialect from widget settings
Note that the dialect has two extra attributes encoding and hasheader
- default_delimiter = ','¶
- default_quotechar = '"'¶
- default_quoting = 'QUOTE_MINIMAL'¶
- delimiter_tooltip = 'A one-character string used to separate fields.'¶
- doublequote_tooltip = 'Controls how instances of quotechar appearing inside a field should be themselves be quoted. When True, the character is doubled. When False, the escapechar is used as a prefix to the quotechar.'¶
- encoding_widget_tooltip = 'CSV file encoding'¶
- escapechar_tooltip = 'A one-character string used by the writer to escape the delimiter if quoting is set to QUOTE_NONE and the quotechar if doublequote is False. On reading, the escapechar removes any special meaning from the following character.'¶
- hasheader_tooltip = 'Analyze the CSV file and treat the first row as strings if it appears to be a series of column headers.'¶
- keepheader_tooltip = 'Import header labels as str in the first row'¶
- quotechar_tooltip = 'A one-character string used to quote fields containing special characters, such as the delimiter or quotechar, or which contain new-line characters.'¶
- quoting_widget_tooltip = 'Controls when quotes should be generated by the writer and recognised by the reader.'¶
- quotings = ('QUOTE_ALL', 'QUOTE_MINIMAL', 'QUOTE_NONNUMERIC', 'QUOTE_NONE')¶
- set_csvdialect(dialect)[source]¶
Update widgets from given csv dialect
- Parameters:
dialect (
Dialect
) – Attributes class for csv reading and writing
- skipinitialspace_tooltip = 'When True, whitespace immediately following the delimiter is ignored.'¶
- title = 'Parameters'¶
- class dialogs.CsvTable(parent)[source]¶
Bases:
QTableView
Table for previewing csv file content
- Parameters:
parent (
QWidget
) – Parent window
- add_choice_row(length)[source]¶
Adds row with comboboxes for digest choice
- Parameters:
length (
int
) – Number of columns in row
- fill(filepath, dialect, digest_types=None)[source]¶
Fills the csv table with values from the csv file
- no_rows = 9¶
- class dialogs.DataEntryDialog(parent, title, labels, initial_data=None, groupbox_title=None, validators=None)[source]¶
Bases:
QDialog
Modal dialog for entering multiple values
- Parameters:
parent (
QWidget
) – Parent widget, e.g. main windowtitle (
str
) – Dialog titlelabels (
Sequence
[str
]) – Labels for the values in the dialoginitial_data (
Sequence
[str
]) – Initial values to be displayed in the dialogvalidators (
Sequence
[Union
[QValidator
,bool
,None
]]) – Validators for the editors of the dialog
len(initial_data), len(validators) and len(labels) must be equal
- class dialogs.DiscardChangesDialog(main_window)[source]¶
Bases:
object
Modal dialog that asks if the user wants to discard or save unsaved data
The modal dialog is shown on accessing the property choice.
- Parameters:
main_window (
QMainWindow
) – Application main window
- property choice: bool¶
User choice
Returns True if the user confirms in a user dialog that unsaved changes will be discarded if conformed. Returns False if the user chooses to save the unsaved data Returns None if the user chooses to abort the operation
- choices = <PyQt5.QtWidgets.QMessageBox.StandardButtons object>¶
- default_choice = 2048¶
- text = 'There are unsaved changes.\nDo you want to save?'¶
- title = 'Unsaved changes'¶
- class dialogs.DiscardDataDialog(main_window, text)[source]¶
Bases:
DiscardChangesDialog
Modal dialog that asks if the user wants to discard data
- Parameters:
main_window (
QMainWindow
) – Application main windowtext (
str
) – Message text
- choices = <PyQt5.QtWidgets.QMessageBox.StandardButtons object>¶
- default_choice = 4194304¶
- title = 'Data to be discarded'¶
- class dialogs.FileDialogBase(main_window)[source]¶
Bases:
object
Base class for modal file dialogs
The chosen filename is stored in the file_path attribute The chosen name filter is stored in the chosen_filter attribute If the dialog is aborted then both filepath and chosen_filter are None
_get_filepath must be overloaded
- Parameters:
main_window (
QMainWindow
) – Application main window
- file_path = None¶
- filters_list = ['Pyspread un-compressed (*.pysu)', 'Pyspread compressed (*.pys)']¶
- selected_filter = None¶
- title = 'Choose file'¶
- class dialogs.FileExportDialog(main_window, filters_list)[source]¶
Bases:
FileDialogBase
Modal dialog for exporting csv files
- Parameters:
- title = 'Export data'¶
- class dialogs.FileOpenDialog(main_window)[source]¶
Bases:
FileDialogBase
Modal dialog for opening a pyspread file
- Parameters:
main_window (
QMainWindow
) – Application main window
- title = 'Open'¶
- class dialogs.FileSaveDialog(main_window)[source]¶
Bases:
FileDialogBase
Modal dialog for saving a pyspread file
- Parameters:
main_window (
QMainWindow
) – Application main window
- title = 'Save'¶
- class dialogs.FindDialog(main_window)[source]¶
Bases:
QDialog
Find dialog that is launched from the main menu
- Parameters:
main_window (
QMainWindow
) – Application main window
- _create_widgets()[source]¶
Create find dialog widgets
- Parameters:
results_checkbox – Show find results checkbox
- class dialogs.FindDialogState(pos, case, results, more, backward, word, regex, start)[source]¶
Bases:
object
Dataclass for FindDialog state storage
-
pos:
QPoint
¶
-
pos:
- class dialogs.GridShapeDialog(parent, shape, title='Create a new Grid')[source]¶
Bases:
DataEntryDialog
Modal dialog for entering the number of rows, columns and tables
- Parameters:
- class dialogs.ImageFileOpenDialog(main_window)[source]¶
Bases:
FileDialogBase
Modal dialog for inserting an image
- Parameters:
main_window (
QMainWindow
) – Application main window
- img_format_string = '*.bmp *.cur *.ico *.jpeg *.jpg *.pbm *.pgm *.png *.ppm *.xbm *.xpm'¶
- img_format_strings = <generator object ImageFileOpenDialog.<genexpr>>¶
- img_formats = [PyQt5.QtCore.QByteArray(b'bmp'), PyQt5.QtCore.QByteArray(b'cur'), PyQt5.QtCore.QByteArray(b'ico'), PyQt5.QtCore.QByteArray(b'jpeg'), PyQt5.QtCore.QByteArray(b'jpg'), PyQt5.QtCore.QByteArray(b'pbm'), PyQt5.QtCore.QByteArray(b'pgm'), PyQt5.QtCore.QByteArray(b'png'), PyQt5.QtCore.QByteArray(b'ppm'), PyQt5.QtCore.QByteArray(b'xbm'), PyQt5.QtCore.QByteArray(b'xpm')]¶
- name_filter = 'Images (*.bmp *.cur *.ico *.jpeg *.jpg *.pbm *.pgm *.png *.ppm *.xbm *.xpm);;Scalable Vector Graphics (*.svg *.svgz)'¶
- title = 'Insert image'¶
- class dialogs.ManualDialog(parent)[source]¶
Bases:
TutorialDialog
Dialog for browsing the pyspread manual
- Parameters:
parent (
QWidget
) – Parent window
- size_hint = (1000, 800)¶
- title2path = {'Advanced topics': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/advanced_topics.md'), 'Concepts': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/basic_concepts.md'), 'Edit': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/edit_menu.md'), 'File': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/file_menu.md'), 'Format': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/format_menu.md'), 'Macro': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/macro_menu.md'), 'Overview': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/overview.md'), 'View': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/view_menu.md'), 'Workspace': PosixPath('/builds/pyspread/pyspread/pyspread/share/doc/manual/workspace.md')}¶
- window_title = 'pyspread manual'¶
- class dialogs.MultiPageArea(top, left, bottom, right, first, last)[source]¶
Bases:
SinglePageArea
Holds multi page area boundaries e.g. for printing
- class dialogs.PreferencesDialog(parent)[source]¶
Bases:
DataEntryDialog
Modal dialog for entering pyspread preferences
- Parameters:
parent (
QWidget
) – Parent widget, e.g. main window
- class dialogs.PrintAreaDialog(parent, grid, title)[source]¶
Bases:
CsvExportAreaDialog
Modal dialog for entering print area
Initially, this dialog is filled with the selection bounding box if present or with the visible area of <= 1 cell is selected. Initially, the current table is selected.
- Parameters:
parent (
QWidget
) – Parent widget, e.g. main windowgrid (
QTableView
) – The main grid widgettitle (
str
) – Dialog title
- property _table_validator: QIntValidator¶
Returns column validator
- area_cls¶
alias of
MultiPageArea
- labels = ['Top', 'Left', 'Bottom', 'Right', 'First table', 'Last table']¶
- class dialogs.PrintPreviewDialog(printer)[source]¶
Bases:
QPrintPreviewDialog
Adds Mouse wheel functionality
- Parameters:
printer (
QPrinter
) – Target printer
- class dialogs.ReplaceDialog(main_window)[source]¶
Bases:
FindDialog
Replace dialog that is launched from the main menu
- Parameters:
main_window (
QMainWindow
) – Application main window
- class dialogs.SinglePageArea(top, left, bottom, right)[source]¶
Bases:
object
Holds single page area boundaries e.g. for export
- class dialogs.SvgExportAreaDialog(parent, grid, title)[source]¶
Bases:
CsvExportAreaDialog
Modal dialog for entering svg export area
Initially, this dialog is filled with the selection bounding box if present or with the visible area of <= 1 cell is selected.
- Parameters:
parent (
QWidget
) – Parent widget, e.g. main windowgrid (
QTableView
) – The main grid widgettitle (
str
) – Dialog title
- groupbox_title = 'SVG export area'¶