Skip to content

Validation Progress Dialog

Dialog for showing the progress of the validation process.

ValidationProgressDialog

ValidationProgressDialog(submit_result, parent=None, hide_details_button=False, close_on_completion=False, cancel_mode=False)

Bases: QDialog, WidgetUi

Dialog for showing the progress of the validation process.

Source code in src/cplus_plugin/gui/validation/progress_dialog.py
def __init__(
    self,
    submit_result: SubmitResult,
    parent=None,
    hide_details_button=False,
    close_on_completion=False,
    cancel_mode=False,
):
    super().__init__(parent)
    self.setupUi(self)

    QgsGui.enableAutoGeometryRestore(self)

    self._submit_result = submit_result
    self._feedback = self._submit_result.feedback
    self._feedback.rule_validation_started.connect(self._on_rule_validation_started)
    self._feedback.progressChanged.connect(self._on_progress_changed)
    self._feedback.validation_completed.connect(self._on_validation_completed)

    self._close_on_completion = close_on_completion

    self.btn_show_details = self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok)
    if hide_details_button:
        self.btn_show_details.setVisible(False)

    self.btn_close = self.buttonBox.button(QtWidgets.QDialogButtonBox.Close)
    if cancel_mode:
        self.btn_close.setText(tr("Cancel"))

    self._initialize_ui()

feedback property

feedback

Gets the feedback object used in the progress dialog.

Returns:

Type Description
ValidationFeedback

Feedback objects used in the progress dialog.

hide_results_button

hide_results_button(hide)

Hides or shows the button for showing the validation inspector.

By default, the button is visible.

Parameters:

Name Type Description Default
hide bool

True to hide the 'Show Results' button else False to make it visible again.

required
Source code in src/cplus_plugin/gui/validation/progress_dialog.py
def hide_results_button(self, hide: bool):
    """Hides or shows the button for showing the validation inspector.

    By default, the button is visible.

    :param hide: True to hide the 'Show Results' button else False
    to make it visible again.
    :type hide: bool
    """
    if hide and self.btn_show_details.isVisible():
        self.btn_show_details.setVisible(False)

    elif not hide and not self.btn_show_details.isVisible():
        self.btn_show_details.setVisible(True)

on_closed

on_closed()

Slot raised when the Close button has been clicked.

Source code in src/cplus_plugin/gui/validation/progress_dialog.py
def on_closed(self):
    """Slot raised when the Close button has been clicked."""
    self.dialog_closed.emit()

Last update: October 2, 2024
Back to top