Skip to content
Snippets Groups Projects
Commit cc700e66 authored by lbs051's avatar lbs051
Browse files

fix enable control scan validator

parent 94046bc0
No related branches found
No related tags found
No related merge requests found
...@@ -350,10 +350,13 @@ class _QImageFileStackPlot(_QImageStackPlot): ...@@ -350,10 +350,13 @@ class _QImageFileStackPlot(_QImageStackPlot):
def _updatefileName(self): def _updatefileName(self):
imageIndex = self._qslider.value() imageIndex = self._qslider.value()
assert imageIndex in self._indexToFile if imageIndex not in self._indexToFile:
imageName = self._indexToFile[imageIndex] # TODO henri : raise error ? why not in the index file.
self._qlFileName.setText(os.path.basename(imageName)) return
self._qlFileName.setToolTip(imageName) else:
imageName = self._indexToFile[imageIndex]
self._qlFileName.setText(os.path.basename(imageName))
self._qlFileName.setToolTip(imageName)
def main(): def main():
......
...@@ -356,36 +356,41 @@ class ValidationWidget(qt.QGroupBox): ...@@ -356,36 +356,41 @@ class ValidationWidget(qt.QGroupBox):
self.setLayout(layout) self.setLayout(layout)
# validate button # validate button
validateButton = qt.QPushButton('Validate') self.validateButton = qt.QPushButton('Validate')
style = qt.QApplication.style() style = qt.QApplication.style()
validateButton.setIcon(style.standardIcon(qt.QStyle.SP_DialogApplyButton)) self.validateButton.setIcon(style.standardIcon(qt.QStyle.SP_DialogApplyButton))
validateButton.pressed.connect(self.__validated) self.validateButton.pressed.connect(self.__validated)
layout.addWidget(validateButton, 0, 2) layout.addWidget(self.validateButton, 0, 2)
spacer = qt.QWidget(self) spacer = qt.QWidget(self)
spacer.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Minimum) spacer.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Minimum)
layout.addWidget(spacer, 0, 1) layout.addWidget(spacer, 0, 1)
# cancel button # cancel button
cancelButton = qt.QPushButton('Cancel') self.cancelButton = qt.QPushButton('Cancel')
cancelButton.setIcon(style.standardIcon(qt.QStyle.SP_DialogCancelButton)) self.cancelButton.setIcon(style.standardIcon(qt.QStyle.SP_DialogCancelButton))
cancelButton.pressed.connect(self.__canceled) self.cancelButton.pressed.connect(self.__canceled)
layout.addWidget(cancelButton, 0, 0) layout.addWidget(self.cancelButton, 0, 0)
# for now this button is hidden because the behavior haven't been # for now this button is hidden because the behavior haven't been
# clearly defined # clearly defined
cancelButton.hide() self.cancelButton.hide()
# change reconstruction parameters button # change reconstruction parameters button
changeReconsParamButton = qt.QPushButton('Change reconstruction parameters') self.changeReconsParamButton = qt.QPushButton('Change reconstruction parameters')
changeReconsParamButton.setIcon(style.standardIcon(qt.QStyle.SP_FileDialogContentsView)) self.changeReconsParamButton.setIcon(style.standardIcon(qt.QStyle.SP_FileDialogContentsView))
changeReconsParamButton.pressed.connect(self.__updateReconstructionParameters) self.changeReconsParamButton.pressed.connect(self.__updateReconstructionParameters)
layout.addWidget(changeReconsParamButton, 2, 0) layout.addWidget(self.changeReconsParamButton, 2, 0)
# redo acquisition button # redo acquisition button
# redoAcquisitionButton = qt.QPushButton('Redo acquisition') # redoAcquisitionButton = qt.QPushButton('Redo acquisition')
# redoAcquisitionButton.setIcon(style.standardIcon(qt.QStyle.SP_MediaSkipBackward)) # redoAcquisitionButton.setIcon(style.standardIcon(qt.QStyle.SP_MediaSkipBackward))
# redoAcquisitionButton.pressed.connect(self.__redoacquisition) # redoAcquisitionButton.pressed.connect(self.__redoacquisition)
# layout.addWidget(redoAcquisitionButton, 3, 0) # layout.addWidget(redoAcquisitionButton, 3, 0)
def setEnabled(self, b):
self.validateButton.setEnabled(b)
self.cancelButton.setEnabled(b)
self.changeReconsParamButton.setEnabled(b)
def __validated(self): def __validated(self):
"""Callback when the validate button is pushed""" """Callback when the validate button is pushed"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment