def _show_closing_warnings(self) -> bool:
        """Show any closing warnings and return True if the user chose to quit anyway."""

        warnings: Set[str] = set()
        for cb in self.closing_warning_callbacks:
            if warning := cb():
                warnings.add(warning)

        for warning in list(warnings)[:3]:
            warning = ''.join([
                _("Are you sure you want to close Electrum?"),
                '\n\n',
                _("An ongoing operation requires you to stay online."),
                '\n',
                warning
            ])
            result = self.question(
                msg=warning,
                icon=QMessageBox.Icon.Warning,
                title=_("Warning"),
            )
            if not result:
                break
        else:
            # user chose to cancel all warnings or there were no warnings
            return True
        return False
Show any closing warnings and return True if the user chose to quit anyway.
electrum/gui/qt/main_window.py