def METHOD_NAME(self) -> None:
    if self._dialog:
        self._dialog.reject()
    else:
        self._dialog = CardInfoDialog(
            None,
            self.mw,
            self._card,
            self._on_close,
            self.geometry_key,
            self.window_title,
        )