mirror of https://github.com/borgbase/vorta
Fix file selector dialog (#764)
This commit is contained in:
parent
fe93b361b2
commit
9af1eb5ba6
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue