-
Notifications
You must be signed in to change notification settings - Fork 0
progress_dialog
version: v1.0.2
A cancellable, optionally nested progress dialog, reporting on a compatible process ran by a QObject-subclass on a separate thread.
def icon_file_path() -> strReturns the path for the icon file to be used in the dialogs.
def set_icon_file_path(new_path: str = '') -> NoneSets the path for the icon file to be used in the dialogs.
Parameters:
- new_path: The new path to set for the windows. The default is an empty string, leading to the default icon.
An example, progress dialog compatible class. Worker objects of simple (not nested) PDs do not need sub-signals.
Signals:
- sig_new_process_unit: A signal carrying a string identifier of the new main process unit.
- sig_new_subprocess_unit: A signal carrying a string identifier of the new subprocess unit.
- sig_main_progress: A signal carrying the progress (integer percentage) of the main process.
- sig_sub_progress: A signal carrying the progress (integer percentage) of the subprocess.
- sig_finished: The signal emitted when the process finishes.
- sig_start: The signal that starts the process execution.
- sig_cancel: A signal for external cancellation of the process execution.
def __init__(self, nested=False) -> NoneInitializer for the class.
Parameters:
- nested: A flag marking whether the progress dialog should be nested. The default is False.
@property
def nested(self) -> boolReturns whether the associated progress dialog is nested.
@Slot()
def _process(self) -> NoneThe slot connected to the start signal. Emits sig_finished when the process finishes.
@Slot()
def _cancel_process(self) -> NoneThe slot connected to the cancel signal. Needs the button press event to be processed beforehand.
A window reporting on the progress of a process running on a separate thread.
def __init__(self, worker, title, widget_theme=None) -> NoneInitializer for the class.
Parameters:
- worker: A worker subclassing QObject, handling a process.
- title: The title to set for the window.
- widget_theme: A widget theme from the 'theme' module. The default is None, for the Qt-default theme.
def _setup_ui(self) -> NoneSets up the user interface: GUI objects and layouts.
def _setup_connections(self) -> NoneSets up the connections of the GUI objects.
@property
def theme(self) -> ThemeParametersReturns the parameters of the theme set for this object.
@theme.setter
def theme(self, new_theme: ThemeParameters) -> NoneSets a new set of parameters defining a theme to this object.
def _create_worker_thread(self) -> NoneCreates a new thread and moves the worker there.
def _quit_thread(self) -> NoneCloses the thread after the worker has finished.
def _cancel_process(self) -> NoneAsks for confirmation to cancel the process.
A dialog reporting on the progress of a process running on a separate thread.
def __init__(self, worker: QObject, title="Progress report", widget_theme=None) -> NoneInitializer for the class.
Parameters:
- worker: A worker subclassing QObject, handling a process.
- title: The title to set for the dialog. The default is "Progress report".
- widget_theme: A widget theme from the 'theme' module. The default is None, for the Qt-default theme.
A dock widget reporting on the progress of a process running on a separate thread.
def __init__(self, worker: QObject, title="Progress report", widget_theme=None) -> NoneInitializer for the class.
Parameters:
- worker: A worker subclassing QObject, handling a process.
- title: The title to set for the dialog. The default is "Progress report".
- widget_theme: A widget theme from the 'theme' module. The default is None, for the Qt-default theme.