Grammalecte  Check-in [6c984d1387]

Overview
Comment:[tb] ui to select/deselect personal dictionary
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tb | multid
Files: files | file ages | folders
SHA3-256: 6c984d1387bdc5977d0efd14a71805e8ffc393712abe9cd6810bd38670a68587
User & Date: olr on 2018-03-30 09:37:44
Other Links: branch diff | manifest | tags
Context
2018-03-31
12:34
[graphspell][py] spellchecker: option to activate dictionary while loading check-in: 2349600755 user: olr tags: graphspell, multid
2018-03-30
09:37
[tb] ui to select/deselect personal dictionary check-in: 6c984d1387 user: olr tags: tb, multid
2018-03-29
10:00
[tb] code cleaning check-in: 208f30234a user: olr tags: tb, multid
Changes

Modified gc_lang/fr/tb/content/overlay.xul from [74df4d6d6c] to [fc3449c6a3].

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
      <menupopup id="gl-toolbar-popup">
        <menuitem id="gl-item-conj" class="menuitem-iconic" label="&grammalectemenu.textformatter;" oncommand="oTextFormatter.onOpenPanel(event);"/>
        <menuitem id="gl-item-conj" class="menuitem-iconic" label="&grammalectemenu.conjugueur;" oncommand="oGrammarChecker.onOpenConjugueur(event);"/>
        <menuseparator/>
        <menuitem id="gl-item-analyze" class="menuitem-iconic" label="&grammalectemenu.start;" oncommand="oGrammarChecker.onParseText(event);"/>
        <menuitem id="gl-item-options" class="menuitem-iconic" label="&grammalectemenu.gc_options;" onclick="oGrammarChecker.onOpenGCOptions(event);"/>
        <menuitem id="gl-item-options" class="menuitem-iconic" label="&grammalectemenu.spell_options;" onclick="oGrammarChecker.onOpenSpellOptions(event);"/>
        <menuitem id="gl-item-options" class="menuitem-iconic" label="&grammalectemenu.lexicon_editor;" onclick="oGrammarChecker.onOpenLexiconEditor(event);"/>
        <menuitem id="gl-item-options" class="menuitem-iconic" label="&grammalectemenu.other_options;" onclick="oGrammarChecker.onOpenOptions(event);"/>
        <menuseparator/>
        <menuitem id="gl-item-about" class="menuitem-iconic" label="&grammalectemenu.about;" oncommand="oGrammarChecker.onAbout(event);"/>
      </menupopup>
    </toolbarbutton>
  </toolbarpalette>









|
|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
      <menupopup id="gl-toolbar-popup">
        <menuitem id="gl-item-conj" class="menuitem-iconic" label="&grammalectemenu.textformatter;" oncommand="oTextFormatter.onOpenPanel(event);"/>
        <menuitem id="gl-item-conj" class="menuitem-iconic" label="&grammalectemenu.conjugueur;" oncommand="oGrammarChecker.onOpenConjugueur(event);"/>
        <menuseparator/>
        <menuitem id="gl-item-analyze" class="menuitem-iconic" label="&grammalectemenu.start;" oncommand="oGrammarChecker.onParseText(event);"/>
        <menuitem id="gl-item-options" class="menuitem-iconic" label="&grammalectemenu.gc_options;" onclick="oGrammarChecker.onOpenGCOptions(event);"/>
        <menuitem id="gl-item-options" class="menuitem-iconic" label="&grammalectemenu.spell_options;" onclick="oGrammarChecker.onOpenSpellOptions(event);"/>
        <menuitem id="gl-item-options" class="menuitem-iconic" label="&grammalectemenu.other_options;" onclick="oGrammarChecker.onOpenOptions(event);"/>
        <menuitem id="gl-item-options" class="menuitem-iconic" label="&grammalectemenu.lexicon_editor;" onclick="oGrammarChecker.onOpenLexiconEditor(event);"/>
        <menuseparator/>
        <menuitem id="gl-item-about" class="menuitem-iconic" label="&grammalectemenu.about;" oncommand="oGrammarChecker.onAbout(event);"/>
      </menupopup>
    </toolbarbutton>
  </toolbarpalette>


Modified gc_lang/fr/tb/content/spell_options.css from [2179034562] to [aa45acfc4a].

1
2
3
4
5
6
7
8
9
10
11
12
13




14
15
16
17
/* CSS */

#grouptitle {
	font-size: 16px;
	font-weight: bold;
	color: hsl(0, 50%, 50%);
}

.option {
	font-size: 16px;
	font-weight: bold;
	color: hsl(210, 50%, 50%);
}





.dicdescr {
	margin-left: 27px;
}













>
>
>
>




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* CSS */

#grouptitle {
	font-size: 16px;
	font-weight: bold;
	color: hsl(0, 50%, 50%);
}

.option {
	font-size: 16px;
	font-weight: bold;
	color: hsl(210, 50%, 50%);
}

description {
	width: 340px;
}

.dicdescr {
	margin-left: 27px;
}

Modified gc_lang/fr/tb/content/spell_options.js from [9ebffece09] to [f3284c0323].

14
15
16
17
18
19
20



21
22
23
24

25
26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49


50

	Services.console.logStringMessage(args.join(" -- ") + "\n");
}


var oDialogControl = {
	load: function () {
		try {



			document.getElementById('fr-FR-modern').checked = prefs.getBoolPref('bDictModern');
			document.getElementById('fr-FR-classic').checked = prefs.getBoolPref('bDictClassic');
			document.getElementById('fr-FR-reform').checked = prefs.getBoolPref('bDictReform');
			document.getElementById('fr-FR-classic-reform').checked = prefs.getBoolPref('bDictClassicReform');

			document.getElementById('grammalecte-spelloptions-window').centerWindowOnScreen();
		}
		catch (e) {
			Cu.reportError(e);
		}
	},
	setDictionaries: function () {
		oSpellControl.init();

		this._setDictionary('fr-FR-modern', 'bDictModern');
		this._setDictionary('fr-FR-classic', 'bDictClassic');
		this._setDictionary('fr-FR-reform', 'bDictReform');
		this._setDictionary('fr-FR-classic-reform', 'bDictClassicReform');
	},
	_setDictionary: function (sDicName, sOptName) {
		try {
			let bActivate = document.getElementById(sDicName).checked;
			oSpellControl.setExtensionDictFolder(sDicName, bActivate);
			prefs.setBoolPref(sOptName, bActivate);
		}
		catch (e) {
			Cu.reportError(e);
		}
	}
};












>
>
>




>








>
|
|
|
|

|








|
<
|
>
>
|
>
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

53
54
55
56
57
	Services.console.logStringMessage(args.join(" -- ") + "\n");
}


var oDialogControl = {
	load: function () {
		try {
			// Graphspell dictionaries
			document.getElementById('personal_dic').checked = prefs.getBoolPref('bPersonalDictionary');
			// Hunspell dictionaries
			document.getElementById('fr-FR-modern').checked = prefs.getBoolPref('bDictModern');
			document.getElementById('fr-FR-classic').checked = prefs.getBoolPref('bDictClassic');
			document.getElementById('fr-FR-reform').checked = prefs.getBoolPref('bDictReform');
			document.getElementById('fr-FR-classic-reform').checked = prefs.getBoolPref('bDictClassicReform');
			// center window
			document.getElementById('grammalecte-spelloptions-window').centerWindowOnScreen();
		}
		catch (e) {
			Cu.reportError(e);
		}
	},
	setDictionaries: function () {
		oSpellControl.init();
		this._setGraphspellDictionaries();
		this._setHunspellDictionary('fr-FR-modern', 'bDictModern');
		this._setHunspellDictionary('fr-FR-classic', 'bDictClassic');
		this._setHunspellDictionary('fr-FR-reform', 'bDictReform');
		this._setHunspellDictionary('fr-FR-classic-reform', 'bDictClassicReform');
	},
	_setHunspellDictionary: function (sDicName, sOptName) {
		try {
			let bActivate = document.getElementById(sDicName).checked;
			oSpellControl.setExtensionDictFolder(sDicName, bActivate);
			prefs.setBoolPref(sOptName, bActivate);
		}
		catch (e) {
			Cu.reportError(e);
		}
	},

	_setGraphspellDictionaries: function () {
		let bActivate = document.getElementById('personal_dic').checked;
		prefs.setBoolPref("bPersonalDictionary", bActivate);
	}
};

