// Path: src/fr/xtof54/jsgo/EventManager.java
// enum eventType {loginStarted, loginEnd, downloadListStarted, downloadListEnd, downloadListGamesEnd, downloadGameStarted, downloadGameEnd, GameOK, moveSentStart, moveSentEnd, gobanReady,
// 	msgSendStart, msgSendEnd, ladderStart, ladderEnd, ladderChallengeStart, ladderChallengeEnd, showMessage, copyEidogoStart, copyEidogoEnd};
// 
// Path: src/fr/xtof54/jsgo/GoJsActivity.java
// enum guistate {nogame, play, markDeadStones, checkScore, message, review, forums};


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URLDecoder;
import java.util.ArrayList;
import fr.xtof54.jsgo.R;
import fr.xtof54.jsgo.EventManager.eventType;
import fr.xtof54.jsgo.GoJsActivity.guistate;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
						if (tmpchosen<0) {
							EventManager.getEventManager().sendEvent(eventType.showMessage, "No sgf selected");
						} else {
							cursgf = tmpchosen;
							curmove = 0;
							saveCurReview();
							contReviews();
						}
					}
				})
				.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int id) {
						DetListDialogFragment.this.getDialog().dismiss();
					}
				});
				return builder.create();
			}
		}
		tmpchosen=-1;
		final DetListDialogFragment msgdialog = new DetListDialogFragment();
		msgdialog.show(GoJsActivity.main.getSupportFragmentManager(),"reviews");
	}

	public static void saveCurReview() {
		System.out.println("save review pos "+cursgf+" "+curmove);
		PrefUtils.saveToPrefs(GoJsActivity.main, "REVIEWSGF", cursgf);
		PrefUtils.saveToPrefs(GoJsActivity.main, "REVIEWMOVE", curmove);
	}
	
	public static void contReviews() {
// Path: src/fr/xtof54/jsgo/EventManager.java
// enum eventType {loginStarted, loginEnd, downloadListStarted, downloadListEnd, downloadListGamesEnd, downloadGameStarted, downloadGameEnd, GameOK, moveSentStart, moveSentEnd, gobanReady,
// 	msgSendStart, msgSendEnd, ladderStart, ladderEnd, ladderChallengeStart, ladderChallengeEnd, showMessage, copyEidogoStart, copyEidogoEnd};
// 
// Path: src/fr/xtof54/jsgo/GoJsActivity.java
// enum guistate {nogame, play, markDeadStones, checkScore, message, review, forums};


// Path: src/fr/xtof54/jsgo/Reviews.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URLDecoder;
import java.util.ArrayList;
import fr.xtof54.jsgo.R;
import fr.xtof54.jsgo.EventManager.eventType;
import fr.xtof54.jsgo.GoJsActivity.guistate;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;

						if (tmpchosen<0) {
							EventManager.getEventManager().sendEvent(eventType.showMessage, "No sgf selected");
						} else {
							cursgf = tmpchosen;
							curmove = 0;
							saveCurReview();
							contReviews();
						}
					}
				})
				.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int id) {
						DetListDialogFragment.this.getDialog().dismiss();
					}
				});
				return builder.create();
			}
		}
		tmpchosen=-1;
		final DetListDialogFragment msgdialog = new DetListDialogFragment();
		msgdialog.show(GoJsActivity.main.getSupportFragmentManager(),"reviews");
	}

	public static void saveCurReview() {
		System.out.println("save review pos "+cursgf+" "+curmove);
		PrefUtils.saveToPrefs(GoJsActivity.main, "REVIEWSGF", cursgf);
		PrefUtils.saveToPrefs(GoJsActivity.main, "REVIEWMOVE", curmove);
	}
	
	public static void contReviews() {
		GoJsActivity.main.changeState(guistate.review);