Skip to content

Commit

Permalink
ui: ontology: allow double click to edit an assertion from the table
Browse files Browse the repository at this point in the history
  • Loading branch information
mnamici committed Nov 20, 2024
1 parent be1c886 commit 9f28c84
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions eddy/ui/ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ def __init__(self, session):
table.verticalHeader().setSectionsClickable(False)
table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
#table.setSelectionMode(QAbstractItemView.MultiSelection)
connect(table.cellDoubleClicked, self.onAssertionCellDoubleClicked)
self.addWidget(table)

selectBtn = QtWidgets.QPushButton('Select All', objectName = 'annotation_assertions_selectall_button')
Expand Down Expand Up @@ -1045,6 +1046,18 @@ def onAnnotationCellClicked(self,row,column):
self.widget('ontology_annotations_delete_button').setEnabled(True)
self.widget('ontology_annotations_edit_button').setEnabled(True)

@QtCore.pyqtSlot(int, int)
def onAssertionCellDoubleClicked(self, row: int, _col: int) -> None:
table: QtWidgets.QTableWidget = self.widget('annotation_assertions_table_widget')
assertion = table.item(row, 2).data(QtCore.Qt.ItemDataRole.UserRole)
assertionBuilder = AnnotationAssertionBuilderDialog(
self.session,
self.project.ontologyIRI,
assertion,
)
connect(assertionBuilder.sgnAnnotationAssertionCorrectlyModified, self.redraw)
assertionBuilder.open()

@QtCore.pyqtSlot(bool)
def editOntologyAnnotation(self, _):
self.widget('ontology_annotations_edit_button').setEnabled(False)
Expand Down

0 comments on commit 9f28c84

Please sign in to comment.