// Path: src/org/openjira/jira/JiraConn.java
// public interface LoginListener {
// 	public void onLoginComplete();
// 
// 	public void onLoginError(Exception e);
// 
// 	public void onSyncProgress(String message, int progress, int max);
// }


import org.openjira.jira.JiraConn.LoginListener;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
				// validate connection, on failure cancel next steps
				// TODO: needs to be redesigned because connection test is
				// asynchronous and we need to wait here for the real result...
				if (testConnection(serverName, serverUrl, username, password)) {
					// Build a return bundle
				}
			}

			/**
			 * This function is testing a connection with the given URL and user
			 * credentials. For better usability it shows a ProgressDialog until
			 * the validation is on progress. (Dialog disabled currently!)
			 * 
			 * @param name
			 *            The name of the server connection
			 * @param url
			 *            complete server url e.g. http://jira.atlassian.com
			 * @param user
			 *            (optional) username for login attempts
			 * @param pass
			 *            (optional) password for login attempts
			 * @return return true on success, false otherwise
			 */
			private boolean testConnection(final String name, final String url, final String user, final String pass) {
				// final JiraConn conn = new JiraConn(url, user, pass);

				final ProgressDialog dlg = new ProgressDialog(EditServer.this);
				dlg.setMessage("Testing connection");
				dlg.show();

// Path: src/org/openjira/jira/JiraConn.java
// public interface LoginListener {
// 	public void onLoginComplete();
// 
// 	public void onLoginError(Exception e);
// 
// 	public void onSyncProgress(String message, int progress, int max);
// }


// Path: src/org/openjira/jira/EditServer.java
import org.openjira.jira.JiraConn.LoginListener;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

				// validate connection, on failure cancel next steps
				// TODO: needs to be redesigned because connection test is
				// asynchronous and we need to wait here for the real result...
				if (testConnection(serverName, serverUrl, username, password)) {
					// Build a return bundle
				}
			}

			/**
			 * This function is testing a connection with the given URL and user
			 * credentials. For better usability it shows a ProgressDialog until
			 * the validation is on progress. (Dialog disabled currently!)
			 * 
			 * @param name
			 *            The name of the server connection
			 * @param url
			 *            complete server url e.g. http://jira.atlassian.com
			 * @param user
			 *            (optional) username for login attempts
			 * @param pass
			 *            (optional) password for login attempts
			 * @return return true on success, false otherwise
			 */
			private boolean testConnection(final String name, final String url, final String user, final String pass) {
				// final JiraConn conn = new JiraConn(url, user, pass);

				final ProgressDialog dlg = new ProgressDialog(EditServer.this);
				dlg.setMessage("Testing connection");
				dlg.show();

				JiraConn.testLogin(url, user, pass, new LoginListener() {