X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;h=919822a367b83b91d2382ce684cc2a854f700a02;hb=3f75f01cbd5c6f66db3b0663cea1b39dad51b492;hp=805d098c4cdb9f7767aab7f066eebd6ccfd9bf0c;hpb=e3d37653250ad19df4c310f1fd6a50510467a764;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 805d098..919822a 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -125,6 +125,7 @@ public class Jalview } else { System.out.println("Executing setprop argument: "+defs); // DISABLED FOR SECURITY REASONS + // TODO: add a property to allow properties to be overriden by cli args // Cache.setProperty(defs.substring(0,p), defs.substring(p+1)); } defs = aparser.getValue("setprop"); @@ -172,12 +173,8 @@ public class Jalview desktop = new Desktop(); desktop.setVisible(true); desktop.discoverer.start(); - if (!aparser.contains("nousagestats") && Cache.getDefault("USAGESTATS", true)) { - Cache.log.info("Initialising googletracker for usage stats."); - Cache.initGoogleTracker(); - Cache.log.debug("Tracking enabled."); - } else { - Cache.log.info("Not enabling Google Tracking."); + if (!aparser.contains("nousagestats")) { + startUsageStats(desktop); } if (!aparser.contains("noquestionnaire")) { @@ -511,6 +508,28 @@ public class Jalview // Once all other stuff is done, execute any groovy scripts (in order) } + private static void startUsageStats(final Desktop desktop) + { + /** + * start a User Config prompt asking if we can log usage statistics. + */ + jalview.gui.PromptUserConfig prompter = new jalview.gui.PromptUserConfig(desktop.desktop,"USAGESTATS", "Jalview Usage Statistics", "Jalview uses Google Analytics to report usage statistics.\nDo you want to enable this ?\n\n(if you press cancel, you will be asked again next time)", + new Runnable() { + public void run() + { + Cache.log.info("Initialising googletracker for usage stats."); + Cache.initGoogleTracker(); + Cache.log.debug("Tracking enabled."); + } + }, + new Runnable() { + public void run() { + Cache.log.info("Not enabling Google Tracking."); + } + }, null, true); + SwingUtilities.invokeLater(prompter); + } + /** * Locate the given string as a file and pass it to the groovy interpreter. * @@ -689,7 +708,7 @@ public class Jalview } return source; } - + /** * start a feature fetcher for every alignment frame *