Skip to content

Do not show "data loss" dialog multiple times #3

Description

@probonopd

Maybe the easiest is to check for windows with the same title like this:

    if not normalized_drive.startswith("/tmp") and not os.path.basename(normalized_drive).startswith("."):
        dialog_title = f"Warning - {normalized_drive}"
        if not is_dialog_open(dialog_title):
            QtWidgets.QMessageBox.critical(
                None, dialog_title,
                f"Volume {normalized_drive} was removed without being ejected first.\n\n"
                "To prevent data loss, always eject volumes before removal."
            )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions