From 4544539616a1f6f7256641b3b6725ef6de704ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9fan=20Sinclair?= Date: Tue, 9 Aug 2016 13:01:28 -0400 Subject: [PATCH] toward support for overriding open menu --- server-settings.txt | 10 +++++++++- src/org/aw20/jettydesktop/ui/Executor.java | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/server-settings.txt b/server-settings.txt index 0e93b05..c6296b3 100644 --- a/server-settings.txt +++ b/server-settings.txt @@ -46,4 +46,12 @@ uri_path = / # setting allows you to direct VoyantServer logs to a file instead, which is especially # useful when you want to leave a server running and detached from the console # value should be true or anything else for false (including blank). -logs_file = \ No newline at end of file +logs_file = + +# This is a query string that defines which corpora appear in the drop-down menu when +# the user opens an existing corpus. If this is commented out or blank then the default value +# is used (currently the Austen and Shakespeare corpora). Corpora are defined using a URL +# query syntax where the key is the corpus ID and the value is the label that appears in the +# interface. For instance, this would be the default: +# open_menu = shakespeare=Shakespeare's Plays&austen=Austen's Novels +open_menu = test one=three \ No newline at end of file diff --git a/src/org/aw20/jettydesktop/ui/Executor.java b/src/org/aw20/jettydesktop/ui/Executor.java index be7b818..6121dad 100644 --- a/src/org/aw20/jettydesktop/ui/Executor.java +++ b/src/org/aw20/jettydesktop/ui/Executor.java @@ -87,6 +87,13 @@ else if (new File(JDK_HOME, "javaw").exists() ) // force UTF-8 programArgs.add("-Dfile.encoding=UTF-8"); + if (options.containsKey("open_menu")) { + String openMenu = options.get("open_menu"); + if (openMenu!=null && openMenu.isEmpty()==false) { + programArgs.add("\"-Dorg.voyanttools.voyant.open_menu="+openMenu+"\""); + } + } + if (options.getMemoryJVM() != null) programArgs.add("-Xmx" + options.getMemoryJVM() + "m");