Grammalecte  Check-in [00fe4c5157]

Overview
Comment:[lo] lexicon editor: update
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | lo | multid
Files: files | file ages | folders
SHA3-256: 00fe4c5157612e1ab39a45e0ae77b98d81a6dfce53b67d5e55bfec28d42bf556
User & Date: olr on 2018-02-28 16:27:28
Other Links: branch diff | manifest | tags
Context
2018-02-28
16:28
[lo] dictionary options: update check-in: 5c5ea1fd5b user: olr tags: lo, multid
16:27
[lo] lexicon editor: update check-in: 00fe4c5157 user: olr tags: lo, multid
15:29
[lo] lexicon editor: update check-in: 5cc5b32dc7 user: olr tags: lo, multid
Changes

Modified gc_lang/fr/oxt/DictOptions/LexiconEditor.py from [3fd0784e8d] to [cf28740932].

282
283
284
285
286
287
288


289
290
291
292
293
294
295
...
531
532
533
534
535
536
537

538
539
540


541
542
543
544

545
546
547
















548
549
550
                self.updateGenWords()
            elif xActionEvent.ActionCommand == "Add":
                self.addToLexicon()
            elif xActionEvent.ActionCommand == "Delete":
                self.deleteSelectedEntries()
            elif xActionEvent.ActionCommand == "Save":
                self.saveLexicon()


            elif xActionEvent.ActionCommand == "Export":
                self.exportDictionary()
            elif xActionEvent.ActionCommand == "Close":
                self.xContainer.endExecute()
        except:
            traceback.print_exc()
    
................................................................................
        self.xSave.Enabled = True
        self.xNumAdded.Label = str(int(self.xNumAdded.Label) + xGridDataModelNew.RowCount)
        self.xNumLex.Label = str(int(self.xNumLex.Label) + xGridDataModelNew.RowCount)
        self._resetWidgets()

    @_waitPointer
    def deleteSelectedEntries (self):

        xGridDataModel = self.xGridModelNew.GridDataModel
        for i in self.xGridControlNew.getSelectedRows():
            xGridDataModel.removeRow(i)


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

        self.xNumDeleted.Label = str(int(self.xNumDeleted.Label) + nSelectedEntries)
        self.xNumLex.Label = str(xGridDataModel.RowCount)


















#g_ImplementationHelper = unohelper.ImplementationHelper()
#g_ImplementationHelper.addImplementation(LexiconEditor, 'net.grammalecte.LexiconEditor', ('com.sun.star.task.Job',))







>
>







 







>



>
>




>



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
...
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
                self.updateGenWords()
            elif xActionEvent.ActionCommand == "Add":
                self.addToLexicon()
            elif xActionEvent.ActionCommand == "Delete":
                self.deleteSelectedEntries()
            elif xActionEvent.ActionCommand == "Save":
                self.saveLexicon()
            elif xActionEvent.ActionCommand == "Import":
                self.importDictionary()
            elif xActionEvent.ActionCommand == "Export":
                self.exportDictionary()
            elif xActionEvent.ActionCommand == "Close":
                self.xContainer.endExecute()
        except:
            traceback.print_exc()
    
................................................................................
        self.xSave.Enabled = True
        self.xNumAdded.Label = str(int(self.xNumAdded.Label) + xGridDataModelNew.RowCount)
        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):
        pass

    @_waitPointer
    def exportDictionary (self):
        xFilePicker = self.xSvMgr.createInstanceWithContext('com.sun.star.ui.dialogs.SystemFilePicker', self.ctx)
        xFilePicker.appendFilter("Supported files", "*.json; *.bdic")
        #xFilePicker.setDisplayDirectory("")
        #xFilePicker.setMultiSelectionMode(True)
        nResult = xFilePicker.execute()
        if nResult == 1:
            pass
            #lFile = xFilePicker.getSelectedFiles()
            #lFile = xFilePicker.getFiles()


#g_ImplementationHelper = unohelper.ImplementationHelper()
#g_ImplementationHelper.addImplementation(LexiconEditor, 'net.grammalecte.LexiconEditor', ('com.sun.star.task.Job',))