Modified gc_lang/fr/tb/content/spell_options.xul from [5453a7e2cc] to [73a5358896].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

23
24
25
26
27
28
29
30
31
32
33
34
35









36
37
38
39
40
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://grammarchecker/content/spell_options.css" type="text/css"?>

<!DOCTYPE dialog SYSTEM "chrome://grammarchecker/locale/spell_options.dtd">

<dialog
  id="grammalecte-spelloptions-window"
  title="&window.title;"
  orient="vertical"
  buttons="accept,cancel"
  ondialogaccept="oDialogControl.setDictionaries();"
  ondialogcancel="return;"
  width="400"
  height="660"
  onload="oDialogControl.load();"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <!-- Other elements go here -->
  
  <dialogheader id="grammalecte-title" title="&dialogheader.label;" description=""/>


  <groupbox id="dictchoice">
    <caption id="grouptitle" label="&grouptitle;" />
    <description id="warning">&warning;</description>
    
    <checkbox id="fr-FR-modern" class="option" label="&option.modern.label;" />
    <description class="dicdescr">&option.modern.descr;</description>
    <checkbox id="fr-FR-classic" class="option" label="&option.classic.label;" />
    <description class="dicdescr">&option.classic.descr;</description>
    <checkbox id="fr-FR-reform" class="option" label="&option.reform.label;" />
    <description class="dicdescr">&option.reform.descr;</description>
    <checkbox id="fr-FR-classic-reform" class="option" label="&option.allvar.label;" />
    <description class="dicdescr">&option.allvar.descr;</description>
  </groupbox>










  <script type="application/x-javascript" src="spell_options.js"/>
  <script type="application/x-javascript" src="spellchecker.js"/>

</dialog>













|
|







>
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://grammarchecker/content/spell_options.css" type="text/css"?>

<!DOCTYPE dialog SYSTEM "chrome://grammarchecker/locale/spell_options.dtd">

<dialog
  id="grammalecte-spelloptions-window"
  title="&window.title;"
  orient="vertical"
  buttons="accept,cancel"
  ondialogaccept="oDialogControl.setDictionaries();"
  ondialogcancel="return;"
  width="800"
  height="680"
  onload="oDialogControl.load();"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <!-- Other elements go here -->
  
  <dialogheader id="grammalecte-title" title="&dialogheader.label;" description=""/>

  <hbox>
    <groupbox with="380">
      <caption id="grouptitle" label="&grouptitle_hunspell;" />
      <description id="warning">&warning_hunspell;</description>
      
      <checkbox id="fr-FR-modern" class="option" label="&option.modern.label;" />
      <description class="dicdescr">&option.modern.descr;</description>
      <checkbox id="fr-FR-classic" class="option" label="&option.classic.label;" />
      <description class="dicdescr">&option.classic.descr;</description>
      <checkbox id="fr-FR-reform" class="option" label="&option.reform.label;" />
      <description class="dicdescr">&option.reform.descr;</description>
      <checkbox id="fr-FR-classic-reform" class="option" label="&option.allvar.label;" />
      <description class="dicdescr">&option.allvar.descr;</description>
    </groupbox>

    <groupbox with="380">
      <caption id="grouptitle" label="&grouptitle_graphspell;" />
      <description id="warning">&warning_graphspell;</description>

      <checkbox id="personal_dic" class="option" label="&option.personal_dic.label;" />
      <description class="dicdescr">&option.personal_dic.descr;</description>
    </groupbox>
  </hbox>

  <script type="application/x-javascript" src="spell_options.js"/>
  <script type="application/x-javascript" src="spellchecker.js"/>

