Toolbox for analyzing and editing pkg application files for psp,ps3, ps4 and ps5, includes the most useful functions you might need.
| 1 | from PyQt5.QtWidgets import QFileDialog |
| 2 | |
| 3 | class DialogHelper: |
| 4 | @staticmethod |
| 5 | def show_folder_browser_dialog(): |
| 6 | dialog = QFileDialog() |
| 7 | dialog.setFileMode(QFileDialog.Directory) |
| 8 | if dialog.exec_(): |
| 9 | return dialog.selectedFiles()[0] |
| 10 | return None |
| 11 | |
| 12 | @staticmethod |
| 13 | def show_save_file_dialog(title, filter): |
| 14 | dialog = QFileDialog() |
| 15 | dialog.setAcceptMode(QFileDialog.AcceptSave) |
| 16 | dialog.setNameFilter(filter) |
| 17 | dialog.setWindowTitle(title) |
| 18 | if dialog.exec_(): |
| 19 | return dialog.selectedFiles()[0] |
| 20 | return None |