]> Softwares of Agnibho - medscript.git/commitdiff
Bugfix: preset selection (added pushbuttons)
authorAgnibho Mondal <mondal@agnibho.com>
Sun, 3 Sep 2023 17:40:54 +0000 (23:10 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Sun, 3 Sep 2023 17:40:54 +0000 (23:10 +0530)
window.py

index 8449a2ba4a17fc6e6303ec88d711b0ed62a0fb13..1ce90d8c46e54e9d7aea133566e103f67e1a2bd8 100644 (file)
--- a/window.py
+++ b/window.py
@@ -366,6 +366,7 @@ class MainWindow(QMainWindow):
 
         tab_note=QWidget(self)
         layout_note=QVBoxLayout(tab_note)
+        layout_note2=QHBoxLayout()
         label_note=QLabel("Clinical Notes")
         self.input_note_preset=QComboBox(self)
         self.input_note_preset.addItems(self.preset_note.data.keys())
@@ -374,14 +375,18 @@ class MainWindow(QMainWindow):
         self.input_note_preset.completer().setCompletionMode(QCompleter.CompletionMode.PopupCompletion)
         self.input_note_preset.completer().setFilterMode(Qt.MatchFlag.MatchContains)
         self.input_note_preset.setPlaceholderText("Select a preset")
-        self.input_note_preset.currentIndexChanged.connect(self.insert_preset_note)
+        input_note_preset_btn=QPushButton("Insert")
+        input_note_preset_btn.clicked.connect(self.insert_preset_note)
+        layout_note2.addWidget(self.input_note_preset, 2)
+        layout_note2.addWidget(input_note_preset_btn, 1)
         self.input_note=QTextEdit(self)
         layout_note.addWidget(label_note)
-        layout_note.addWidget(self.input_note_preset)
+        layout_note.addLayout(layout_note2)
         layout_note.addWidget(self.input_note)
 
         tab_report=QWidget(self)
         layout_report=QVBoxLayout(tab_report)
+        layout_report2=QHBoxLayout()
         label_report=QLabel("Available Reports")
         self.input_report_preset=QComboBox(self)
         self.input_report_preset.addItems(self.preset_report.data.keys())
@@ -390,14 +395,18 @@ class MainWindow(QMainWindow):
         self.input_report_preset.completer().setCompletionMode(QCompleter.CompletionMode.PopupCompletion)
         self.input_report_preset.completer().setFilterMode(Qt.MatchFlag.MatchContains)
         self.input_report_preset.setPlaceholderText("Select a preset")
-        self.input_report_preset.currentIndexChanged.connect(self.insert_preset_report)
+        input_report_preset_btn=QPushButton("Insert")
+        input_report_preset_btn.clicked.connect(self.insert_preset_report)
+        layout_report2.addWidget(self.input_report_preset, 2)
+        layout_report2.addWidget(input_report_preset_btn, 1)
         self.input_report=QTextEdit(self)
         layout_report.addWidget(label_report)
-        layout_report.addWidget(self.input_report_preset)
+        layout_report.addLayout(layout_report2)
         layout_report.addWidget(self.input_report)
 
         tab_investigation=QWidget(self)
         layout_investigation=QVBoxLayout(tab_investigation)
+        layout_investigation2=QHBoxLayout()
         label_investigation=QLabel("Recommended Investigations")
         self.input_investigation_preset=QComboBox(self)
         self.input_investigation_preset.addItems(self.preset_investigation.data.keys())
@@ -406,14 +415,18 @@ class MainWindow(QMainWindow):
         self.input_investigation_preset.completer().setCompletionMode(QCompleter.CompletionMode.PopupCompletion)
         self.input_investigation_preset.completer().setFilterMode(Qt.MatchFlag.MatchContains)
         self.input_investigation_preset.setPlaceholderText("Select a preset")
-        self.input_investigation_preset.currentIndexChanged.connect(self.insert_preset_investigation)
+        input_investigation_preset_btn=QPushButton("Insert")
+        input_investigation_preset_btn.clicked.connect(self.insert_preset_investigation)
+        layout_investigation2.addWidget(self.input_investigation_preset, 2)
+        layout_investigation2.addWidget(input_investigation_preset_btn, 1)
         self.input_investigation=QTextEdit(self)
         layout_investigation.addWidget(label_investigation)
-        layout_investigation.addWidget(self.input_investigation_preset)
+        layout_investigation.addLayout(layout_investigation2)
         layout_investigation.addWidget(self.input_investigation)
 
         tab_medication=QWidget(self)
         layout_medication=QVBoxLayout(tab_medication)
+        layout_medication2=QHBoxLayout()
         label_medication=QLabel("Medication Advice")
         self.input_medication_preset=QComboBox(self)
         self.input_medication_preset.addItems(self.preset_medication.data.keys())
@@ -422,14 +435,18 @@ class MainWindow(QMainWindow):
         self.input_medication_preset.completer().setCompletionMode(QCompleter.CompletionMode.PopupCompletion)
         self.input_medication_preset.completer().setFilterMode(Qt.MatchFlag.MatchContains)
         self.input_medication_preset.setPlaceholderText("Select a preset")
-        self.input_medication_preset.currentIndexChanged.connect(self.insert_preset_medication)
+        input_medication_preset_btn=QPushButton("Insert")
+        input_medication_preset_btn.clicked.connect(self.insert_preset_medication)
+        layout_medication2.addWidget(self.input_medication_preset, 2)
+        layout_medication2.addWidget(input_medication_preset_btn, 1)
         self.input_medication=QTextEdit(self)
         layout_medication.addWidget(label_medication)
-        layout_medication.addWidget(self.input_medication_preset)
+        layout_medication.addLayout(layout_medication2)
         layout_medication.addWidget(self.input_medication)
 
         tab_advice=QWidget(self)
         layout_advice=QVBoxLayout(tab_advice)
+        layout_advice2=QHBoxLayout()
         label_advice=QLabel("Additional Advice")
         self.input_advice_preset=QComboBox(self)
         self.input_advice_preset.addItems(self.preset_advice.data.keys())
@@ -438,10 +455,13 @@ class MainWindow(QMainWindow):
         self.input_advice_preset.completer().setCompletionMode(QCompleter.CompletionMode.PopupCompletion)
         self.input_advice_preset.completer().setFilterMode(Qt.MatchFlag.MatchContains)
         self.input_advice_preset.setPlaceholderText("Select a preset")
-        self.input_advice_preset.currentIndexChanged.connect(self.insert_preset_advice)
+        input_advice_preset_btn=QPushButton("Insert")
+        input_advice_preset_btn.clicked.connect(self.insert_preset_advice)
+        layout_advice2.addWidget(self.input_advice_preset, 2)
+        layout_advice2.addWidget(input_advice_preset_btn, 1)
         self.input_advice=QTextEdit(self)
         layout_advice.addWidget(label_advice)
-        layout_advice.addWidget(self.input_advice_preset)
+        layout_advice.addLayout(layout_advice2)
         layout_advice.addWidget(self.input_advice)
 
         tab_attachment=QWidget(self)