From 0f782f6662fcbbedeb14d530c5d005b32bebb0db Mon Sep 17 00:00:00 2001 From: Sean Krueger Date: Tue, 3 Sep 2024 20:22:22 -0500 Subject: [PATCH] fix: Ignore dialog with X button --- tagstudio/src/qt/modals/ffmpeg_checker.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tagstudio/src/qt/modals/ffmpeg_checker.py b/tagstudio/src/qt/modals/ffmpeg_checker.py index 1b4982322..8bd344c2a 100644 --- a/tagstudio/src/qt/modals/ffmpeg_checker.py +++ b/tagstudio/src/qt/modals/ffmpeg_checker.py @@ -21,8 +21,12 @@ def __init__(self): self.setIcon(QMessageBox.Warning) self.setText("Warning: Could not find FFmpeg installation") - self.setStandardButtons(QMessageBox.Help | QMessageBox.Ignore) + self.setStandardButtons( + QMessageBox.Help | QMessageBox.Ignore | QMessageBox.Cancel + ) self.setDefaultButton(QMessageBox.Ignore) + # Enables the cancel button but hides it to allow for click X to close dialog + self.button(QMessageBox.Cancel).hide() # Blocks other application interactions until resolved self.setWindowModality(Qt.ApplicationModal) @@ -57,6 +61,6 @@ def show_warning(self): # Shows the dialog selection = self.exec() - # Selection will either be QMessageBox.Help or QMessageBox.Ignore + # Selection will either be QMessageBox.Help or (QMessageBox.Ignore | QMessageBox.Cancel) which can be ignored if selection == QMessageBox.Help: QDesktopServices.openUrl(QUrl(self.help_url))