*/
package jalview.gui;
+import jalview.bin.Cache;
+import jalview.util.BrowserLauncher;
import jalview.util.MessageManager;
-import java.io.*;
-import java.net.*;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
-import javax.swing.*;
+import javax.swing.JOptionPane;
public class UserQuestionnaireCheck implements Runnable
{
{
if (url.indexOf("questionnaire.pl") == -1)
{
- jalview.bin.Cache.log
+ Cache.log
.error("'"
+ url
+ "' is an Invalid URL for the checkForQuestionnaire() method.\n"
private boolean checkresponse(URL qurl) throws Exception
{
- jalview.bin.Cache.log.debug("Checking Response for : " + qurl);
+ Cache.log.debug("Checking Response for : " + qurl);
boolean prompt = false;
// see if we have already responsed to this questionnaire or get a new
// qid/rid pair
try
{
// First - check to see if wee have an old questionnaire/response id pair.
- String lastq = jalview.bin.Cache.getProperty("QUESTIONNAIRE");
+ String lastq = Cache.getProperty("QUESTIONNAIRE");
if (lastq == null)
{
prompt = checkresponse(new URL(url
if (qid != null && rid != null)
{
// Update our local property cache with latest qid and rid
- jalview.bin.Cache.setProperty("QUESTIONNAIRE", qid + ":" + rid);
+ Cache.setProperty("QUESTIONNAIRE", qid + ":" + rid);
}
if (prompt)
{
String qurl = url + (url.indexOf('?') > -1 ? "&" : "?") + "qid="
+ qid + "&rid=" + rid;
- jalview.bin.Cache.log.info("Prompting user for questionnaire at "
+ Cache.log.info("Prompting user for questionnaire at "
+ qurl);
int reply = JOptionPane
.showInternalConfirmDialog(Desktop.desktop, MessageManager
if (reply == JOptionPane.YES_OPTION)
{
- jalview.bin.Cache.log.debug("Opening " + qurl);
- jalview.util.BrowserLauncher.openURL(qurl);
+ Cache.log.debug("Opening " + qurl);
+ BrowserLauncher.openURL(qurl);
}
}
} catch (Exception e)
{
- jalview.bin.Cache.log.warn("When trying to access questionnaire URL "
+ Cache.log.warn("When trying to access questionnaire URL "
+ url, e);
}
}