JAL-4001 Add a _geo=1 to query string and JSON. Add a headless flag to path and...
[jalview.git] / src / jalview / bin / Jalview.java
index 6d2866a..1f86926 100755 (executable)
@@ -810,6 +810,7 @@ public class Jalview
     // Run Commands from cli
     cmds = new Commands(argparser, headlessArg);
     boolean commandsSuccess = cmds.argsWereParsed();
+
     if (commandsSuccess)
     {
       if (headlessArg)
@@ -822,6 +823,11 @@ public class Jalview
         }
         else
         {
+          // record usage stats if in headless mode
+          if (Cache.getDefault("USAGESTATS", false))
+          {
+            Cache.initGoogleTracker(headlessArg);
+          }
           Jalview.exit("Successfully completed commands in headless mode",
                   0);
         }
@@ -1595,10 +1601,9 @@ public class Jalview
      * start a User Config prompt asking if we can log usage statistics.
      */
     PromptUserConfig prompter = new PromptUserConfig(Desktop.desktop,
-            "USAGESTATS", "Jalview Usage Statistics",
-            "Do you want to help make Jalview better by enabling "
-                    + "the collection of usage statistics with Google Analytics ?"
-                    + "\n\n(you can enable or disable usage tracking in the preferences)",
+            "USAGESTATS",
+            MessageManager.getString("prompt.google_analytics_title"),
+            MessageManager.getString("prompt.google_analytics"),
             new Runnable()
             {
               @Override