// Path: src/com/hdweiss/codemap/view/project/ProjectBrowser.java
// public class SynchServiceReceiver extends BroadcastReceiver {
// 	public static final String SYNC_UPDATE = "com.hdweiss.codemap.action.SYNC_UPDATE";
// 		
// 	public static final String SYNC_NAME = "sync_name";
// 	public static final String SYNC_STATUS = "sync_status"; 
// 	public static final String SYNC_START = "sync_start";
// 	public static final String SYNC_DONE = "sync_done";
// 	public static final String SYNC_PROGRESS_UPDATE = "sync_update";
// 
// 	@Override
// 	public void onReceive(Context context, Intent intent) {
// 		boolean syncStart = intent.getBooleanExtra(SYNC_START, false);
// 		boolean syncDone = intent.getBooleanExtra(SYNC_DONE, false);
// 		int progress = intent.getIntExtra(SYNC_PROGRESS_UPDATE, -1);
// 
// 		String status = intent.getStringExtra(SYNC_STATUS);
// 		String projectName = intent.getStringExtra(SYNC_NAME);
// 		int position = ((ProjectAdapter)listView.getAdapter()).getItemPosition(projectName);
// 		ProjectItemView itemView = (ProjectItemView) listView.getChildAt(position);
// 			
// 		if (itemView == null)
// 			return;
// 
// 		if(syncStart) {
// 			itemView.beginUpdate();
// 		} else if (syncDone) {
// 			itemView.endUpdate();
// 				
// 		} else {
// 			if(progress > -1)
// 				itemView.setProgress(progress);
// 			itemView.setStatus(status);
// 		}
// 	}
// }


import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import android.content.Context;
import android.content.Intent;
import android.graphics.Rect;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.NetworkInfo.State;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;
import android.view.TouchDelegate;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import com.hdweiss.codemap.view.project.ProjectBrowser.SynchServiceReceiver;

			return null;
		}
	}
	
	public static void deleteRecursive(File fileOrDirectory) {
	    if (fileOrDirectory.isDirectory())
	        for (File child : fileOrDirectory.listFiles())
	            deleteRecursive(child);

	    fileOrDirectory.delete();
	}
	
	public static void setupSpinner(Spinner spinner, ArrayList<String> data,
			String selection) {		
		if(!TextUtils.isEmpty(selection) && !data.contains(selection))
			data.add(selection);

		ArrayAdapter<String> adapter = new ArrayAdapter<String>(spinner.getContext(),
				android.R.layout.simple_spinner_item, data);
		spinner.setAdapter(adapter);
		int pos = data.indexOf(selection);
		if (pos < 0) {
			pos = 0;
		}
		spinner.setSelection(pos, true);
	}
	
	
	public static void announceSyncDone(Context context, String name) {
// Path: src/com/hdweiss/codemap/view/project/ProjectBrowser.java
// public class SynchServiceReceiver extends BroadcastReceiver {
// 	public static final String SYNC_UPDATE = "com.hdweiss.codemap.action.SYNC_UPDATE";
// 		
// 	public static final String SYNC_NAME = "sync_name";
// 	public static final String SYNC_STATUS = "sync_status"; 
// 	public static final String SYNC_START = "sync_start";
// 	public static final String SYNC_DONE = "sync_done";
// 	public static final String SYNC_PROGRESS_UPDATE = "sync_update";
// 
// 	@Override
// 	public void onReceive(Context context, Intent intent) {
// 		boolean syncStart = intent.getBooleanExtra(SYNC_START, false);
// 		boolean syncDone = intent.getBooleanExtra(SYNC_DONE, false);
// 		int progress = intent.getIntExtra(SYNC_PROGRESS_UPDATE, -1);
// 
// 		String status = intent.getStringExtra(SYNC_STATUS);
// 		String projectName = intent.getStringExtra(SYNC_NAME);
// 		int position = ((ProjectAdapter)listView.getAdapter()).getItemPosition(projectName);
// 		ProjectItemView itemView = (ProjectItemView) listView.getChildAt(position);
// 			
// 		if (itemView == null)
// 			return;
// 
// 		if(syncStart) {
// 			itemView.beginUpdate();
// 		} else if (syncDone) {
// 			itemView.endUpdate();
// 				
// 		} else {
// 			if(progress > -1)
// 				itemView.setProgress(progress);
// 			itemView.setStatus(status);
// 		}
// 	}
// }


// Path: src/com/hdweiss/codemap/util/Utils.java
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import android.content.Context;
import android.content.Intent;
import android.graphics.Rect;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.NetworkInfo.State;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;
import android.view.TouchDelegate;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import com.hdweiss.codemap.view.project.ProjectBrowser.SynchServiceReceiver;


			return null;
		}
	}
	
	public static void deleteRecursive(File fileOrDirectory) {
	    if (fileOrDirectory.isDirectory())
	        for (File child : fileOrDirectory.listFiles())
	            deleteRecursive(child);

	    fileOrDirectory.delete();
	}
	
	public static void setupSpinner(Spinner spinner, ArrayList<String> data,
			String selection) {		
		if(!TextUtils.isEmpty(selection) && !data.contains(selection))
			data.add(selection);

		ArrayAdapter<String> adapter = new ArrayAdapter<String>(spinner.getContext(),
				android.R.layout.simple_spinner_item, data);
		spinner.setAdapter(adapter);
		int pos = data.indexOf(selection);
		if (pos < 0) {
			pos = 0;
		}
		spinner.setSelection(pos, true);
	}
	
	
	public static void announceSyncDone(Context context, String name) {
		Intent intent = new Intent(SynchServiceReceiver.SYNC_UPDATE);