Skip to content

Commit

Permalink
Fixed calls to QFileDialog options
Browse files Browse the repository at this point in the history
The code is invalid in PyQt6 and also just was supposed to set the
standard options being set anyway.
  • Loading branch information
phw committed Apr 22, 2024
1 parent d592358 commit f456069
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions picard/script/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions picard/ui/options/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f456069

Please sign in to comment.