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    282                   self.updateGenWords()
   283    283               elif xActionEvent.ActionCommand == "Add":
   284    284                   self.addToLexicon()
   285    285               elif xActionEvent.ActionCommand == "Delete":
   286    286                   self.deleteSelectedEntries()
   287    287               elif xActionEvent.ActionCommand == "Save":
   288    288                   self.saveLexicon()
          289  +            elif xActionEvent.ActionCommand == "Import":
          290  +                self.importDictionary()
   289    291               elif xActionEvent.ActionCommand == "Export":
   290    292                   self.exportDictionary()
   291    293               elif xActionEvent.ActionCommand == "Close":
   292    294                   self.xContainer.endExecute()
   293    295           except:
   294    296               traceback.print_exc()
   295    297       
................................................................................
   531    533           self.xSave.Enabled = True
   532    534           self.xNumAdded.Label = str(int(self.xNumAdded.Label) + xGridDataModelNew.RowCount)
   533    535           self.xNumLex.Label = str(int(self.xNumLex.Label) + xGridDataModelNew.RowCount)
   534    536           self._resetWidgets()
   535    537   
   536    538       @_waitPointer
   537    539       def deleteSelectedEntries (self):
          540  +        # generated entries
   538    541           xGridDataModel = self.xGridModelNew.GridDataModel
   539    542           for i in self.xGridControlNew.getSelectedRows():
   540    543               xGridDataModel.removeRow(i)
          544  +        self.xGridControlNew.deselectAllRows()
          545  +        # lexicon
   541    546           xGridDataModel = self.xGridModelLex.GridDataModel
   542    547           nSelectedEntries = len(self.xGridControlLex.getSelectedRows())
   543    548           for i in self.xGridControlLex.getSelectedRows():
   544    549               xGridDataModel.removeRow(i)
          550  +        self.xGridControlLex.deselectAllRows()
   545    551           self.xNumDeleted.Label = str(int(self.xNumDeleted.Label) + nSelectedEntries)
   546    552           self.xNumLex.Label = str(xGridDataModel.RowCount)
   547    553   
          554  +    @_waitPointer
          555  +    def importDictionary (self):
          556  +        pass
          557  +
          558  +    @_waitPointer
          559  +    def exportDictionary (self):
          560  +        xFilePicker = self.xSvMgr.createInstanceWithContext('com.sun.star.ui.dialogs.SystemFilePicker', self.ctx)
          561  +        xFilePicker.appendFilter("Supported files", "*.json; *.bdic")
          562  +        #xFilePicker.setDisplayDirectory("")
          563  +        #xFilePicker.setMultiSelectionMode(True)
          564  +        nResult = xFilePicker.execute()
          565  +        if nResult == 1:
          566  +            pass
          567  +            #lFile = xFilePicker.getSelectedFiles()
          568  +            #lFile = xFilePicker.getFiles()
          569  +
   548    570   
   549    571   #g_ImplementationHelper = unohelper.ImplementationHelper()
   550    572   #g_ImplementationHelper.addImplementation(LexiconEditor, 'net.grammalecte.LexiconEditor', ('com.sun.star.task.Job',))