Grammalecte  Check-in [b156d2110e]

Overview
Comment:[lo] lexicon editor: prevent deleting unexistant rows
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | lo | multid
Files: files | file ages | folders
SHA3-256: b156d2110e6105d9b55e873f254b8b804009a9b7cb6db16a86e163925c89dc2e
User & Date: olr on 2018-02-28 17:24:34
Other Links: branch diff | manifest | tags
Context
2018-02-28
18:27
[graphspell][py] spellchecker: dictionary object can be used to initialize IBDAWG check-in: 0cd3bfee2d user: olr tags: graphspell, multid
17:24
[lo] lexicon editor: prevent deleting unexistant rows check-in: b156d2110e user: olr tags: lo, multid
16:28
[lo] dictionary options: update check-in: 5c5ea1fd5b user: olr tags: lo, multid
Changes

Modified gc_lang/fr/oxt/DictOptions/LexiconEditor.py from [cf28740932] to [1e45d3395d].

   535    535           self.xNumLex.Label = str(int(self.xNumLex.Label) + xGridDataModelNew.RowCount)
   536    536           self._resetWidgets()
   537    537   
   538    538       @_waitPointer
   539    539       def deleteSelectedEntries (self):
   540    540           # generated entries
   541    541           xGridDataModel = self.xGridModelNew.GridDataModel
          542  +        #helpers.xray(xGridDataModel)
   542    543           for i in self.xGridControlNew.getSelectedRows():
   543         -            xGridDataModel.removeRow(i)
          544  +            if i < xGridDataModel.RowCount:
          545  +                xGridDataModel.removeRow(i)
   544    546           self.xGridControlNew.deselectAllRows()
   545    547           # lexicon
   546    548           xGridDataModel = self.xGridModelLex.GridDataModel
   547    549           nSelectedEntries = len(self.xGridControlLex.getSelectedRows())
   548    550           for i in self.xGridControlLex.getSelectedRows():
   549         -            xGridDataModel.removeRow(i)
          551  +            if i < xGridDataModel.RowCount:
          552  +                xGridDataModel.removeRow(i)
   550    553           self.xGridControlLex.deselectAllRows()
   551    554           self.xNumDeleted.Label = str(int(self.xNumDeleted.Label) + nSelectedEntries)
   552    555           self.xNumLex.Label = str(xGridDataModel.RowCount)
   553    556   
   554    557       @_waitPointer
   555    558       def importDictionary (self):
   556    559           pass