diff --git a/Makefile b/Makefile index c3787bd..6c0edcf 100644 --- a/Makefile +++ b/Makefile @@ -13,4 +13,7 @@ StenoTray.jar: *.class # No special options should be necessary. .java.class: $< - javac -source 1.6 -target 1.6 $< + javac -cp .:javax.json-1.0.jar $< + +clean: + rm *.jar *.class diff --git a/StenoTray.jar b/StenoTray.jar index 7e697b5..9cc71b8 100644 Binary files a/StenoTray.jar and b/StenoTray.jar differ diff --git a/StenoTray.java b/StenoTray.java index 7b5417c..9c63c0c 100755 --- a/StenoTray.java +++ b/StenoTray.java @@ -17,6 +17,12 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.json.JsonArray; +import javax.json.JsonReader; +import javax.json.Json; +import javax.json.JsonObject; +import java.util.ListIterator; +import java.io.StringReader; public class StenoTray extends JFrame { static String mkPath(String path1, String... paths) @@ -414,8 +420,16 @@ else if (fields[0].trim().equals("DEBUG")) while (((line = pConfig.readLine()) != null)) { fields = line.split("="); if (fields.length >= 2) { - if (fields[0].trim().length() > 15) - if (fields[0].trim().substring(0,15).equals("dictionary_file")) + if (fields[0].trim().equals("dictionaries")) { + JsonReader reader = Json.createReader(new StringReader(fields[1].trim())); + JsonArray list = reader.readArray(); + ListIterator l = list.listIterator(); + while ( l.hasNext() ) { + JsonObject j = (JsonObject) l.next(); + dictionaryFiles.add(mkPath(PLOVER_DIR, j.getString("path"))); + } + } + if (fields[0].trim().equals("dictionary_file")) dictionaryFiles.add(fields[1].trim()); if (fields[0].trim().equals("log_file")) logFile = fields[1].trim(); diff --git a/javax.json-1.0.jar b/javax.json-1.0.jar new file mode 100644 index 0000000..11f8cef Binary files /dev/null and b/javax.json-1.0.jar differ