diff --git a/file.py b/file.py index 3a92cb4..5891ce9 100644 --- a/file.py +++ b/file.py @@ -28,13 +28,16 @@ class FileActions: self.app.open_files[file_path] = File(self.app, file_path, file_path.split("/")[-1]) - def create_file(self, content: str=""): + def create_file(self, content: bin=b""): file_path, extension = QFileDialog.getSaveFileName( caption="New File", directory=self.app.utils.home_path, filter="Binary (*.bin);;Any (*)", ) + if file_path == "": + return + if "Binary" in extension: file_path = file_path.split(".")[0] + ".bin" # make sure it has the right extension