filedialog
sleap.gui.dialogs.filedialog
¶
Wrappers for Qt File Dialogs.
The main improvement is logic which determines whether to use native or non- native file dialogs. Native dialogs are usually better but don't work correctly on (some?) Ubuntu systems.
Classes:
| Name | Description |
|---|---|
FileDialog |
Substitute for QFileDialog; see class methods for details. |
Functions:
| Name | Description |
|---|---|
os_specific_method |
Check if native dialog should be used and update kwargs based on OS. |
FileDialog
¶
Substitute for QFileDialog; see class methods for details.
Methods:
| Name | Description |
|---|---|
open |
Wrapper for |
openDir |
Wrapper for |
openMultiple |
Wrapper for |
save |
Wrapper for |
Source code in sleap/gui/dialogs/filedialog.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
open(*args, **kwargs)
classmethod
¶
Wrapper for QFileDialog.getOpenFileName()
Uses non-native file dialog if USE_NON_NATIVE_FILE env var set.
Passes along everything except empty "options" arg.
Source code in sleap/gui/dialogs/filedialog.py
51 52 53 54 55 56 57 58 59 60 61 | |
openDir(*args, **kwargs)
classmethod
¶
Wrapper for QFileDialog.getExistingDirectory()
Uses non-native file dialog if USE_NON_NATIVE_FILE env var set.
Passes along everything except empty "options" arg.
Source code in sleap/gui/dialogs/filedialog.py
112 113 114 115 116 117 118 119 120 121 | |
openMultiple(*args, **kwargs)
classmethod
¶
Wrapper for QFileDialog.getOpenFileNames()
Uses non-native file dialog if USE_NON_NATIVE_FILE env var set.
Passes along everything except empty "options" arg.
Source code in sleap/gui/dialogs/filedialog.py
63 64 65 66 67 68 69 70 71 72 73 | |
save(*args, **kwargs)
classmethod
¶
Wrapper for QFileDialog.getSaveFileName()
Uses non-native file dialog if USE_NON_NATIVE_FILE env var set.
Passes along everything except empty "options" arg.
Source code in sleap/gui/dialogs/filedialog.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
os_specific_method(func)
¶
Check if native dialog should be used and update kwargs based on OS.
Native Mac/Win file dialogs add file extension based on selected file type but non-native dialog (used for Linux) does not do this by default.
Source code in sleap/gui/dialogs/filedialog.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |