Progress Dialog#

Progress dialog for showing operation progress.

This module provides a progress dialog that can be used to show progress for long-running operations like folder scanning.

ProgressDialog(*args, **kwargs)

Progress dialog for showing operation progress.

class mdaviz.progress_dialog.AsyncProgressDialog(*args: Any, **kwargs: Any)[source]#

Asynchronous progress dialog that can be updated from background threads.

This dialog uses Qt’s signal/slot mechanism to safely update the UI from background threads.

_operation_completed_slot() None[source]#

Slot for operation completion.

_operation_failed_slot(error_message: str) None[source]#

Slot for operation failure.

_set_message_slot(message: str) None[source]#

Slot for thread-safe message updates.

_update_progress_slot(current: int, total: int, message: str) None[source]#

Slot for thread-safe progress updates.

complete_async() None[source]#

Mark operation as completed asynchronously.

fail_async(error_message: str) None[source]#

Mark operation as failed asynchronously.

Parameters:

error_message (str): Error message

message_updated#

alias of str

operation_failed#

alias of str

progress_updated#

alias of int

set_message_async(message: str) None[source]#

Set message asynchronously (thread-safe).

Parameters:

message (str): Progress message

update_progress_async(current: int, total: int, message: str = '') None[source]#

Update progress asynchronously (thread-safe).

Parameters:

current (int): Current progress value total (int): Total progress value message (str, optional): Progress message

class mdaviz.progress_dialog.ProgressDialog(*args: Any, **kwargs: Any)[source]#

Progress dialog for showing operation progress.

This dialog provides a user-friendly way to show progress for long-running operations and allows users to cancel the operation.

Attributes:

auto_close (bool): Whether to automatically close when complete auto_reset (bool): Whether to automatically reset when complete

_on_canceled() None[source]#

Handle cancel button click.

is_canceled() bool[source]#

Check if the operation was canceled.

reset_cancel_state() None[source]#

Reset the cancel state.

set_cancel_callback(callback: Callable[[], None]) None[source]#

Set a callback function to be called when the user cancels.

Parameters:

callback (callable): Function to call when canceled

set_message(message: str) None[source]#

Set the progress message.

Parameters:

message (str): Progress message

update_progress(current: int, total: int, message: str = '') None[source]#

Update the progress display.

Parameters:

current (int): Current progress value total (int): Total progress value message (str, optional): Progress message