Bread_Editor/utils.py
EKNr1 2797c3ca44 File opening working.
(Only the popup that sets the variable.)
2024-11-17 18:54:51 +01:00

21 lines
580 B
Python

#!/usr/bin/python3
from pathlib import Path
from PyQt6.QtWidgets import QFileDialog
class Utils:
def __init__(self, app):
self.app = app
self.home_path = str(Path.home())
def open_file(self):
dialog = QFileDialog(self.app.QTMainWindow)
dialog.setDirectory(self.home_path)
dialog.setFileMode(QFileDialog.FileMode.ExistingFiles)
dialog.setNameFilters(["Binary (*.bin)", "Any (*)"])
dialog.setViewMode(QFileDialog.ViewMode.List)
if dialog.exec():
self.app.open_files += dialog.selectedFiles()