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
536
537
538
539
540
541

542

543
544
545
546
547
548

549
550
551
552
553
554
555
        self.xNumLex.Label = str(int(self.xNumLex.Label) + xGridDataModelNew.RowCount)
        self._resetWidgets()

    @_waitPointer
    def deleteSelectedEntries (self):
        # generated entries
        xGridDataModel = self.xGridModelNew.GridDataModel

        for i in self.xGridControlNew.getSelectedRows():

            xGridDataModel.removeRow(i)
        self.xGridControlNew.deselectAllRows()
        # lexicon
        xGridDataModel = self.xGridModelLex.GridDataModel
        nSelectedEntries = len(self.xGridControlLex.getSelectedRows())
        for i in self.xGridControlLex.getSelectedRows():

            xGridDataModel.removeRow(i)
        self.xGridControlLex.deselectAllRows()
        self.xNumDeleted.Label = str(int(self.xNumDeleted.Label) + nSelectedEntries)
        self.xNumLex.Label = str(xGridDataModel.RowCount)

    @_waitPointer
    def importDictionary (self):







>

>






>







535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
        self.xNumLex.Label = str(int(self.xNumLex.Label) + xGridDataModelNew.RowCount)
        self._resetWidgets()

    @_waitPointer
    def deleteSelectedEntries (self):
        # generated entries
        xGridDataModel = self.xGridModelNew.GridDataModel
        #helpers.xray(xGridDataModel)
        for i in self.xGridControlNew.getSelectedRows():
            if i < xGridDataModel.RowCount:
                xGridDataModel.removeRow(i)
        self.xGridControlNew.deselectAllRows()
        # lexicon
        xGridDataModel = self.xGridModelLex.GridDataModel
        nSelectedEntries = len(self.xGridControlLex.getSelectedRows())
        for i in self.xGridControlLex.getSelectedRows():
            if i < xGridDataModel.RowCount:
                xGridDataModel.removeRow(i)
        self.xGridControlLex.deselectAllRows()
        self.xNumDeleted.Label = str(int(self.xNumDeleted.Label) + nSelectedEntries)
        self.xNumLex.Label = str(xGridDataModel.RowCount)

    @_waitPointer
    def importDictionary (self):