From 6ef4914333724cd52ae3a9206f0dd7b8922a1459 Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Fri, 27 Oct 2023 19:39:03 +0530 Subject: [PATCH] Automatic file extension --- window.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/window.py b/window.py index 0b0924c..1a80c1e 100644 --- a/window.py +++ b/window.py @@ -81,6 +81,8 @@ class MainWindow(QMainWindow): try: if not os.path.exists(self.current_file.file): filename=QFileDialog.getSaveFileName(self, "Save File", suggest, "Prescriptions (*.mpaz);; All Files (*)")[0] + if(not filename.endswith(".mpaz")): + filename=filename+".mpaz" self.current_file.set_file(filename) for i in range(self.input_attachment.count()): self.current_file.copy(self.input_attachment.item(i).text()) -- 2.39.5