Skip to content
Snippets Groups Projects
Commit f10cade5 authored by stefan's avatar stefan
Browse files

GradientEditorWidget, fix for editor problem

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2509 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent cc219542
Branches
Tags
No related merge requests found
...@@ -107,10 +107,12 @@ class GradientPresetWidget(QtGui.QWidget): ...@@ -107,10 +107,12 @@ class GradientPresetWidget(QtGui.QWidget):
self.immucontextMenu_.popup(QtGui.QCursor.pos()) self.immucontextMenu_.popup(QtGui.QCursor.pos())
def Add(self): def Add(self):
if(self.list_view_.currentIndex().isValid()):
self.list_view_.closePersistentEditor(self.list_view_.currentIndex())
row = self.list_model_.GetLastRow() row = self.list_model_.GetLastRow()
if self.list_model_.AddItem(datetime.now().isoformat(' '), self.gradient_edit_.GetGradient(), row, True, True): if self.list_model_.AddItem(datetime.now().isoformat(' '), self.gradient_edit_.GetGradient(), row, True, True):
index = self.list_model_.index(row) index = self.list_model_.index(row)
self.self.list_view__.setCurrentIndex(index) self.list_view_.setCurrentIndex(index)
self.Rename() self.Rename()
else: else:
QtGui.QMessageBox.information(self, "Gradient not added", "The gradient could not be added!") QtGui.QMessageBox.information(self, "Gradient not added", "The gradient could not be added!")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment