diff --git a/file.py b/file.py index 60c89e1..073db5a 100644 --- a/file.py +++ b/file.py @@ -1,7 +1,7 @@ #!/usr/bin/python3 import os.path -from PyQt6.QtWidgets import QFileDialog, QTabWidget +from PyQt6.QtWidgets import QFileDialog from editor import BitEditor MAX_FILE_SIZE = 262144 # 2^18 @@ -22,7 +22,10 @@ class FileActions: if dialog.exec(): self.open_multiple_files(dialog.selectedFiles()) - def create_file(self, content: bin=b""): + def create_file(self, content: bytes=(0).to_bytes(1)): + # open a dialog where the user can choose a new filepath and create an empty file at that path + # bytes=(0).to_bytes(1) creates a byte with only zeros in it + file_path, extension = QFileDialog.getSaveFileName( caption="New File", directory=self.app.utils.home_path,