</dialog>

Modified gc_lang/fr/tb/locale/en/spell_options.dtd from [fc660cb649] to [1569f5f972].

1
2
3

4


5


6
7
8
9
10
11
12
13


<!ENTITY window.title "Grammalecte · Spelling options">
<!ENTITY dialogheader.label "Spelling options">
<!ENTITY grouptitle "Select one or several dictionaries">

<!ENTITY warning "Select dictionaries you want to see in textareas list. Selected dictionaries are added instantly. Whereas unselected dictionnaries will be removed only at Thunderbird’s restart.">





<!ENTITY option.modern.label "“Modern”">
<!ENTITY option.modern.descr "This dictionary offers the French spelling as it is written nowadays most often. This is the recommended dictionary if French is not your mother tongue or if you want only one correct spelling per word.">
<!ENTITY option.classic.label "“Classic” (recommanded)">
<!ENTITY option.classic.descr "This is the “Modern” dictionary plus classical spellings, some of them still widely used, others obsolete. This is the recommended dictionary if French is your native language.">
<!ENTITY option.reform.label "“Reform 1990”">
<!ENTITY option.reform.descr "With this dictionary, only the reformed spelling is recognized. As many of reformed spellings are considered erroneous for many people, this dictionary is unadvised. Reformed spellings commonly used are already included in the “Modern” dictionary.">
<!ENTITY option.allvar.label "“All variants”">
<!ENTITY option.allvar.descr "This dictionary contains all spelling variants, classical and reformed, and some others even rarer. This dictionary is unadvised for those who don’t know very well the French language.">




|
>
|
>
>

>
>








>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!ENTITY window.title "Grammalecte · Spelling options">
<!ENTITY dialogheader.label "Spelling options">

<!ENTITY grouptitle_graphspell "Graphspell Dictionaries (Grammalecte)">
<!ENTITY warning_graphspell "Dictionaries from Grammalecte are used only when analyzing texts.">
<!ENTITY option.personal_dic.label "Use personal dictionary">
<!ENTITY option.personal_dic.descr "The personal dictionary is created and edited via the lexicon.">

<!ENTITY grouptitle_hunspell "Hunspell Dictionaries (Thunderbird)">
<!ENTITY warning_hunspell "These dictionaries are only used when you are writing texts (red underlining). Select dictionaries you want to see in textareas list. Selected dictionaries are added instantly. Whereas unselected dictionnaries will be removed only at Thunderbird’s restart.">
<!ENTITY option.modern.label "“Modern”">
<!ENTITY option.modern.descr "This dictionary offers the French spelling as it is written nowadays most often. This is the recommended dictionary if French is not your mother tongue or if you want only one correct spelling per word.">
<!ENTITY option.classic.label "“Classic” (recommanded)">
<!ENTITY option.classic.descr "This is the “Modern” dictionary plus classical spellings, some of them still widely used, others obsolete. This is the recommended dictionary if French is your native language.">
<!ENTITY option.reform.label "“Reform 1990”">
<!ENTITY option.reform.descr "With this dictionary, only the reformed spelling is recognized. As many of reformed spellings are considered erroneous for many people, this dictionary is unadvised. Reformed spellings commonly used are already included in the “Modern” dictionary.">
<!ENTITY option.allvar.label "“All variants”">
<!ENTITY option.allvar.descr "This dictionary contains all spelling variants, classical and reformed, and some others even rarer. This dictionary is unadvised for those who don’t know very well the French language.">


Modified gc_lang/fr/tb/locale/fr/spell_options.dtd from [43af7ee338] to [af7cf68ff7].

1
2
3
4



5


6
7
8
9
10
11
12
13
<!ENTITY window.title "Grammalecte · Options orthographiques">
<!ENTITY dialogheader.label "Options orthographiques">
<!ENTITY grouptitle "Choisissez un ou plusieurs dictionnaires">
<!ENTITY warning "Cochez les dictionnaires que vous voulez voir apparaître dans la liste des dictionnaires utilisables. L’ajout des dictionnaires se fait instantanément. En revanche, les dictionnaires ôtés ne disparaîtront qu’au redémarrage de Thunderbird.">






