UI Dialogs
biopro_sdk.plugin.dialogs
Dialog utilities for BioPro SDK.
Provides convenient wrappers for common PyQt6 file dialogs and message boxes that work with the current theme.
ask_ok_cancel(parent=None, title='', message='')
Show OK/Cancel dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
''
|
message
|
str
|
Dialog message |
''
|
Returns:
| Type | Description |
|---|---|
bool
|
True if user clicks OK, False otherwise |
Source code in src/biopro_sdk/plugin/dialogs.py
ask_yes_no(parent=None, title='', message='')
Show yes/no question dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
''
|
message
|
str
|
Dialog message |
''
|
Returns:
| Type | Description |
|---|---|
bool
|
True if user clicks Yes, False otherwise |
Source code in src/biopro_sdk/plugin/dialogs.py
get_directory(parent=None, title='Select Directory', start_dir='')
Show directory selection dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
'Select Directory'
|
start_dir
|
str
|
Initial directory |
''
|
Returns:
| Type | Description |
|---|---|
str | None
|
Selected directory path or None if cancelled |
Source code in src/biopro_sdk/plugin/dialogs.py
get_double(parent=None, title='', label='', value=0.0, min_val=-999.99, max_val=999.99, decimals=2)
Show float input dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
''
|
label
|
str
|
Label text |
''
|
value
|
float
|
Default value |
0.0
|
min_val
|
float
|
Minimum allowed value |
-999.99
|
max_val
|
float
|
Maximum allowed value |
999.99
|
decimals
|
int
|
Number of decimal places |
2
|
Returns:
| Type | Description |
|---|---|
float | None
|
User input or None if cancelled |
Source code in src/biopro_sdk/plugin/dialogs.py
get_image_path(parent=None, title='Select Image', start_dir='')
Show file dialog to select an image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
'Select Image'
|
start_dir
|
str
|
Initial directory |
''
|
Returns:
| Type | Description |
|---|---|
str | None
|
Selected file path or None if cancelled |
Source code in src/biopro_sdk/plugin/dialogs.py
get_image_paths(parent=None, title='Select Images', start_dir='')
Show file dialog to select multiple images.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
'Select Images'
|
start_dir
|
str
|
Initial directory |
''
|
Returns:
| Type | Description |
|---|---|
list[str]
|
List of selected file paths |
Source code in src/biopro_sdk/plugin/dialogs.py
get_number(parent=None, title='', label='', value=0, min_val=-999999, max_val=999999)
Show integer input dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
''
|
label
|
str
|
Label text |
''
|
value
|
int
|
Default value |
0
|
min_val
|
int
|
Minimum allowed value |
-999999
|
max_val
|
int
|
Maximum allowed value |
999999
|
Returns:
| Type | Description |
|---|---|
int | None
|
User input or None if cancelled |
Source code in src/biopro_sdk/plugin/dialogs.py
get_save_path(parent=None, title='Save As', start_dir='', file_filter='')
Show save file dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
'Save As'
|
start_dir
|
str
|
Initial directory |
''
|
file_filter
|
str
|
Qt file filter string (e.g. "CSV Files (.csv);;All Files ()") |
''
|
Returns:
| Type | Description |
|---|---|
str | None
|
Selected file path or None if cancelled |
Source code in src/biopro_sdk/plugin/dialogs.py
get_text(parent=None, title='', label='', default='')
Show text input dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
''
|
label
|
str
|
Label text |
''
|
default
|
str
|
Default value in text field |
''
|
Returns:
| Type | Description |
|---|---|
str | None
|
User input or None if cancelled |
Source code in src/biopro_sdk/plugin/dialogs.py
import_assets_workflow(parent, project_manager, file_paths)
Orchestrates the multi-file import workflow as requested by the user.
- If multiple files, asks if they should be grouped in a subdirectory.
- Asks once for 'Copy to Workspace' for the entire batch.
- Executes the batch import via ProjectManager.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of file hashes for the imported assets. |
Source code in src/biopro_sdk/plugin/dialogs.py
show_error(parent=None, title='Error', message='')
Show error dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
'Error'
|
message
|
str
|
Dialog message |
''
|
Source code in src/biopro_sdk/plugin/dialogs.py
show_info(parent=None, title='Information', message='')
Show information dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
'Information'
|
message
|
str
|
Dialog message |
''
|
Source code in src/biopro_sdk/plugin/dialogs.py
show_warning(parent=None, title='Warning', message='')
Show warning dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
Parent widget |
None
|
|
title
|
str
|
Dialog title |
'Warning'
|
message
|
str
|
Dialog message |
''
|