From f4560692e7c0b4162787725ce69cda2191801643 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Mon, 22 Apr 2024 15:03:07 +0200 Subject: [PATCH] Fixed calls to QFileDialog options The code is invalid in PyQt6 and also just was supposed to set the standard options being set anyway. --- picard/script/serializer.py | 6 ++---- picard/ui/options/maintenance.py | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/picard/script/serializer.py b/picard/script/serializer.py index e3cc7bab9e..b5b048f4b0 100644 --- a/picard/script/serializer.py +++ b/picard/script/serializer.py @@ -212,8 +212,7 @@ def export_script(self, parent=None): dialog_title = _("Export Script File") dialog_file_types = self._get_dialog_filetypes() - options = QtWidgets.QFileDialog.Options() - filename, file_type = QtWidgets.QFileDialog.getSaveFileName(parent, dialog_title, default_path, dialog_file_types, options=options) + filename, file_type = QtWidgets.QFileDialog.getSaveFileName(parent, dialog_title, default_path, dialog_file_types) if not filename: return False # Fix issue where Qt may set the extension twice @@ -250,8 +249,7 @@ def import_script(cls, parent=None): dialog_title = _("Import Script File") dialog_file_types = cls._get_dialog_filetypes() default_script_directory = os.path.normpath(QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.DocumentsLocation)) - options = QtWidgets.QFileDialog.Options() - filename, file_type = QtWidgets.QFileDialog.getOpenFileName(parent, dialog_title, default_script_directory, dialog_file_types, options=options) + filename, file_type = QtWidgets.QFileDialog.getOpenFileName(parent, dialog_title, default_script_directory, dialog_file_types) if not filename: return None log.debug("Importing script file: %s", filename) diff --git a/picard/ui/options/maintenance.py b/picard/ui/options/maintenance.py index 3986ffafb5..b15b3dd4dd 100644 --- a/picard/ui/options/maintenance.py +++ b/picard/ui/options/maintenance.py @@ -204,8 +204,7 @@ def save_backup(self): dialog_title = _("Backup Configuration File") dialog_file_types = self._get_dialog_filetypes(ext) - options = QtWidgets.QFileDialog.Options() - filename, file_type = QtWidgets.QFileDialog.getSaveFileName(self, dialog_title, default_path, dialog_file_types, options=options) + filename, file_type = QtWidgets.QFileDialog.getSaveFileName(self, dialog_title, default_path, dialog_file_types) if not filename: return # Fix issue where Qt may set the extension twice @@ -249,8 +248,7 @@ def load_backup(self): ext = path.splitext(filename)[1] dialog_file_types = self._get_dialog_filetypes(ext) directory = path.normpath(QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.StandardLocation.DocumentsLocation)) - options = QtWidgets.QFileDialog.Options() - filename, file_type = QtWidgets.QFileDialog.getOpenFileName(self, dialog_title, directory, dialog_file_types, options=options) + filename, file_type = QtWidgets.QFileDialog.getOpenFileName(self, dialog_title, directory, dialog_file_types) if not filename: return log.warning("Loading configuration from %s", filename)