taurus_pyqtgraph/curvesmodel.py
def _onSelectionChanged(self):
        """ Modify the status of the actions"""
        selected = self.ui.curvesTable.selectedIndexes()
        rows = []
        for item in selected:
            if item.row() not in rows:
                rows.append(item.row())
        lrows = len(rows)
        row = self.ui.curvesTable.currentIndex().row()
        isLastElem = row == self.model.rowCount() - 1
        isFirstElem = row == 0
        self._removeAction.setEnabled(lrows == 1)
        self._moveUpAction.setEnabled(lrows == 1 and not isFirstElem)
        self._moveDownAction.setEnabled(lrows == 1 and not isLastElem)
 Modify the status of the actions
Modify the status of the actions
Modify the status of the actions
def _onSelectionChanged(self):
        selected = self.ui.curvesTable.selectedIndexes()
        rows = []
        for item in selected:
            if item.row() not in rows:
                rows.append(item.row())
        lrows = len(rows)
        row = self.ui.curvesTable.currentIndex().row()
        isLastElem = row == self.model.rowCount() - 1
        isFirstElem = row == 0
        self._removeAction.setEnabled(lrows == 1)
        self._moveUpAction.setEnabled(lrows == 1 and not isFirstElem)
        self._moveDownAction.setEnabled(lrows == 1 and not isLastElem)
def _onSelectionChanged ( self ) : selected = self . ui . curvesTable . selectedIndexes ( ) rows = [ ] for item in selected : if item . row ( ) not in rows : rows . append ( item . row ( ) ) lrows = len ( rows ) row = self . ui . curvesTable . currentIndex ( ) . row ( ) isLastElem = row == self . model . rowCount ( ) - 1 isFirstElem = row == 0 self . _removeAction . setEnabled ( lrows == 1 ) self . _moveUpAction . setEnabled ( lrows == 1 and not isFirstElem ) self . _moveDownAction . setEnabled ( lrows == 1 and not isLastElem )
Modify the status of the actions
Modify the status of the actions
""" Modify the status of the actions"""
self