<!ENTITY option.modern.label "“Moderne”">
<!ENTITY option.modern.descr "Ce dictionnaire propose l’orthographe telle qu’elle est écrite aujourd’hui le plus couramment. C’est le dictionnaire recommandé si le français n’est pas votre langue maternelle ou si vous ne désirez qu’une seule graphie correcte par mot.">
<!ENTITY option.classic.label "“Classique” (recommandé)">
<!ENTITY option.classic.descr "Il s’agit du dictionnaire “Moderne”, avec des graphies classiques en sus, certaines encore communément utilisées, d’autres désuètes. C’est le dictionnaire recommandé si le français est votre langue maternelle.">
<!ENTITY option.reform.label "“Réforme 1990”">
<!ENTITY option.reform.descr "Avec ce dictionnaire, seule l’orthographe réformée est reconnue. Attendu que bon nombre de graphies réformées sont considérées comme erronées par beaucoup, ce dictionnaire est déconseillé. Les graphies passées dans l’usage sont déjà incluses dans le dictionnaire “Moderne”.">
<!ENTITY option.allvar.label "“Toutes variantes”">
<!ENTITY option.allvar.descr "Ce dictionnaire contient les variantes graphiques, classiques, réformées, ainsi que d’autres plus rares encore. Ce dictionnaire est déconseillé à ceux qui ne connaissent pas très bien la langue française.">


|
|
>
>
>

>
>








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!ENTITY window.title "Grammalecte · Options orthographiques">
<!ENTITY dialogheader.label "Options orthographiques">

<!ENTITY grouptitle_graphspell "Dictionnaires de Grammalecte">
<!ENTITY warning_graphspell "Les dictionnaires de Grammalecte ne sont employés que lors de l’analyse grammaticale.">
<!ENTITY option.personal_dic.label "Utiliser le dictionnaire personnel">
<!ENTITY option.personal_dic.descr "Le dictionnaire personnel est créé et édité via l’éditeur lexical.">

<!ENTITY grouptitle_hunspell "Dictionnaires Hunspell (Thunderbird)">
<!ENTITY warning_hunspell "Ces dictionnaires ne sont utilisés que lors de l’écriture de texte (soulignement rouge). Cochez les dictionnaires que vous voulez voir apparaître dans la liste des dictionnaires utilisables. L’ajout des dictionnaires se fait instantanément. En revanche, les dictionnaires ôtés ne disparaîtront qu’au redémarrage de Thunderbird.">
<!ENTITY option.modern.label "“Moderne”">
<!ENTITY option.modern.descr "Ce dictionnaire propose l’orthographe telle qu’elle est écrite aujourd’hui le plus couramment. C’est le dictionnaire recommandé si le français n’est pas votre langue maternelle ou si vous ne désirez qu’une seule graphie correcte par mot.">
<!ENTITY option.classic.label "“Classique” (recommandé)">
<!ENTITY option.classic.descr "Il s’agit du dictionnaire “Moderne”, avec des graphies classiques en sus, certaines encore communément utilisées, d’autres désuètes. C’est le dictionnaire recommandé si le français est votre langue maternelle.">
<!ENTITY option.reform.label "“Réforme 1990”">
<!ENTITY option.reform.descr "Avec ce dictionnaire, seule l’orthographe réformée est reconnue. Attendu que bon nombre de graphies réformées sont considérées comme erronées par beaucoup, ce dictionnaire est déconseillé. Les graphies passées dans l’usage sont déjà incluses dans le dictionnaire “Moderne”.">
<!ENTITY option.allvar.label "“Toutes variantes”">
<!ENTITY option.allvar.descr "Ce dictionnaire contient les variantes graphiques, classiques, réformées, ainsi que d’autres plus rares encore. Ce dictionnaire est déconseillé à ceux qui ne connaissent pas très bien la langue française.">