From e840c7a18cc488c9e5a813c9232d2d19582a1717 Mon Sep 17 00:00:00 2001 From: deeplow Date: Wed, 1 Mar 2023 12:49:46 +0000 Subject: [PATCH] Fix "Choose..." dialog not opening on Qt6 When clicking on the "Choose..." button nothing would happen visually and it would show the error: Traceback (most recent call last): File "/home/user/dangerzone/dangerzone/gui/main_window.py", line 614, in select_output_directory dialog.setFileMode(QtWidgets.QFileDialog.DirectoryOnly) According to the PySide docs, QFileDialog.DirectoryOnly has been deprecated in Qt4.6 [1]. This was not an issue probably on PySide2 because it must have used an earlier Qt version. Fixes #360 [1]: https://doc.qt.io/qtforpython-5/PySide2/QtWidgets/QFileDialog.html#PySide2.QtWidgets.PySide2.QtWidgets.QFileDialog.FileMode --- dangerzone/gui/main_window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dangerzone/gui/main_window.py b/dangerzone/gui/main_window.py index 2fafeed..4844911 100644 --- a/dangerzone/gui/main_window.py +++ b/dangerzone/gui/main_window.py @@ -610,8 +610,8 @@ class SettingsWidget(QtWidgets.QWidget): # open the directory where the user last saved it dialog.setDirectory(self.dangerzone.output_dir) - # allow only the selection of directories - dialog.setFileMode(QtWidgets.QFileDialog.DirectoryOnly) + # Allow only the selection of directories + dialog.setFileMode(QtWidgets.QFileDialog.Directory) dialog.setOption(QtWidgets.QFileDialog.ShowDirsOnly, True) if dialog.exec_() == QtWidgets.QFileDialog.Accepted: