Fix file selector dialog (#764)

This commit is contained in:
samuel-w 2021-01-17 14:58:32 -06:00 committed by GitHub
parent fe93b361b2
commit 9af1eb5ba6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -111,12 +111,11 @@ def get_dict_from_list(dataDict, mapList):
def choose_file_dialog(parent, title, want_folder=True):
options = QFileDialog.Options()
if want_folder:
options |= QFileDialog.ShowDirsOnly
dialog = QFileDialog(parent, title, os.path.expanduser('~'), options=options)
dialog = QFileDialog(parent, title, os.path.expanduser('~'))
dialog.setFileMode(QFileDialog.Directory if want_folder else QFileDialog.ExistingFiles)
dialog.setParent(parent, QtCore.Qt.Sheet)
if want_folder:
dialog.setOption(QFileDialog.ShowDirsOnly)
return dialog