def METHOD_NAME(self, prompt=False):
    if prompt:
        ret = QtWidgets.QMessageBox.warning(
            self,
            "The context settings have been modified.",
            "Your changes will be lost. Are you sure?",
            QtWidgets.QMessageBox.Ok,
            QtWidgets.QMessageBox.Cancel)
        if ret != QtWidgets.QMessageBox.Ok:
            return
    self._update_text()