|
@@ -121,6 +121,9 @@ class imageBrowserWidget(ScriptedLoadableModuleWidget):
|
|
|
self.patientSave=qt.QPushButton("Save")
|
|
|
self.patientSave.clicked.connect(self.onPatientSaveButtonClicked)
|
|
|
patientsFormLayout.addRow("Save segmentation",self.patientSave)
|
|
|
+#empty label as a spacer
|
|
|
+ qX=qt.QLabel("")
|
|
|
+ patientsFormLayout.addRow("",qX)
|
|
|
|
|
|
self.patientClear=qt.QPushButton("Clear")
|
|
|
self.patientClear.clicked.connect(self.onPatientClearButtonClicked)
|
|
@@ -385,13 +388,26 @@ class imageBrowserWidget(ScriptedLoadableModuleWidget):
|
|
|
pass
|
|
|
|
|
|
def onPatientClearButtonClicked(self):
|
|
|
- self.logic.clearVolumesAndSegmentations()
|
|
|
- self.patientSave.setStyleSheet('background-color:gray')
|
|
|
+ msgBox=qt.QMessageBox()
|
|
|
+ msgBox.setText('Are you sure you want to clear pateient?')
|
|
|
+ msgBox.setStandardButtons(qt.QMessageBox.Ok |qt.QMessageBox.Cancel)
|
|
|
+ returnValue=msgBox.exec()
|
|
|
+ if returnValue==qt.QMessageBox.Cancel:
|
|
|
+ print('Canceling')
|
|
|
+ return
|
|
|
+ print('Clearing')
|
|
|
+ self.logic.clearVolumesAndSegmentations()
|
|
|
+ self.clearSaveButton()
|
|
|
+
|
|
|
+ def clearSaveButton(self):
|
|
|
+ self.patientSave.setStyleSheet('background-color:gray')
|
|
|
+
|
|
|
|
|
|
def onPatientSaveButtonClicked(self):
|
|
|
status=self.logic.saveSegmentation()
|
|
|
if status:
|
|
|
self.patientSave.setStyleSheet('background-color:green')
|
|
|
+ qt.QTimer.singleShot(5000,self.clearSaveButton)
|
|
|
else:
|
|
|
self.patientSave.setStyleSheet('background-color:red')
|
|
|
|