Index: gc_core/py/oxt/helpers.py ================================================================== --- gc_core/py/oxt/helpers.py +++ gc_core/py/oxt/helpers.py @@ -19,12 +19,11 @@ from apso_utils import console console() except: try: xContext = uno.getComponentContext() - xSvMgr = xContext.getServiceManager() - xPathSettings = xSvMgr.createInstanceWithContext("com.sun.star.util.PathSettings", xContext) + xPathSettings = xContext.ServiceManager.createInstanceWithContext("com.sun.star.util.PathSettings", xContext) spPyInstallion = uno.fileUrlToSystemPath(xPathSettings.Module) subprocess.Popen(spPyInstallion + os.sep + "python") # Start Python interactive Shell except: traceback.print_exc() Index: gc_lang/fr/mailext/content/overlay.js ================================================================== --- gc_lang/fr/mailext/content/overlay.js +++ gc_lang/fr/mailext/content/overlay.js @@ -42,10 +42,18 @@ let xPromise = this.xGCEWorker.post('loadGrammarChecker', [prefs.getCharPref("sGCOptions"), "Thunderbird"]); xPromise.then( function (aVal) { console.log(aVal); prefs.setCharPref("sGCOptions", aVal); + // spelling dictionary + if (prefs.getCharPref("sMainDicName")) { + let sMainDicName = prefs.getCharPref("sMainDicName"); + if (sMainDicName == "fr-classic.json" || sMainDicName == "fr-reform.json") { + that.xGCEWorker.post("setDictionary", ["main", sMainDicName]); + } + } + // personal dictionary if (prefs.getBoolPref("bPersonalDictionary")) { let sDicJSON = oFileHandler.loadFile("fr.personal.json"); if (sDicJSON) { that.xGCEWorker.post('setDictionary', ["personal", sDicJSON]); } Index: gc_lang/fr/mailext/content/spell_options.css ================================================================== --- gc_lang/fr/mailext/content/spell_options.css +++ gc_lang/fr/mailext/content/spell_options.css @@ -1,36 +1,46 @@ /* CSS */ #grouptitle { - font-size: 16px; - font-weight: bold; - color: hsl(0, 50%, 50%); + font-size: 16px; + font-weight: bold; + color: hsl(0, 50%, 50%); } .option { - font-size: 16px; - font-weight: bold; - color: hsl(210, 50%, 50%); + font-size: 16px; + font-weight: bold; + color: hsl(210, 50%, 50%); +} + +.suboption { + margin-left: 30px; + font-size: 16px; + font-weight: bold; + color: hsl(210, 50%, 50%); +} +.suboption2 { + margin-left: 30px; } description { - width: 340px; + width: 340px; } .dicdescr { - margin-left: 27px; + margin-left: 27px; } .disabled { - opacity: .25; + opacity: .25; } .dialogheader-title { - margin: 5px; - padding: 5px 8px; - border: 1px solid hsl(210, 50%, 80%); - background-color: hsl(210, 50%, 50%); - color: hsl(210, 10%, 90%); - font-size: larger; - font-weight: bold; + margin: 5px; + padding: 5px 8px; + border: 1px solid hsl(210, 50%, 80%); + background-color: hsl(210, 50%, 50%); + color: hsl(210, 10%, 90%); + font-size: larger; + font-weight: bold; } Index: gc_lang/fr/mailext/content/spell_options.js ================================================================== --- gc_lang/fr/mailext/content/spell_options.js +++ gc_lang/fr/mailext/content/spell_options.js @@ -12,12 +12,25 @@ var oDialogControl = { load: function () { try { // center window document.getElementById('grammalecte-spelloptions-window').centerWindowOnScreen(); - // Graphspell dictionaries + // main spelling dictionary + let sMainDicName = prefs.getCharPref('sMainDicName'); + console.log("spelling dictionary:", sMainDicName); + if (sMainDicName == "fr-classic.json") { + document.getElementById("classic").checked = true; + } + else if (sMainDicName == "fr-reform.json") { + document.getElementById("reform").checked = true; + } + else if (sMainDicName == "fr-allvars.json") { + document.getElementById("allvars").checked = true; + } + // personal dictionary document.getElementById('personal_dic').checked = prefs.getBoolPref('bPersonalDictionary'); + // listen this.listen(); } catch (e) { console.error(e); } @@ -24,15 +37,40 @@ }, listen: function () { document.addEventListener("dialogaccept", (event) => { oDialogControl.setDictionaries(); }); + document.getElementById("classic").addEventListener("click", (event) => { + oDialogControl.changeMainDicUI("classic"); + }); + document.getElementById("reform").addEventListener("click", (event) => { + oDialogControl.changeMainDicUI("reform"); + }); + document.getElementById("allvars").addEventListener("click", (event) => { + oDialogControl.changeMainDicUI("allvars"); + }); + }, + changeMainDicUI (sDic) { + document.getElementById("classic").checked = ("classic" === sDic); + document.getElementById("reform").checked = ("reform" === sDic); + document.getElementById("allvars").checked = ("allvars" === sDic); }, setDictionaries: function () { - oSpellControl.init(); - this._setGraphspellDictionaries(); - }, - _setGraphspellDictionaries: function () { + //oSpellControl.init(); + // main spelling dictionary + let sMainDicName = ""; + if (document.getElementById("classic").checked) { + sMainDicName = "fr-classic.json"; + } + else if (document.getElementById("reform").checked) { + sMainDicName = "fr-reform.json"; + } + else if (document.getElementById("allvars").checked) { + sMainDicName = "fr-allvars.json"; + } + console.log("selected spelling dictionary:", sMainDicName); + prefs.setCharPref("sMainDicName", sMainDicName); + // personal dictionary let bActivate = document.getElementById('personal_dic').checked; prefs.setBoolPref("bPersonalDictionary", bActivate); } }; Index: gc_lang/fr/mailext/content/spell_options.xul ================================================================== --- gc_lang/fr/mailext/content/spell_options.xul +++ gc_lang/fr/mailext/content/spell_options.xul @@ -8,11 +8,11 @@ id="grammalecte-spelloptions-window" title="&window.title;" orient="vertical" buttons="accept,cancel" width="400" - height="300" + height="330" onload="oDialogControl.load();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> @@ -39,10 +39,21 @@ &warning_graphspell; &option.main_dic.descr; +