404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
|
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
|
-
+
|
@_waitPointer
def importDictionary (self):
spfImported = ""
try:
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.appendFilter("Supported files", "*.json")
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()
|
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
|
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
|
-
+
|
self.xDateDic.Label = self.dUI.get("void", "#err")
MessageBox(self.xDocument, self.dUI.get('save_message', "#err"), self.dUI.get('save_title', "#err"))
def exportDictionary (self):
try:
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.FILESAVE_SIMPLE")]) # seems useless
xFilePicker.appendFilter("Supported files", "*.json; *.bdic")
xFilePicker.appendFilter("Supported files", "*.json")
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()
|