Index: gc_lang/fr/oxt/DictOptions/LexiconEditor.py ================================================================== --- gc_lang/fr/oxt/DictOptions/LexiconEditor.py +++ gc_lang/fr/oxt/DictOptions/LexiconEditor.py @@ -371,10 +371,23 @@ self.xNumDic.Label = 0 self.xDateDic.Label = self.dUI.get("void", "#err") @_waitPointer def importDictionary (self): + # FilePicker doesn’t work at all… + #xFilePicker = self.xSvMgr.createInstanceWithContext('com.sun.star.ui.dialogs.FilePicker', self.ctx) # other possibility: com.sun.star.ui.dialogs.SystemFilePicker + #xFilePicker.initialize([uno.getConstantByName("com.sun.star.ui.dialogs.TemplateDescription.FILEOPEN_SIMPLE")]) # seems useless + #xFilePicker.appendFilter("Supported files", "*.json; *.bdic") + #xFilePicker.setDefaultName("fr.personal.json") # useless, doesn’t work + #xFilePicker.setDisplayDirectory("") + #xFilePicker.setMultiSelectionMode(False) + #nResult = xFilePicker.execute() + #if nResult == 1: + # lFile = xFilePicker.getSelectedFiles() + # lFile = xFilePicker.getFiles() + # print(lFile) + # workaround spfImported = os.path.join(os.environ['USERPROFILE'], "fr.personal.json") if os.path.isfile(spfImported): with open(spfImported, "r", encoding="utf-8") as hDst: sJSON = hDst.read() try: @@ -422,21 +435,10 @@ MessageBox(self.xDocument, sMessage, self.dUI.get('export_title', "#err")) except: sMessage = traceback.format_exc() MessageBox(self.xDocument, sMessage, self.dUI.get('export_title', "#err"), ERRORBOX) - # FilePicker doesn’t work at all… - #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() - def _getRadioValue (self, *args): for x in args: if x.State: return x.HelpText return None