mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
keyword for file_dialog mode selection
This commit is contained in:
1 parent
1bc9b9fc86
commit
47ac8e8bef
5 files changed
+13
-13
No files matched your search
@@ -85,7 +85,7 @@ class WindowToolKit(object):
|
||||
|
||||
return header, values
|
||||
|
||||
def file_dialog(self, select_file=None,
|
||||
def file_dialog(self, select_file="ExistingFile",
|
||||
callback=lambda x: None,
|
||||
directory=None,
|
||||
default_suffix=None,
|
||||
@@ -107,11 +107,10 @@ class WindowToolKit(object):
|
||||
|
||||
dialog = QFileDialog(self, options=options)
|
||||
|
||||
if select_file is not None:
|
||||
if select_file:
|
||||
mode = QFileDialog.FileMode.ExistingFile
|
||||
else:
|
||||
mode = QFileDialog.FileMode.Directory
|
||||
if select_file == "Existing_file":
|
||||
mode = QFileDialog.FileMode.ExistingFile
|
||||
elif select_file == "Directory":
|
||||
mode = QFileDialog.FileMode.Directory
|
||||
else:
|
||||
mode = QFileDialog.FileMode.AnyFile
|
||||
|
||||
@@ -119,7 +118,7 @@ class WindowToolKit(object):
|
||||
if directory is not None:
|
||||
dialog.setDirectory(directory)
|
||||
|
||||
if select_file is not False:
|
||||
if select_file != "Directory":
|
||||
if default_suffix is not None:
|
||||
dialog.setDefaultSuffix(default_suffix)
|
||||
|
||||
|
||||
Reference in new issue
Block a user