Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:shroff/pharc

  • Loading branch information...
commit 102afdca30141d1a53500c25606b0c891050dce0 2 parents e2d6b31 + 2a8407b
@jcline jcline authored
Showing with 31 additions and 10 deletions.
  1. +1 −1  src/gui/patienteditpage.py
  2. +30 −9 src/gui/patientnamerow.py
View
2  src/gui/patienteditpage.py
@@ -61,5 +61,5 @@ def cancelChanges(self):
def setPatient(self, patient):
self.patient = patient
- self.nameRow.setName(self.patient.nameFirst + " " + self.patient.nameLast)
+ self.nameRow.setPatient(self.patient)
self.detailTable.setPatient(self.patient)
View
39 src/gui/patientnamerow.py
@@ -18,6 +18,9 @@
from PyQt4.QtGui import *
from PyQt4.QtCore import *
+import database.fs
+from logic.datamanager import DataManager
+
class PatientNameRow(QWidget):
def __init__(self):
super(PatientNameRow, self).__init__()
@@ -26,14 +29,18 @@ def __init__(self):
self.changing = False
def initUI(self):
- self.changeNameField = ChangeNameField(self)
+ self.changeFirstName = ChangeNameField(self)
+ self.changeLastName = ChangeNameField(self)
+ self.changeLastName.setVisible(False)
+
self.editButton = QPushButton('Edit')
self.cancelButton = QPushButton('Cancel')
self.cancelButton.setVisible(False)
hbox = QHBoxLayout()
hbox.addWidget(QLabel('Patient Name: ', self))
- hbox.addWidget(self.changeNameField)
+ hbox.addWidget(self.changeFirstName)
+ hbox.addWidget(self.changeLastName)
hbox.addWidget(self.editButton)
hbox.addWidget(self.cancelButton)
@@ -46,28 +53,42 @@ def nameChange(self):
if(self.changing):
self.change()
else:
- self.changeNameField.setReadOnly(False)
- self.changeNameField.setFocus()
+ self.changeFirstName.setReadOnly(False)
+ self.changeFirstName.setText(str(self.patient.nameFirst))
+ self.changeFirstName.setFocus()
+
+ self.changeLastName.setReadOnly(False)
+ self.changeLastName.setVisible(True)
+ self.changeLastName.setText(str(self.patient.nameLast))
+
self.editButton.setText('Done')
self.cancelButton.setVisible(True)
self.changing = True
def change(self):
- if (self.changeNameField.text() != ''):
- print("Changing name to: " + self.changeNameField.text())
+ if (self.changeFirstName.text() != ''):
+ print("Changing name to: " + self.changeFirstName.text() + " " +
+ self.changeLastName.text())
+ self.patient.nameFirst = self.changeFirstName.text()
+ self.patient.nameLast = self.changeLastName.text()
self.cancel()
def cancel(self):
- self.changeNameField.setReadOnly(True)
+ self.changeFirstName.setReadOnly(True)
+ self.changeLastName.setReadOnly(True)
+ self.changeLastName.setVisible(False)
+
self.editButton.setText('Edit')
self.cancelButton.setVisible(False)
self.changing = False
+ self.changeFirstName.setText(str(self.patient.nameFirst + " " + self.patient.nameLast))
- def setName(self, name):
- self.changeNameField.setText(str(name))
+ def setPatient(self, p):
+ self.patient = p
+ self.changeFirstName.setText(str(self.patient.nameFirst + " " + self.patient.nameLast))
Please sign in to comment.
Something went wrong with that request. Please try again.