Changeset 1098


Ignore:
Timestamp:
Jun 24, 2011, 6:42:05 PM (6 years ago)
Author:
joerg
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/jlatexeditor/gproperties/GProperties.java

    r1097 r1098  
    8383    String[] MONOSPACE_FONTS_ARRAY = new String[monospaceFonts.size()];
    8484    monospaceFonts.toArray(MONOSPACE_FONTS_ARRAY);
    85 
    86     // set executables
    87     load();
    88     Aspell.ASPELL_EXECUTABLE = GProperties.getString("aspell.executable");
    89     if(Aspell.ASPELL_EXECUTABLE == null) Aspell.ASPELL_EXECUTABLE = "aspell";
    90 
    91     List<String> dictList;
    92     try {
    93       dictList = Aspell.availableDicts();
    94     } catch (IOException e) {
    95       dictList = new ArrayList<String>();
    96     }
    97     String[] aspellDicts = new String[dictList.size()];
    98     dictList.toArray(aspellDicts);
    99 
    100     try {
    101       dictList = Hunspell.availableDicts();
    102     } catch (IOException e) {
    103       dictList = new ArrayList<String>();
    104     }
    105     String[] hunspellDicts = new String[dictList.size()];
    106     dictList.toArray(hunspellDicts);
    10785
    10886    // set default for the properties file
     
    138116    properties.addEntry(new Def(EDITOR_FONT_ANTIALIASING, new PSet(TEXT_ANTIALIAS_KEYS), "On"));
    139117    properties.addEntry(new Def("editor.columns_per_row", INT_GT_0, "80"));
    140     properties.addEntry(new Comment(" Spell checker settings"));
    141     properties.addEntry(new Def("editor.spell_checker", new PSet("none", "aspell", "hunspell"), "aspell"));
    142     properties.addEntry(new Def("aspell.executable", STRING, "aspell"));
    143     properties.addEntry(new Def("aspell.lang", new PSet(aspellDicts), getFromList(aspellDicts, "en_GB")));
    144     properties.addEntry(new Def("hunspell.executable", STRING, "hunspell"));
    145     properties.addEntry(new Def("hunspell.lang", new PSet(hunspellDicts), getFromList(hunspellDicts, "en_GB")));
    146118    properties.addEntry(new Comment(" Automatic completion"));
    147119    properties.addEntry(new Def("editor.auto_completion.activated", BOOLEAN, "false"));
     
    244216    properties.addEntry(new Def("log level.sce", LOGLEVEL, "<default>"));
    245217
     218    properties.addEntry(new Comment("\n## Spell checker settings"));
     219    properties.addEntry(new Def("editor.spell_checker", new PSet("none", "aspell", "hunspell"), "aspell"));
     220    properties.addEntry(new Def("aspell.executable", STRING, "aspell"));
     221    properties.addEntry(new Def("hunspell.executable", STRING, "hunspell"));
     222
     223    // set executables
     224    load();
     225    Aspell.ASPELL_EXECUTABLE = GProperties.getString("aspell.executable");
     226
     227    List<String> dictList;
     228    try {
     229      dictList = Aspell.availableDicts();
     230    } catch (IOException e) {
     231      dictList = new ArrayList<String>();
     232    }
     233    String[] aspellDicts = new String[dictList.size()];
     234    dictList.toArray(aspellDicts);
     235
     236    try {
     237      dictList = Hunspell.availableDicts();
     238    } catch (IOException e) {
     239      dictList = new ArrayList<String>();
     240    }
     241    String[] hunspellDicts = new String[dictList.size()];
     242    dictList.toArray(hunspellDicts);
     243
     244    properties.addEntry(new Def("aspell.lang", new PSet(aspellDicts), getFromList(aspellDicts, "en_GB")));
     245    properties.addEntry(new Def("hunspell.lang", new PSet(hunspellDicts), getFromList(hunspellDicts, "en_GB")));
     246
    246247    load();
    247248    save();
Note: See TracChangeset for help on using the changeset viewer.