]> Softwares of Agnibho - medscript.git/commitdiff
Added option to select templates
authorAgnibho Mondal <mondal@agnibho.com>
Sat, 2 Sep 2023 21:11:36 +0000 (02:41 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Sat, 2 Sep 2023 21:11:36 +0000 (02:41 +0530)
window.py

index f22ade8190691e0c29fa66714e1df8f9f42e3f12..062811dc2ae28c9e9d4c4018478e4556e01c9877 100644 (file)
--- a/window.py
+++ b/window.py
@@ -55,6 +55,7 @@ class MainWindow(QMainWindow):
                 self.current_file.copy(self.input_attachment.item(i).text())
             self.update_instance()
             self.prescription.write_to(os.path.join(self.current_file.directory.name, "prescription.json"))
+            config["template"]=os.path.join(config["template_directory"], self.input_template.currentText())
             self.current_file.save()
             self.load_interface_from_instance()
             self.save_state=md5(self.prescription.get_json().encode()).hexdigest()
@@ -301,10 +302,14 @@ class MainWindow(QMainWindow):
         toolbar.addAction(action_save2)
         toolbar.addAction(action_refresh2)
         toolbar.addAction(action_render2)
+        toolbar.addSeparator()
+        self.input_template=QComboBox(self)
+        self.input_template.addItems(os.listdir(config["template_directory"]))
+        toolbar.addWidget(self.input_template)
         spacer=QWidget(self)
         spacer.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
         toolbar.addWidget(spacer)
-        self.label_prescriber=QLabel()
+        self.label_prescriber=QLabel(self)
         toolbar.addWidget(self.label_prescriber)
         self.addToolBar(toolbar)